From 251df58fcca17f4ffc0cb4bcc3cd410ef3b0811d Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 22 Nov 2023 09:04:58 +0100 Subject: [PATCH 001/151] Added title to function --- cellconstructor/Spectral.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cellconstructor/Spectral.py b/cellconstructor/Spectral.py index c26dd0f3..020b3a43 100644 --- a/cellconstructor/Spectral.py +++ b/cellconstructor/Spectral.py @@ -3718,6 +3718,8 @@ def get_dielectric_function(dyn, k_grid, T, e0 ,e1, de, ie, ismear # ( tensor3,omega,N,nu,q, d_bubble_cart, ener, epsilon_inf,atom_a, atom_b, ne,frequency,dielectric_tensor,tensor2,effective_charges,energies,spectralf,N,Big_omega) """ + This function computes the dielectric function. + Input data: epsilon_inf = dielctric constant of vacuum ---> Phonon.Phonon.dielectric_tensor(3x3) a = atom a -> M(a) mass of atom a ---> tensor2 = CC.ForceTensor.Tensor2(dyn.structure, dyn_gemnerate_supwercell(dyn.GetSupercell()),dyn_GetSupercell()); tensor2.SetupFromPhonons(dyn); tensor2.center() ---> structure = tensor2.unitcell_structure ---> structure.get_masses_array() From bf60173c15c7fc3b591b551386747792157341b8 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 22 Nov 2023 09:05:45 +0100 Subject: [PATCH 002/151] Added documentation to subfunction --- cellconstructor/Spectral.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cellconstructor/Spectral.py b/cellconstructor/Spectral.py index 020b3a43..d408b657 100644 --- a/cellconstructor/Spectral.py +++ b/cellconstructor/Spectral.py @@ -3719,7 +3719,7 @@ def get_dielectric_function(dyn, k_grid, T, e0 ,e1, de, ie, ismear """ This function computes the dielectric function. - + Input data: epsilon_inf = dielctric constant of vacuum ---> Phonon.Phonon.dielectric_tensor(3x3) a = atom a -> M(a) mass of atom a ---> tensor2 = CC.ForceTensor.Tensor2(dyn.structure, dyn_gemnerate_supwercell(dyn.GetSupercell()),dyn_GetSupercell()); tensor2.SetupFromPhonons(dyn); tensor2.center() ---> structure = tensor2.unitcell_structure ---> structure.get_masses_array() @@ -3781,6 +3781,9 @@ def get_dielectric_function(dyn, k_grid, T, e0 ,e1, de, ie, ismear # ========================================================================================== #---------------------------------------------------------------- def compute_k(k): + """ + This function computes the k value. + """ # phi3 in q, k, -q - k t1 = time.time() phi3=tensor3.Interpolate(k,-q-k, asr = False) From f9b0d5d63faf2c3907758302c7581dae02082136 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 27 Nov 2023 09:17:38 +0100 Subject: [PATCH 003/151] OMP loop for big number of atoms. --- FModules/third_order_dynbubble.f90 | 206 +++++++++++++++-------------- 1 file changed, 104 insertions(+), 102 deletions(-) diff --git a/FModules/third_order_dynbubble.f90 b/FModules/third_order_dynbubble.f90 index b2677c4e..308a1fb0 100644 --- a/FModules/third_order_dynbubble.f90 +++ b/FModules/third_order_dynbubble.f90 @@ -17,30 +17,30 @@ subroutine compute_static_bubble(T,freq,is_gamma,D3,n_mod,bubble) real(kind=DP) :: Lambda_23,q2(n_mod,3),q3(n_mod,3) integer :: i, rho2, rho3, nu,mu - - ! + + ! ! do i = 1,n_mod ! q2(i,1)=freq(i,2) ! q2(i,2)=freqm1(i,2) -! q2(i,3)=bose(i,2) +! q2(i,3)=bose(i,2) ! q3(i,1)=freq(i,3) -! q3(i,2)=freqm1(i,3) -! q3(i,3)=bose(i,3) +! q3(i,2)=freqm1(i,3) +! q3(i,3)=bose(i,3) ! end do ! - + q2(:,1)=freq(:,2) - q3(:,1)=freq(:,3) - + q3(:,1)=freq(:,3) + q2(:,2)=0.0_dp q3(:,2)=0.0_dp do i = 1, n_mod if (.not. is_gamma(2) .or. i > 3) q2(i,2)=1.0_dp/freq(i,2) if (.not. is_gamma(3) .or. i > 3) q3(i,2)=1.0_dp/freq(i,3) - end do + end do call bose_freq(T, n_mod, freq(:,2), q2(:,3)) - call bose_freq(T, n_mod, freq(:,3), q3(:,3)) + call bose_freq(T, n_mod, freq(:,3), q3(:,3)) ! bubble=(0.0_dp,0.0_dp) @@ -52,13 +52,13 @@ subroutine compute_static_bubble(T,freq,is_gamma,D3,n_mod,bubble) ! DO nu = 1,n_mod DO mu = 1,n_mod - bubble(mu,nu) = bubble(mu,nu) + & + bubble(mu,nu) = bubble(mu,nu) + & CONJG(D3(mu,rho2,rho3))*Lambda_23*D3(nu,rho2,rho3) END DO - END DO + END DO ! END DO - END DO + END DO ! end subroutine compute_static_bubble ! @@ -71,8 +71,8 @@ subroutine compute_dynamic_bubble(energies,sigma,static_limit,T,freq,is_gamma,D3 complex(kind=DP), dimension(ne,nsig,n_mod,n_mod),intent(OUT) :: bubble ! integer, intent(IN) :: ne - real(kind=DP), intent(IN) :: energies(ne) - integer, intent(IN) :: nsig + real(kind=DP), intent(IN) :: energies(ne) + integer, intent(IN) :: nsig real(kind=DP), intent(IN) :: sigma(nsig) real(kind=DP), intent(IN) :: T real(kind=DP), intent(IN) :: freq(n_mod,3) @@ -83,33 +83,33 @@ subroutine compute_dynamic_bubble(energies,sigma,static_limit,T,freq,is_gamma,D3 integer, intent(IN) :: n_mod ! real(kind=DP) :: q2(n_mod,3),q3(n_mod,3) - complex(kind=DP) :: Lambda_23(ne,nsig) + complex(kind=DP) :: Lambda_23(ne,nsig) integer :: i, rho2, rho3, nu,mu - - ! + + ! ! do i = 1,n_mod ! q2(i,1)=freq(i,2) ! q2(i,2)=freqm1(i,2) -! q2(i,3)=bose(i,2) +! q2(i,3)=bose(i,2) ! q3(i,1)=freq(i,3) -! q3(i,2)=freqm1(i,3) -! q3(i,3)=bose(i,3) +! q3(i,2)=freqm1(i,3) +! q3(i,3)=bose(i,3) ! end do ! - + q2(:,1)=freq(:,2) - q3(:,1)=freq(:,3) - + q3(:,1)=freq(:,3) + q2(:,2)=0.0_dp q3(:,2)=0.0_dp do i = 1, n_mod if (.not. is_gamma(2) .or. i > 3) q2(i,2)=1.0_dp/freq(i,2) if (.not. is_gamma(3) .or. i > 3) q3(i,2)=1.0_dp/freq(i,3) - end do + end do call bose_freq(T, n_mod, freq(:,2), q2(:,3)) - call bose_freq(T, n_mod, freq(:,3), q3(:,3)) + call bose_freq(T, n_mod, freq(:,3), q3(:,3)) ! bubble=(0.0_dp,0.0_dp) ! @@ -120,25 +120,25 @@ subroutine compute_dynamic_bubble(energies,sigma,static_limit,T,freq,is_gamma,D3 ! if (diag_approx) then DO nu = 1,n_mod - bubble(:,:,nu,nu) = bubble(:,:,nu,nu) + & + bubble(:,:,nu,nu) = bubble(:,:,nu,nu) + & CONJG(D3(nu,rho2,rho3))*Lambda_23(:,:)*D3(nu,rho2,rho3) END DO else DO nu = 1,n_mod DO mu = 1,n_mod - bubble(:,:,mu,nu) = bubble(:,:,mu,nu) + & + bubble(:,:,mu,nu) = bubble(:,:,mu,nu) + & CONJG(D3(mu,rho2,rho3))*Lambda_23(:,:)*D3(nu,rho2,rho3) END DO END DO end if ! END DO - END DO + END DO ! end subroutine compute_dynamic_bubble ! ! -! +! subroutine compute_diag_dynamic_bubble(ne,energies,nsig,sigma,T,freq,is_gamma,D3,n_mod,bubble) implicit none INTEGER, PARAMETER :: DP = selected_real_kind(14,200) @@ -146,8 +146,8 @@ subroutine compute_diag_dynamic_bubble(ne,energies,nsig,sigma,T,freq,is_gamma,D3 complex(kind=DP), dimension(ne,nsig,n_mod),intent(OUT) :: bubble ! integer, intent(IN) :: ne - real(kind=DP), intent(IN) :: energies(ne) - integer, intent(IN) :: nsig + real(kind=DP), intent(IN) :: energies(ne) + integer, intent(IN) :: nsig real(kind=DP), intent(IN) :: sigma(nsig) real(kind=DP), intent(IN) :: T real(kind=DP), intent(IN) :: freq(n_mod,3) @@ -156,33 +156,33 @@ subroutine compute_diag_dynamic_bubble(ne,energies,nsig,sigma,T,freq,is_gamma,D3 integer, intent(IN) :: n_mod ! real(kind=DP) :: q2(n_mod,3),q3(n_mod,3) - complex(kind=DP) :: Lambda_23(ne,nsig) + complex(kind=DP) :: Lambda_23(ne,nsig) integer :: i, rho2, rho3, nu,mu logical, parameter :: static_limit = .false. - - ! + + ! ! do i = 1,n_mod ! q2(i,1)=freq(i,2) ! q2(i,2)=freqm1(i,2) -! q2(i,3)=bose(i,2) +! q2(i,3)=bose(i,2) ! q3(i,1)=freq(i,3) -! q3(i,2)=freqm1(i,3) -! q3(i,3)=bose(i,3) +! q3(i,2)=freqm1(i,3) +! q3(i,3)=bose(i,3) ! end do ! - + q2(:,1)=freq(:,2) - q3(:,1)=freq(:,3) - + q3(:,1)=freq(:,3) + q2(:,2)=0.0_dp q3(:,2)=0.0_dp do i = 1, n_mod if (.not. is_gamma(2) .or. i > 3) q2(i,2)=1.0_dp/freq(i,2) if (.not. is_gamma(3) .or. i > 3) q3(i,2)=1.0_dp/freq(i,3) - end do + end do call bose_freq(T, n_mod, freq(:,2), q2(:,3)) - call bose_freq(T, n_mod, freq(:,3), q3(:,3)) + call bose_freq(T, n_mod, freq(:,3), q3(:,3)) ! bubble=(0.0_dp,0.0_dp) @@ -190,17 +190,17 @@ subroutine compute_diag_dynamic_bubble(ne,energies,nsig,sigma,T,freq,is_gamma,D3 DO rho3=1,n_mod DO rho2=1,n_mod ! - call Lambda_dynamic(ne,energies,nsig,sigma,T,static_limit,q2(rho2,:),q3(rho3,:),Lambda_23) + call Lambda_dynamic(ne,energies,nsig,sigma,T,static_limit,q2(rho2,:),q3(rho3,:),Lambda_23) ! DO mu = 1,n_mod - ! - bubble(:,:,mu) = bubble(:,:,mu) + & + ! + bubble(:,:,mu) = bubble(:,:,mu) + & CONJG(D3(mu,rho2,rho3))*Lambda_23(:,:)*D3(mu,rho2,rho3) ! - END DO + END DO ! END DO - END DO + END DO ! end subroutine compute_diag_dynamic_bubble ! @@ -211,7 +211,7 @@ subroutine compute_perturb_selfnrg(nsig,sigma,T,freq,is_gamma,D3,n_mod,selfnrg) ! complex(kind=DP), dimension(n_mod,nsig),intent(OUT) :: selfnrg ! - integer, intent(IN) :: nsig + integer, intent(IN) :: nsig real(kind=DP), intent(IN) :: sigma(nsig) real(kind=DP), intent(IN) :: T real(kind=DP), intent(IN) :: freq(n_mod,3) @@ -220,31 +220,31 @@ subroutine compute_perturb_selfnrg(nsig,sigma,T,freq,is_gamma,D3,n_mod,selfnrg) integer, intent(IN) :: n_mod ! real(kind=DP) :: q2(n_mod,3),q3(n_mod,3) - complex(kind=DP) :: Lambda_23_freq(n_mod,nsig) + complex(kind=DP) :: Lambda_23_freq(n_mod,nsig) integer :: i, rho2, rho3, nu,mu - ! + ! ! do i = 1,n_mod ! q2(i,1)=freq(i,2) ! q2(i,2)=freqm1(i,2) -! q2(i,3)=bose(i,2) +! q2(i,3)=bose(i,2) ! q3(i,1)=freq(i,3) -! q3(i,2)=freqm1(i,3) -! q3(i,3)=bose(i,3) +! q3(i,2)=freqm1(i,3) +! q3(i,3)=bose(i,3) ! end do ! - + q2(:,1)=freq(:,2) - q3(:,1)=freq(:,3) - + q3(:,1)=freq(:,3) + q2(:,2)=0.0_dp q3(:,2)=0.0_dp do i = 1, n_mod if (.not. is_gamma(2) .or. i > 3) q2(i,2)=1.0_dp/freq(i,2) if (.not. is_gamma(3) .or. i > 3) q3(i,2)=1.0_dp/freq(i,3) - end do + end do call bose_freq(T, n_mod, freq(:,2), q2(:,3)) - call bose_freq(T, n_mod, freq(:,3), q3(:,3)) + call bose_freq(T, n_mod, freq(:,3), q3(:,3)) ! selfnrg=(0.0_dp,0.0_dp) @@ -253,16 +253,16 @@ subroutine compute_perturb_selfnrg(nsig,sigma,T,freq,is_gamma,D3,n_mod,selfnrg) DO rho3=1,n_mod DO rho2=1,n_mod ! - call Lambda_dynamic_value(n_mod,freq(:,1),nsig,sigma,T,q2(rho2,:),q3(rho3,:),Lambda_23_freq) + call Lambda_dynamic_value(n_mod,freq(:,1),nsig,sigma,T,q2(rho2,:),q3(rho3,:),Lambda_23_freq) ! DO mu = 1,n_mod - - selfnrg(mu,:) = selfnrg(mu,:) + & + + selfnrg(mu,:) = selfnrg(mu,:) + & CONJG(D3(mu,rho2,rho3))*Lambda_23_freq(mu,:)*D3(mu,rho2,rho3) - END DO + END DO ! END DO - END DO + END DO ! end subroutine compute_perturb_selfnrg ! @@ -283,13 +283,13 @@ subroutine compute_spectralf(smear_id,ener,d2,Pi,notransl,spectralf,mass,nat,ne, real(kind=dp), intent(out) :: spectralf(ne,nsmear) ! integer :: nat3,n,m,ismear,ie - complex(kind=dp) :: G(3*nat,3*nat) + complex(kind=dp) :: G(3*nat,3*nat) complex(kind=dp) :: fact - + nat3=3*nat - + spectralf=0.0_dp - ! + ! DO ismear=1,nsmear DO ie = 1,ne ! GREEN FUNCTION INVERSE @@ -305,15 +305,15 @@ subroutine compute_spectralf(smear_id,ener,d2,Pi,notransl,spectralf,mass,nat,ne, G(n,n)=G(n,n)+(ener(ie)+fact)**2 ENDDO ! INVERSE - CALL invzmat(nat3, G) + CALL invzmat(nat3, G) IF ( notransl ) THEN - CALL eliminate_transl(G,mass,nat) - END IF + CALL eliminate_transl(G,mass,nat) + END IF DO n=1,nat3 spectralf(ie,ismear)=spectralf(ie,ismear)-2*DIMAG(G(n,n))*ener(ie)/twopi - END DO + END DO + ENDDO ENDDO - ENDDO ! end subroutine compute_spectralf ! @@ -324,7 +324,7 @@ subroutine compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,nat,ne,nsmear,sp real(kind=dp),parameter :: pi = 3.141592653589793_dp ! real(kind=dp), intent(in) :: ener(ne) - real(kind=dp), intent(in) :: smear_id(nsmear) + real(kind=dp), intent(in) :: smear_id(nsmear) integer, intent(in) :: ne,nsmear,nat real(kind=dp), intent(in) :: d2_freq(3*nat) complex(kind=dp), intent(in) :: selfnrg(ne,nsmear,3*nat) @@ -337,15 +337,16 @@ subroutine compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,nat,ne,nsmear,sp nat3=3*nat spectralf=0.0_dp ! + !$OMP PARALLEL DO DO ismear = 1,nsmear DO mu = 1,nat3 DO ie = 1, ne a = ener(ie)**2-smear_id(ismear)**2-d2_freq(mu)**2-DBLE(selfnrg(ie,ismear,mu)) - b = 2*smear_id(ismear)*ener(ie)-DIMAG(selfnrg(ie,ismear,mu)) - + b = 2*smear_id(ismear)*ener(ie)-DIMAG(selfnrg(ie,ismear,mu)) + ! - ! (w/2pi)(-2Im [1/a+ib])= (w/pi) b/(a**2+b**2) + ! (w/2pi)(-2Im [1/a+ib])= (w/pi) b/(a**2+b**2) ! num = ener(ie)*b denom = (a**2+b**2)*pi @@ -358,6 +359,7 @@ subroutine compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,nat,ne,nsmear,sp ENDDO ENDDO ENDDO + !$OMP END PARALLEL DO ! end subroutine compute_spectralf_diag ! @@ -366,17 +368,17 @@ end subroutine compute_spectralf_diag subroutine Lambda(T,w_q2,w_q3,Lambda_out) implicit none INTEGER, PARAMETER :: DP = selected_real_kind(14,200) - REAL(kind=DP),intent(out) :: lambda_out + REAL(kind=DP),intent(out) :: lambda_out real(kind=DP), intent(in) :: T,w_q2(3),w_q3(3) real(kind=DP) :: w2,w3,n2,n3,w2m1,w3m1 real(kind=DP) :: bose_P, bose_M, omega_P, omega_M, ctm_P, ctm_M - ! + ! w2=w_q2(1) - w3=w_q3(1) + w3=w_q3(1) w2m1=w_q2(2) w3m1=w_q3(2) n2=w_q2(3) - n3=w_q3(3) + n3=w_q3(3) ! bose_P = 1 + n2 + n3 omega_P = w3+w2 @@ -409,23 +411,23 @@ end subroutine Lambda subroutine Lambda_dynamic(ne,energies,nsigma,sigma,T,static_limit,w_q2,w_q3,Lambda_out) implicit none INTEGER, PARAMETER :: DP = selected_real_kind(14,200) - complex(kind=DP), intent(out) :: Lambda_out(ne,nsigma) + complex(kind=DP), intent(out) :: Lambda_out(ne,nsigma) integer, intent(in) :: ne,nsigma logical, intent(in) :: static_limit - real(kind=DP), intent(in) :: energies(ne), sigma(nsigma) + real(kind=DP), intent(in) :: energies(ne), sigma(nsigma) real(kind=DP), intent(in) :: T,w_q2(3),w_q3(3) real(kind=DP) :: w2,w3,n2,n3,w2m1,w3m1 real(kind=DP) :: bose_P, bose_M, omega_P, omega_P2 ,& omega_M,omega_M2 complex(kind=DP) :: reg, ctm_P, ctm_M, ctm(ne,nsigma) integer :: ie, isigma - ! + ! w2=w_q2(1) - w3=w_q3(1) + w3=w_q3(1) w2m1=w_q2(2) w3m1=w_q3(2) n2=w_q2(3) - n3=w_q3(3) + n3=w_q3(3) ! bose_P = 1 + n2 + n3 omega_P = w3+w2 @@ -461,7 +463,7 @@ subroutine Lambda_dynamic(ne,energies,nsigma,sigma,T,static_limit,w_q2,w_q3,Lamb ctm_P = bose_P *omega_P/(omega_P2-reg) ctm_M = bose_M *omega_M/(omega_M2-reg) ctm(ie,isigma) = ctm_P - ctm_M - END DO + END DO END DO END IF ! @@ -474,22 +476,22 @@ end subroutine Lambda_dynamic subroutine Lambda_dynamic_value(n_mod,value,nsigma,sigma,T,w_q2,w_q3,Lambda_out) implicit none INTEGER, PARAMETER :: DP = selected_real_kind(14,200) - complex(kind=DP), intent(out) :: Lambda_out(n_mod,nsigma) + complex(kind=DP), intent(out) :: Lambda_out(n_mod,nsigma) integer, intent(in) :: nsigma,n_mod - real(kind=DP), intent(in) :: sigma(nsigma),value(n_mod) + real(kind=DP), intent(in) :: sigma(nsigma),value(n_mod) real(kind=DP), intent(in) :: T,w_q2(3),w_q3(3) real(kind=DP) :: w2,w3,n2,n3,w2m1,w3m1 real(kind=DP) :: bose_P, bose_M, omega_P, omega_P2 ,& omega_M,omega_M2 complex(kind=DP) :: reg, ctm_P, ctm_M, ctm(n_mod,nsigma) integer :: ie, isigma,mu - ! + ! w2=w_q2(1) - w3=w_q3(1) + w3=w_q3(1) w2m1=w_q2(2) w3m1=w_q3(2) n2=w_q2(3) - n3=w_q3(3) + n3=w_q3(3) ! bose_P = 1 + n2 + n3 omega_P = w3+w2 @@ -505,7 +507,7 @@ subroutine Lambda_dynamic_value(n_mod,value,nsigma,sigma,T,w_q2,w_q3,Lambda_out) ctm_P = bose_P *omega_P/(omega_P2-reg) ctm_M = bose_M *omega_M/(omega_M2-reg) ctm(mu,isigma) = ctm_P - ctm_M - END DO + END DO END DO ! lambda_out=-ctm * w2m1*w3m1/4.0_dp @@ -546,7 +548,7 @@ ELEMENTAL FUNCTION f_bose(freq,T) ! bose (freq,T) ! REAL(DP),INTENT(in) :: freq,T ! - REAL(DP), parameter :: K_BOLTZMANN_RY= 1.3806504E-23_DP /(4.35974394E-18_DP/2) !K_BOLTZMANN_SI / (HARTREE_SI/2) + REAL(DP), parameter :: K_BOLTZMANN_RY= 1.3806504E-23_DP /(4.35974394E-18_DP/2) !K_BOLTZMANN_SI / (HARTREE_SI/2) REAL(DP) :: Tm1 ! Tm1 = 1/(T*K_BOLTZMANN_RY) @@ -576,7 +578,7 @@ SUBROUTINE invzmat (n, a) ! computes the inverse "a_inv" of matrix "a", both dimensioned (n,n) ! IMPLICIT NONE - INTEGER, PARAMETER :: DP = selected_real_kind(14,200) + INTEGER, PARAMETER :: DP = selected_real_kind(14,200) INTEGER,INTENT(in) :: n COMPLEX(DP),INTENT(inout) :: a(n,n) ! @@ -584,7 +586,7 @@ SUBROUTINE invzmat (n, a) ! info=0: inversion was successful ! lda : leading dimension (the same as n) ! ipiv : work space for pivoting (assumed of length lwork=n) - COMPLEX(DP),ALLOCATABLE :: work(:) + COMPLEX(DP),ALLOCATABLE :: work(:) INTEGER,EXTERNAL :: ILAENV ! more work space ! @@ -605,7 +607,7 @@ END SUBROUTINE invzmat SUBROUTINE eliminate_transl(A,mass,nat) ! IMPLICIT NONE - INTEGER, PARAMETER :: DP = selected_real_kind(14,200) + INTEGER, PARAMETER :: DP = selected_real_kind(14,200) INTEGER, intent(in) :: nat COMPLEX(DP), intent(inout) :: A(3*nat,3*nat) real(kind=dp), intent(in) :: mass(nat) @@ -618,7 +620,7 @@ SUBROUTINE eliminate_transl(A,mass,nat) ! DEFINE Q=1-P, P is TRANSLATION PROJECTOR QAUX=(0.0_DP,0.0_DP) ! build -P - Mtot=SUM(mass) + Mtot=SUM(mass) DO i=1,nat DO j=1,nat mj=mass(j) @@ -633,7 +635,7 @@ SUBROUTINE eliminate_transl(A,mass,nat) DO alpha=1,3 QAUX(alpha,alpha,i,i)=1.0_dp+QAUX(alpha,alpha,i,i) END DO - END DO + END DO ! DO j=1, nat DO i=1, nat @@ -642,9 +644,9 @@ SUBROUTINE eliminate_transl(A,mass,nat) Q(3*(i-1)+alpha,3*(j-1)+beta)=QAUX(alpha,beta,i,j) END DO END DO - END DO - END DO - ! PROJECT + END DO + END DO + ! PROJECT A=matmul(A,Q) ! END SUBROUTINE eliminate_transl From 07f35186bc465daeed4b7dc2c99a7c686daa8148 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 27 Nov 2023 09:45:38 +0100 Subject: [PATCH 004/151] Undo, too many proccesess at the same time --- FModules/third_order_dynbubble.f90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/FModules/third_order_dynbubble.f90 b/FModules/third_order_dynbubble.f90 index 308a1fb0..c0ede456 100644 --- a/FModules/third_order_dynbubble.f90 +++ b/FModules/third_order_dynbubble.f90 @@ -337,7 +337,6 @@ subroutine compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,nat,ne,nsmear,sp nat3=3*nat spectralf=0.0_dp ! - !$OMP PARALLEL DO DO ismear = 1,nsmear DO mu = 1,nat3 DO ie = 1, ne @@ -359,7 +358,6 @@ subroutine compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,nat,ne,nsmear,sp ENDDO ENDDO ENDDO - !$OMP END PARALLEL DO ! end subroutine compute_spectralf_diag ! From ebf3571e739394f63f20dce41a6e68e4be92a456 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 27 Nov 2023 09:50:07 +0100 Subject: [PATCH 005/151] Removed unused nu --- FModules/third_order_dynbubble.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FModules/third_order_dynbubble.f90 b/FModules/third_order_dynbubble.f90 index c0ede456..fc745657 100644 --- a/FModules/third_order_dynbubble.f90 +++ b/FModules/third_order_dynbubble.f90 @@ -157,7 +157,7 @@ subroutine compute_diag_dynamic_bubble(ne,energies,nsig,sigma,T,freq,is_gamma,D3 ! real(kind=DP) :: q2(n_mod,3),q3(n_mod,3) complex(kind=DP) :: Lambda_23(ne,nsig) - integer :: i, rho2, rho3, nu,mu + integer :: i, rho2, rho3, mu logical, parameter :: static_limit = .false. ! @@ -221,7 +221,7 @@ subroutine compute_perturb_selfnrg(nsig,sigma,T,freq,is_gamma,D3,n_mod,selfnrg) ! real(kind=DP) :: q2(n_mod,3),q3(n_mod,3) complex(kind=DP) :: Lambda_23_freq(n_mod,nsig) - integer :: i, rho2, rho3, nu,mu + integer :: i, rho2, rho3, mu ! ! do i = 1,n_mod ! q2(i,1)=freq(i,2) From 5f0a916d32e1258145dfdf77a2429aaad048be80 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 14 Dec 2023 07:20:12 +0100 Subject: [PATCH 006/151] Fix bug --- cellconstructor/Spectral.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellconstructor/Spectral.py b/cellconstructor/Spectral.py index d408b657..e7e95156 100644 --- a/cellconstructor/Spectral.py +++ b/cellconstructor/Spectral.py @@ -1346,7 +1346,7 @@ def output_file_sort_function(filename_sp, smear_id_cm, smear_cm, nsm): for ism in range(nsm): name="{:6.1f}".format(smear_cm[ism]).strip() filename_new=filename_sp+'_'+name+'.dat' - output_file_sort_function(filename_sp, smear_id_cm, smear_cm, nsm) + output_file_sort_function(filename_new, smear_id_cm, smear_cm, nsm) From 9504f9d7a811fa182d5a694a9c4a223350a6dee3 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 14 Dec 2023 07:21:44 +0100 Subject: [PATCH 007/151] Fix "output_file_sort_function" filename input --- cellconstructor/Spectral.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cellconstructor/Spectral.py b/cellconstructor/Spectral.py index e7e95156..8e6edb2a 100644 --- a/cellconstructor/Spectral.py +++ b/cellconstructor/Spectral.py @@ -2359,10 +2359,10 @@ def get_diag_dynamic_correction_along_path_multiprocessing(dyn, tensor3, """ - def output_file_sort_function(filename_sp, smear_cm, nsm): + def output_file_sort_function(filename_data, smear_cm, nsm): for ism in range(nsm): name = "{:6.2f}".format(smear_cm[ism]).strip() - filename_data = filename_sp+'_'+name+'.dat' + #filename_data = filename_sp+'_'+name+'.dat' f = open(filename_data, 'r') head1 = f.readline() head2 = f.readline() From 7e0e3f6035ab19267bdbdd8bb15dee3f97ebb592 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 15 Dec 2023 15:47:51 +0100 Subject: [PATCH 008/151] Fix bug --- cellconstructor/Spectral.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cellconstructor/Spectral.py b/cellconstructor/Spectral.py index 8e6edb2a..2da2a4b6 100644 --- a/cellconstructor/Spectral.py +++ b/cellconstructor/Spectral.py @@ -1166,11 +1166,11 @@ def get_full_dynamic_correction_along_path_multiprocessing(dyn, If 'None' then the number returned by os.cpu_count() is used. (default: None) """ - def output_file_sort_function(filename_sp, smear_id_cm, smear_cm, nsm): + def output_file_sort_function(filename_data, smear_id_cm, smear_cm, nsm): for ism in range(nsm): - name = "{:5.2f}".format(smear_id_cm[ism]).strip()+"_"+"{:6.1f}".format(smear_cm[ism]).strip() + #name = "{:5.2f}".format(smear_id_cm[ism]).strip()+"_"+"{:6.1f}".format(smear_cm[ism]).strip() # - filename_data = filename_sp+'_'+name+'.dat' + #filename_data = filename_sp+'_'+name+'.dat' f = open(filename_data, 'r') head1 = f.readline() head2 = f.readline() @@ -2359,10 +2359,10 @@ def get_diag_dynamic_correction_along_path_multiprocessing(dyn, tensor3, """ - def output_file_sort_function(filename_data, smear_cm, nsm): + def output_file_sort_function(filename_sp, smear_cm, nsm): for ism in range(nsm): name = "{:6.2f}".format(smear_cm[ism]).strip() - #filename_data = filename_sp+'_'+name+'.dat' + filename_data = filename_sp+'_'+name+'.dat' f = open(filename_data, 'r') head1 = f.readline() head2 = f.readline() From cea2c1f4d184d1752f597fe9c88936a042acb5e8 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Jan 2024 10:18:45 +0100 Subject: [PATCH 009/151] Update --- cellconstructor/Spectral.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellconstructor/Spectral.py b/cellconstructor/Spectral.py index 2da2a4b6..a305680d 100644 --- a/cellconstructor/Spectral.py +++ b/cellconstructor/Spectral.py @@ -3714,7 +3714,7 @@ def get_os_perturb_dynamic_correction_along_path(dyn, tensor3, #------------------------------------------------------------------------------- def get_dielectric_function(dyn, k_grid, T, e0 ,e1, de, ie, ismear , sm0, sm0_id - , diag_approx=False, nsm=1, static_limit=False): #skeleton function for TESTING... + , diag_approx=False, nsm=1, static_limit=False): #Function for TESTING... # ( tensor3,omega,N,nu,q, d_bubble_cart, ener, epsilon_inf,atom_a, atom_b, ne,frequency,dielectric_tensor,tensor2,effective_charges,energies,spectralf,N,Big_omega) """ From eb62a5190bcb28a9f1f1ed5a8e546f7a230e0d0b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 2 Feb 2024 12:51:05 +0100 Subject: [PATCH 010/151] Quickfix to the spglib/ASE problem --- requirements2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements2.txt b/requirements2.txt index b77539ae..590aa382 100644 --- a/requirements2.txt +++ b/requirements2.txt @@ -2,4 +2,4 @@ setuptools numpy scipy ase==3.16.0 -spglib +spglib<=2.2 From f5a69904dcc8d7a80aaba4875201cc01df74fc4b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 28 Feb 2024 09:14:47 +0100 Subject: [PATCH 011/151] Just fix a typo --- cellconstructor/Phonons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellconstructor/Phonons.py b/cellconstructor/Phonons.py index d34043d6..959898d1 100644 --- a/cellconstructor/Phonons.py +++ b/cellconstructor/Phonons.py @@ -2848,7 +2848,7 @@ def InterpolateMesh(self, mesh_dim, lo_to_splitting = False): INTERPOLATE THE DYNAMICAL MATRIX IN A FINER Q MESH ================================================== - This method employs the Tensor2 interpolateion functions + This method employs the Tensor2 interpolation functions from the ForceTensor module to perform the interpolation. Parameters From 9131e99c5dd1ced28b94027c6ea0e8aef2f14843 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Apr 2024 08:14:36 +0200 Subject: [PATCH 012/151] Djordje update --- cellconstructor/ThermalConductivity.py | 74 +++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/cellconstructor/ThermalConductivity.py b/cellconstructor/ThermalConductivity.py index 280aa0e3..d3c002d9 100644 --- a/cellconstructor/ThermalConductivity.py +++ b/cellconstructor/ThermalConductivity.py @@ -1095,7 +1095,7 @@ def calculate_kappa(self, temperatures = [300.0], write_lifetimes = True, mode = mode : Method to calculate lattice thermal conductivity: SRTA : Single relaxation time approximation (NOT selfconsistent solution) solution of Boltzmann transport equation GK : Green-Kubo method (npj Computational Materials volume 7, Article number: 57 (2021)) - offdiag_mode : How to treat the off diagonal terms. 'gk' - Isaeva et al. Nat. Comm., 'wigner' - Simoncelli et al. Nature + offdiag_mode : How to treat the off diagonal terms. 'gk' - Isaeva et al. Nat. Comm., 'wigner' - Simoncelli et al. Nature, 'perturbative' gauss_smearing : If true will use the Gaussian function to satisfy energy conservation insted of Lorentzian lf_method : In case of mode == SRTA, specifies the way to calculate lifetimes. See method in get_lifetimes function. write_lineshapes : Boolean parameter to write phonon lineshapes as they are being calculated. @@ -2289,6 +2289,78 @@ def calculate_kappa_srta_offdiag(self, temperature, ne, write_lifetimes, gauss_s kappa_diag = kappa_diag/2.0*SSCHA_TO_MS**2#*(SSCHA_TO_THZ*100.0*2.0*np.pi)**2 kappa_nondiag = kappa_nondiag/2.0*SSCHA_TO_MS**2#(SSCHA_TO_THZ*100.0*2.0*np.pi)**2 + return kappa_diag, kappa_nondiag + + ################################################################################################################################## + + def calculate_kappa_srta_offdiag_perturbative(self, temperature, ne, write_lifetimes, gauss_smearing = False, isotope_scattering = False, isotopes = None, lf_method = 'fortran-LA'): + + """ + Calculates both diagonal and off diagonal contribution to the lattice thermal conductivity (Nature Physics volume 15, pages 809–813 (2019)). + Quite slow! + """ + + lf_key = format(temperature, '.1f') + cp_key = format(temperature, '.1f') + if(lf_key in self.lifetimes.keys()): + print('Lifetimes for this temperature have already been calculated. Continuing ...') + else: + self.get_lifetimes(temperature, ne, gauss_smearing = gauss_smearing, isotope_scattering = isotope_scattering, isotopes = isotopes, method = lf_method) + if(cp_key in self.cp.keys()): + print('Phonon mode heat capacities for this temperature have already been calculated. Continuing ...') + else: + if(lf_method == 'SC'): + self.get_heat_capacity(temperature) + else: + self.get_heat_capacity(temperature) + scatt_rates = np.divide(np.ones_like(self.lifetimes[lf_key], dtype=float), self.lifetimes[lf_key], out=np.zeros_like(self.lifetimes[lf_key]), where=self.lifetimes[lf_key]!=0.0)/(SSCHA_TO_THZ*1.0e12*2.0*np.pi) + if(write_lifetimes): + self.write_transport_properties_to_file(temperature, isotope_scattering) + + kappa_diag = np.zeros((3,3)) + kappa_nondiag = np.zeros_like(kappa_diag) + for istar in self.qstar: + for iqpt in istar: + for iband in range(self.nband): + if(self.freqs[iqpt, iband] != 0.0 and scatt_rates[iqpt, iband] != 0.0): + for jband in range(self.nband): + if(self.group_velocity_mode == 'wigner'): + vel_fact = 2.0*np.sqrt(self.freqs[iqpt, jband]*self.freqs[iqpt, iband])/(self.freqs[iqpt, jband] + self.freqs[iqpt, iband]) # as per Eq.34 in Caldarelli et al + else: + vel_fact = 1.0 + #if(self.freqs[iqpt, jband] != 0.0 and np.abs(self.freqs[iqpt, jband] - self.freqs[iqpt, iband]) > 1.0e-4/SSCHA_TO_THZ and iband != jband): + if(self.freqs[iqpt, jband] != 0.0 and scatt_rates[iqpt, jband] != 0.0 and iband != jband): + gvel = np.zeros_like(self.gvels[iqpt, iband, jband]) + gvel_sum = np.zeros_like(kappa_diag, dtype=complex) + for r in self.rotations: + rot_q = np.dot(self.reciprocal_lattice.T, np.dot(r.T, np.linalg.inv(self.reciprocal_lattice.T))) + gvel = np.dot(rot_q, self.gvels[iqpt, iband, jband]) + gvel_sum += np.outer(gvel.conj(), gvel) + gvel_sum = gvel_sum.real*vel_fact**2 + a1 = self.freqs[iqpt, jband]*self.cp[cp_key][iqpt, iband]/self.freqs[iqpt, iband] + self.freqs[iqpt, iband]*self.cp[cp_key][iqpt, jband]/self.freqs[iqpt, jband] + a3 = 0.5*(scatt_rates[iqpt, iband] + scatt_rates[iqpt, jband]) + a4 = ((self.freqs[iqpt,iband] - self.freqs[iqpt,jband]))**2 + (scatt_rates[iqpt, iband] + scatt_rates[iqpt, jband])**2/4.0 + kappa_nondiag += a1*a3/a4*gvel_sum/2.0/np.pi/float(len(self.rotations))#*float(len(istar)) + elif(self.freqs[iqpt, jband] != 0.0 and iband == jband): + gvel_sum = np.zeros_like(kappa_diag, dtype=complex) + gvel = np.zeros_like(self.gvels[iqpt, iband, jband]) + for r in self.rotations: + rot_q = np.dot(self.reciprocal_lattice.T, np.dot(r.T, np.linalg.inv(self.reciprocal_lattice.T))) + gvel = np.dot(rot_q, self.gvels[iqpt, iband, jband]) + gvel_sum += np.outer(gvel.conj(), gvel) + gvel_sum = gvel_sum.real*vel_fact**2 + a1 = self.freqs[iqpt, jband]*self.cp[cp_key][iqpt, iband]/self.freqs[iqpt, iband] + self.freqs[iqpt, iband]*self.cp[cp_key][iqpt, jband]/self.freqs[iqpt, jband] + a3 = 0.5*(scatt_rates[iqpt, iband] + scatt_rates[iqpt, jband]) + a4 = (self.freqs[iqpt,iband] - self.freqs[iqpt,jband])**2 + (scatt_rates[iqpt, iband] + scatt_rates[iqpt, jband])**2/4.0 + kappa_diag += a1*a3/a4*gvel_sum/2.0/np.pi/float(len(self.rotations))#*float(len(istar)) + + kappa_diag = kappa_diag/SSCHA_TO_THZ/1.0e12 + kappa_nondiag = kappa_nondiag/SSCHA_TO_THZ/1.0e12 + + kappa_diag += kappa_diag.T + kappa_nondiag += kappa_nondiag.T + kappa_diag = kappa_diag/2.0*SSCHA_TO_MS**2#*(SSCHA_TO_THZ*100.0*2.0*np.pi)**2 + kappa_nondiag = kappa_nondiag/2.0*SSCHA_TO_MS**2#(SSCHA_TO_THZ*100.0*2.0*np.pi)**2 return kappa_diag, kappa_nondiag From 608948e3481cb1bad2aaa460d86954676f5aca2a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 09:16:01 +0200 Subject: [PATCH 013/151] Test Meson compilation --- meson.build | 149 +++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 54 ++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 meson.build create mode 100644 pyproject.toml diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..f85d015c --- /dev/null +++ b/meson.build @@ -0,0 +1,149 @@ +project('CellConstructor', 'fortran', 'c', 'python', + version: '1.5.0', + license: 'GPL', + # Common compilation options for Fortran. + # -cpp is essential for the Fortran preprocessor. + # -O2 is a general optimization you had in setup.py. + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +# Imports the Meson Python module to handle extensions and Python installation. +python = import('python') +python_installation = python.find_installation() + +# Defines the Python dependencies that numpy.distutils used to handle. +# Meson will look for them in the current Python environment. +numpy_dep = python_installation.dependency('numpy', required: true) +ase_dep = python_installation.dependency('ase', required: true) +scipy_dep = python_installation.dependency('scipy', required: true) + +# Searches the system for the BLAS and LAPACK libraries. +# Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) + +# Look for the OpenMP library if it is needed for parallelization. +openmp_dep = dependency('openmp', required: true) + + +# --- Definition of Fortran Extensions --- + +# Extensión 'symph' +symph_sources = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', + 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', + 'FModules/error_handler.f90', 'FModules/io_global.f90', + 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', + 'FModules/q2qstar_out.f90', 'FModules/rotate_and_add_dyn.f90', + 'FModules/trntnsc.f90', 'FModules/star_q.f90', 'FModules/eqvect.f90', + 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', + 'FModules/constants.f90', 'FModules/eff_charge_interp.f90', + 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' +) +# Create a Python extension module using the Fortran sources and dependencies. +py_symph_ext = python_installation.extension_module( + 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) + symph_sources, + # Compilation arguments specific to these Fortran sources. + # -cpp is already defined in default_options, but can be added here if needed. + # fortran_args: ['-cpp'], + dependencies: [numpy_dep, lapack_dep, blas_dep] +) + +# Extensión 'secondorder' +secondorder_sources = files( + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +) +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_sources, + # fortran_args: ['-cpp'], + dependencies: [numpy_dep, lapack_dep, blas_dep] +) + +# Extensión 'thirdorder' +thirdorder_sources = files( + 'FModules/third_order_centering.f90', + 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', + 'FModules/third_order_dynbubble.f90' +) +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_sources, + # fortran_args: ['-cpp'], + dependencies: [numpy_dep, lapack_dep, blas_dep] +) + +# Extensión 'thermal_conductivity' +cond_sources = files( + 'FModules/get_scattering_q_grid.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/get_lf.f90' +) +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_sources, + # '-fopenmp' is explicitly added here for this specific extension. + # "-O2" is already in default_options. + fortran_args: ['-fopenmp'], + dependencies: [numpy_dep, lapack_dep, blas_dep, openmp_dep] +) + +# --- Definition of the C Extension 'cc_linalg' --- +# Conditional logic for the wrapper file based on the Python version. +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, +# I assume cc_linalg also needs numpy, if not it can be removed. + dependencies: [numpy_dep] +) + +# --- Installing Extension Modules --- +# Register each extension module so Meson knows to install them +# in the Python site-packages directory. +python_installation.install_extmod(py_symph_ext) +python_installation.install_extmod(py_secondorder_ext) +python_installation.install_extmod(py_thirdorder_ext) +python_installation.install_extmod(py_cond_ext) +python_installation.install_extmod(py_cc_linalg_ext) + + +# --- Installing the Python package 'cellconstructor' --- +# This installs the .py files from the 'cellconstructor' directory +# into the 'cellconstructor' subdirectory within the Python site-packages. +python_installation.install_sources( + python_installation.find_sources('cellconstructor/*.py'), + subdir: 'cellconstructor' +) + +# Installing package data (.dat files) +# They are installed in the 'cellconstructor/SymData' directory in the site-packages. +install_data('cellconstructor/SymData/gamma_symm_op.dat', + 'cellconstructor/SymData/space_groups_crystal.dat', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData') + +# --- Installing the executable scripts --- +# Installs the scripts directly into the Python environment's scripts directory. +install_scripts( + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..3bc669a5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +# pyproject.toml + +[build-system] +# Declare the build backends and their dependencies that pip needs to build the project. +# 'meson-python' is the backend that translates pip calls to Meson. +# 'meson' is the actual build tool. +# 'ninja' is the low-level build system that Meson uses by default for rapid compilation. +requires = ["meson-python>=0.13.0", "meson>=1.0.0", "ninja>=1.10"] +build-backend = "mesonpy" + +[project] +# Project metadata, which was previously in the `setup()` call of setup.py. +name = "CellConstructor" +version = "1.5.0" # Make sure this version matches meson.build +description = "Python utilities interfaced with ASE for atomic crystal analysis" +authors = [{name = "Lorenzo Monacelli"}] +readme = "README.md" +requires-python = ">=3.8" # The minimum version of Python supported by your project +license = { text = "GPL" } + +keywords = [ # Optional keywords to describe your package + "crystallography", + "phonons", + "materials science", + "quantum espresso", + "ab initio" +] + +# Project runtime dependencies. +# These are the dependencies that will be installed when someone runs `pip install cellconstructor`. +dependencies = [ + "numpy", + "ase", + "scipy", + # If any of your Python extensions had an *additional* dependency + # other than numpy, ase, or scipy (and not a system library like BLAS/LAPACK), + # it would go here. +] + +[project.urls] +Homepage = "https://sscha.eu/" +Repository = "https://github.com/mesonepigreco/CellConstructor" # Puede ser el mismo que Homepage +# Documentation = "https://documentacion.readthedocs.io/" +# Issues = "https://github.com/mesonepigreco/CellConstructor/issues" + + +# --- Meson-python specific configuration (Optional but useful) --- +[tool.meson-python] +# Here you can pass options to Meson that control the build process. +# For example, to enable debugging or specify a different installation path. +# By default, meson-python takes care of using the virtual environment if it exists. + +# build-args = ["-Dbuildtype=debug"] # Uncomment for a debug build +# setup-args = ["--prefix=/opt/cellconstructor"] # For a non-standard installation From 82aa5de3842b779101e3f9f3d886483ebe9cbf6f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 09:50:44 +0200 Subject: [PATCH 014/151] Set a build.yml for automatic github compilation and testing (first try) --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c1d44209 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Build and Test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + pip install meson ninja meson-python numpy scipy ase + + - name: Setup build directory + run: meson setup builddir + + - name: Compile + run: meson compile -C builddir + + - name: Run tests + run: meson test -C builddir + + - name: Install package + run: meson install -C builddir From 5d66e4f65dfdb42acdbabd8862cb10a893d3d8ad Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 09:57:30 +0200 Subject: [PATCH 015/151] Change README.md to show how to make a basic compilation. --- README.md | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e5e7910c..8e9f9708 100644 --- a/README.md +++ b/README.md @@ -29,20 +29,20 @@ To correnctly install and use the package, you need to have 5. A fortran compiler 6. Lapack -The fortran compiler is required to compile the fortran libraries +The fortran compiler is required to compile the fortran libraries from Quantum ESPRESSO. -Suggested, but not required, is the installation of ASE and spglib. -The presence of a valid ASE installation will enable some more features, -like the possibility to load structures by any ASE supported file format, +Suggested, but not required, is the installation of ASE and spglib. +The presence of a valid ASE installation will enable some more features, +like the possibility to load structures by any ASE supported file format, or the possibility to export the structures into a valid ASE Atoms class. -This library is able to compute symmetries from the structure, -and inside the symmetry module there is a convertor to let CellConstructure -dealing with symmetries extracted with spglib. +This library is able to compute symmetries from the structure, +and inside the symmetry module there is a convertor to let CellConstructure +dealing with symmetries extracted with spglib. However, for a more carefull symmetry analisys, we suggest the use of external tools like ISOTROPY. This package can generate ISOTROPY input files for more advanced symmetry detection. -Please, note that some fortran libraries are needed to be compiled, therefore the Python header files should be localized by the compiling process. +Please, note that some fortran libraries are needed to be compiled, therefore the Python header files should be localized by the compiling process. This requires the python distutils and developing tools to be properly installed. On ubuntu this can be achieved by running: ```bash @@ -100,15 +100,15 @@ conda install clangxx_osx-64 NOTE: If you want to install the package into a system python distribution, the -installation commands should be executed as a superuser. -Otherwise, append the --user flag to either the setup.py or the pip installation. +installation commands should be executed as a superuser. +Otherwise, append the --user flag to either the setup.py or the pip installation. In this way no administrator privileges is required, but the installation will be effective only for the current user. Note that some python distribution, like anaconda, does not need the superuser, as it has an installation path inside the HOME directory. You can install also using the intel compiler. In this case, you must edit the setup.py script so that: - remove the lapack and blas as extra library for the SCHAModules extension. -- add a new flag: 'extra_link_args = ["-mkl"]' to the extension. +- add a new flag: 'extra_link_args = ["-mkl"]' to the extension. Remember to specify the intel compiler both to the compilation and for the running: CC="icc" @@ -118,7 +118,7 @@ otherwise the C module will give an error when loaded reguarding some "_fast_mem ## GO! -To test if the installation runned properly, run the examples reported +To test if the installation runned properly, run the examples reported in the test directory. The python code in these tests should be almost self explaining and introduce you to the potentiality of this library. @@ -142,3 +142,21 @@ For example, if you want the html version run: make html ``` inside the UserGuide directory. It will generate a build directory that contains the html version of the full documentation. + +## Installation using 'Meson' +Create a new directory to compile: +'''bash +mkdir builddir +''' +Use Meson to try to autoconfigure the build. +'''bash +meson setup builddir +''' +Compile the code. +'''bash +meson compile -C builddir +''' +Option: install the compilation. +'''bash +meson install -C builddir +''' From 109279423b1eb97c79166e7edddcd45826a8a2f1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 10:28:01 +0200 Subject: [PATCH 016/151] Removing 'python' from meson compilation and use as a imported module. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f85d015c..e3b6e79d 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('CellConstructor', 'fortran', 'c', 'python', +project('CellConstructor', 'fortran', 'c', version: '1.5.0', license: 'GPL', # Common compilation options for Fortran. From abdeb0eceed6ba48ca2c92dfa4335f429be44da7 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 10:36:58 +0200 Subject: [PATCH 017/151] Python libraries must be declared in Meson as modules. --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index e3b6e79d..ec718275 100644 --- a/meson.build +++ b/meson.build @@ -14,9 +14,9 @@ python_installation = python.find_installation() # Defines the Python dependencies that numpy.distutils used to handle. # Meson will look for them in the current Python environment. -numpy_dep = python_installation.dependency('numpy', required: true) -ase_dep = python_installation.dependency('ase', required: true) -scipy_dep = python_installation.dependency('scipy', required: true) +numpy_dep = python_installation.dependency(module: 'numpy', required: true) +ase_dep = python_installation.dependency(module: 'ase', required: true) +scipy_dep = python_installation.dependency(module: 'scipy', required: true) # Searches the system for the BLAS and LAPACK libraries. # Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. From 959f7ba97b2582c6ad0d5b965fccca80ff45218f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 10:43:31 +0200 Subject: [PATCH 018/151] Eliminating numpy_dep = python_installation.dependency(...) ase_dep = ... scipy_dep = ... --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index ec718275..c0104267 100644 --- a/meson.build +++ b/meson.build @@ -14,9 +14,9 @@ python_installation = python.find_installation() # Defines the Python dependencies that numpy.distutils used to handle. # Meson will look for them in the current Python environment. -numpy_dep = python_installation.dependency(module: 'numpy', required: true) -ase_dep = python_installation.dependency(module: 'ase', required: true) -scipy_dep = python_installation.dependency(module: 'scipy', required: true) +#numpy_dep = python_installation.dependency(module: 'numpy', required: true) +#ase_dep = python_installation.dependency(module: 'ase', required: true) +#scipy_dep = python_installation.dependency(module: 'scipy', required: true) # Searches the system for the BLAS and LAPACK libraries. # Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. From 2e8583891d53487ef320b8847fd9ae46951a576e Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 10:53:31 +0200 Subject: [PATCH 019/151] Changed 'build.yml' to install lapack, etc. --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1d44209..9f62dc8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,12 @@ jobs: with: python-version: 3.9 - - name: Install dependencies + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libblas-dev liblapack-dev gfortran pkg-config + + - name: Install Python dependencies run: | pip install meson ninja meson-python numpy scipy ase From 2c941d85989c05265f6e5658b0940d60a0597634 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:01:18 +0200 Subject: [PATCH 020/151] I did remove the numpy from the dependencies, so this goes out too. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c0104267..52f678be 100644 --- a/meson.build +++ b/meson.build @@ -54,7 +54,7 @@ py_symph_ext = python_installation.extension_module( # Compilation arguments specific to these Fortran sources. # -cpp is already defined in default_options, but can be added here if needed. # fortran_args: ['-cpp'], - dependencies: [numpy_dep, lapack_dep, blas_dep] + dependencies: [lapack_dep, blas_dep] ) # Extensión 'secondorder' From 009001ffa12e6087de614894c4578a81a90e3a2a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:05:06 +0200 Subject: [PATCH 021/151] Removing also the other cases of numpy dependency on FORTRAN and C. --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 52f678be..b3e5d7ab 100644 --- a/meson.build +++ b/meson.build @@ -66,7 +66,7 @@ py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_sources, # fortran_args: ['-cpp'], - dependencies: [numpy_dep, lapack_dep, blas_dep] + dependencies: [lapack_dep, blas_dep] ) # Extensión 'thirdorder' @@ -80,7 +80,7 @@ py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_sources, # fortran_args: ['-cpp'], - dependencies: [numpy_dep, lapack_dep, blas_dep] + dependencies: [lapack_dep, blas_dep] ) # Extensión 'thermal_conductivity' @@ -96,7 +96,7 @@ py_cond_ext = python_installation.extension_module( # '-fopenmp' is explicitly added here for this specific extension. # "-O2" is already in default_options. fortran_args: ['-fopenmp'], - dependencies: [numpy_dep, lapack_dep, blas_dep, openmp_dep] + dependencies: [lapack_dep, blas_dep, openmp_dep] ) # --- Definition of the C Extension 'cc_linalg' --- @@ -113,7 +113,7 @@ py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, # I assume cc_linalg also needs numpy, if not it can be removed. - dependencies: [numpy_dep] + #dependencies: [numpy_dep] ) # --- Installing Extension Modules --- From ed32d5c4effd66fa97c4aab8a64937fe2182e267 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:16:10 +0200 Subject: [PATCH 022/151] Set install = True instead of "install_extmod()". --- meson.build | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index b3e5d7ab..49d13edd 100644 --- a/meson.build +++ b/meson.build @@ -51,6 +51,7 @@ symph_sources = files( py_symph_ext = python_installation.extension_module( 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) symph_sources, + install: true, # Compilation arguments specific to these Fortran sources. # -cpp is already defined in default_options, but can be added here if needed. # fortran_args: ['-cpp'], @@ -66,6 +67,7 @@ py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_sources, # fortran_args: ['-cpp'], + install: true, dependencies: [lapack_dep, blas_dep] ) @@ -80,6 +82,7 @@ py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_sources, # fortran_args: ['-cpp'], + install: true, dependencies: [lapack_dep, blas_dep] ) @@ -96,6 +99,7 @@ py_cond_ext = python_installation.extension_module( # '-fopenmp' is explicitly added here for this specific extension. # "-O2" is already in default_options. fortran_args: ['-fopenmp'], + install: true, dependencies: [lapack_dep, blas_dep, openmp_dep] ) @@ -112,6 +116,7 @@ cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, + install: true # I assume cc_linalg also needs numpy, if not it can be removed. #dependencies: [numpy_dep] ) @@ -119,11 +124,11 @@ py_cc_linalg_ext = python_installation.extension_module( # --- Installing Extension Modules --- # Register each extension module so Meson knows to install them # in the Python site-packages directory. -python_installation.install_extmod(py_symph_ext) -python_installation.install_extmod(py_secondorder_ext) -python_installation.install_extmod(py_thirdorder_ext) -python_installation.install_extmod(py_cond_ext) -python_installation.install_extmod(py_cc_linalg_ext) +#python_installation.install_extmod(py_symph_ext) +#python_installation.install_extmod(py_secondorder_ext) +#python_installation.install_extmod(py_thirdorder_ext) +#python_installation.install_extmod(py_cond_ext) +#python_installation.install_extmod(py_cc_linalg_ext) # --- Installing the Python package 'cellconstructor' --- From 4ca0ad7dd194c0ea06998dd5ba6a9ebe569b9e59 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:30:18 +0200 Subject: [PATCH 023/151] Test to manually set the python scripts to install. --- meson.build | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 49d13edd..45dbcbef 100644 --- a/meson.build +++ b/meson.build @@ -134,11 +134,31 @@ py_cc_linalg_ext = python_installation.extension_module( # --- Installing the Python package 'cellconstructor' --- # This installs the .py files from the 'cellconstructor' directory # into the 'cellconstructor' subdirectory within the Python site-packages. -python_installation.install_sources( - python_installation.find_sources('cellconstructor/*.py'), - subdir: 'cellconstructor' +#python_installation.install_sources( +# python_installation.find_sources('cellconstructor/*.py'), +# subdir: 'cellconstructor' +#) +install_data( + 'cellconstructor/__init__.py', + 'cellconstructor/AnharmonicForceFields.py', + 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', + 'cellconstructor/Phonons.py', + 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', + 'cellconstructor/Units.py', + 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', + 'cellconstructor/Manipulate.py', + 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', + 'cellconstructor/Structure.py', + 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', ) + # Installing package data (.dat files) # They are installed in the 'cellconstructor/SymData' directory in the site-packages. install_data('cellconstructor/SymData/gamma_symm_op.dat', From 9e2f4f9aaea08f9200898cfd5b008c02119bd164 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:35:10 +0200 Subject: [PATCH 024/151] Another manual list to install. --- meson.build | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 45dbcbef..ead4dd1b 100644 --- a/meson.build +++ b/meson.build @@ -161,8 +161,16 @@ install_data( # Installing package data (.dat files) # They are installed in the 'cellconstructor/SymData' directory in the site-packages. -install_data('cellconstructor/SymData/gamma_symm_op.dat', - 'cellconstructor/SymData/space_groups_crystal.dat', +install_data( +#'cellconstructor/SymData/gamma_symm_op.dat', + #'cellconstructor/SymData/space_groups_crystal.dat', + 'cellconstructor/SymData/15.dat', + 'cellconstructor/SymData/36_red.dat', + 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', + 'cellconstructor/SymData/64.bcs', + 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData') # --- Installing the executable scripts --- From 7772e40d662ef0253e5633f32766a24cd1c05143 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:42:57 +0200 Subject: [PATCH 025/151] Again, I use manual installation of the python scripts. --- meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ead4dd1b..3c56d878 100644 --- a/meson.build +++ b/meson.build @@ -175,8 +175,15 @@ install_data( # --- Installing the executable scripts --- # Installs the scripts directly into the Python environment's scripts directory. -install_scripts( +#install_scripts( +# 'scripts/symmetrize_dynmat.py', +# 'scripts/cellconstructor_test.py', +# 'scripts/view_scf_atoms.py' +#) +install_data([ 'scripts/symmetrize_dynmat.py', 'scripts/cellconstructor_test.py', 'scripts/view_scf_atoms.py' +], +install_dir: get_option('bindir') ) From 1160c24cf64a84aba5c6a332cfcaacaacce79189 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 11:53:55 +0200 Subject: [PATCH 026/151] Including numpy subdirectories in compilation. May be excesive... --- meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meson.build b/meson.build index 3c56d878..69b46f0b 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,10 @@ project('CellConstructor', 'fortran', 'c', # Imports the Meson Python module to handle extensions and Python installation. python = import('python') python_installation = python.find_installation() +numpy_incdir = run_command( + py_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() # Defines the Python dependencies that numpy.distutils used to handle. # Meson will look for them in the current Python environment. @@ -55,6 +59,7 @@ py_symph_ext = python_installation.extension_module( # Compilation arguments specific to these Fortran sources. # -cpp is already defined in default_options, but can be added here if needed. # fortran_args: ['-cpp'], + include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep] ) @@ -68,6 +73,7 @@ py_secondorder_ext = python_installation.extension_module( secondorder_sources, # fortran_args: ['-cpp'], install: true, + include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep] ) @@ -83,6 +89,7 @@ py_thirdorder_ext = python_installation.extension_module( thirdorder_sources, # fortran_args: ['-cpp'], install: true, + include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep] ) @@ -100,6 +107,7 @@ py_cond_ext = python_installation.extension_module( # "-O2" is already in default_options. fortran_args: ['-fopenmp'], install: true, + include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep, openmp_dep] ) @@ -116,6 +124,7 @@ cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, + include_directories: include_directories(numpy_incdir), install: true # I assume cc_linalg also needs numpy, if not it can be removed. #dependencies: [numpy_dep] From e2acfda29780c31fef360ed6d9a174155726ae03 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 4 Aug 2025 12:10:34 +0200 Subject: [PATCH 027/151] Fix typo --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 69b46f0b..31e36e41 100644 --- a/meson.build +++ b/meson.build @@ -12,7 +12,7 @@ project('CellConstructor', 'fortran', 'c', python = import('python') python_installation = python.find_installation() numpy_incdir = run_command( - py_installation, '-c', 'import numpy; print(numpy.get_include())', + python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true ).stdout().strip() From ad620099353127abfd289f71890d5a535533b526 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 5 Aug 2025 09:11:18 +0200 Subject: [PATCH 028/151] Lets see if this removes some warnings and errors. --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 31e36e41..f3516a47 100644 --- a/meson.build +++ b/meson.build @@ -58,7 +58,7 @@ py_symph_ext = python_installation.extension_module( install: true, # Compilation arguments specific to these Fortran sources. # -cpp is already defined in default_options, but can be added here if needed. - # fortran_args: ['-cpp'], + fortran_args: ['-cpp'], include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep] ) @@ -71,7 +71,7 @@ secondorder_sources = files( py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_sources, - # fortran_args: ['-cpp'], + fortran_args: ['-cpp'], install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep] @@ -87,7 +87,7 @@ thirdorder_sources = files( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_sources, - # fortran_args: ['-cpp'], + fortran_args: ['-cpp'], install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep] From 89cecc4f56665af3c58c6c0ec2aad124d085d040 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 5 Aug 2025 09:20:12 +0200 Subject: [PATCH 029/151] Comment this part as it fails on github, --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f62dc8f..3c3a921a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,5 +32,5 @@ jobs: - name: Run tests run: meson test -C builddir - - name: Install package - run: meson install -C builddir +# - name: Install package +# run: meson install -C builddir From cd2c36d79e2e9fd7342aac88b897214fe3ea5d8c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Sat, 30 Aug 2025 09:02:11 +0200 Subject: [PATCH 030/151] Adding the tests (with pytest) --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index f3516a47..c8c82ac7 100644 --- a/meson.build +++ b/meson.build @@ -196,3 +196,5 @@ install_data([ ], install_dir: get_option('bindir') ) + +test('pytest', find_program('pytest'), args : ['-v', '-m', 'not release', 'tests']) From 6b84d46b1d1c9473cf64a17c0edc3143dd816154 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Sat, 30 Aug 2025 09:12:07 +0200 Subject: [PATCH 031/151] Trying to fix the "Program 'pytest' not found or not executable" error. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c8c82ac7..7bee42e6 100644 --- a/meson.build +++ b/meson.build @@ -197,4 +197,5 @@ install_data([ install_dir: get_option('bindir') ) -test('pytest', find_program('pytest'), args : ['-v', '-m', 'not release', 'tests']) +pytest_exe = find_program('pytest') +test('pytest', pytest_exe, args : ['-v', '-m', 'not release', 'tests']) From 122c61cbc9fac4d0ffba474a7328fb5600567d93 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Sat, 30 Aug 2025 10:11:43 +0200 Subject: [PATCH 032/151] github doesn't have pytest in the bin path by default --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 7bee42e6..67e04a1c 100644 --- a/meson.build +++ b/meson.build @@ -197,5 +197,5 @@ install_data([ install_dir: get_option('bindir') ) -pytest_exe = find_program('pytest') -test('pytest', pytest_exe, args : ['-v', '-m', 'not release', 'tests']) +# pytest_exe = find_program('pytest') +# test('pytest', pytest_exe, args : ['-v', '-m', 'not release', 'tests']) From 3a395c08e071507c3e2d6642f2a53f54a7b93e8b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 1 Sep 2025 09:34:53 +0200 Subject: [PATCH 033/151] For the test to work it needs pytest installed. --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 67e04a1c..3dedcac8 100644 --- a/meson.build +++ b/meson.build @@ -197,5 +197,6 @@ install_data([ install_dir: get_option('bindir') ) +# Set the tests by pytest. (Needs pytest installed) # pytest_exe = find_program('pytest') # test('pytest', pytest_exe, args : ['-v', '-m', 'not release', 'tests']) From 83e90851b358eb21ec0dfbb12b1da9b01e5a43fe Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 1 Sep 2025 11:39:25 +0200 Subject: [PATCH 034/151] Meson compilation and installation instructions --- README.md | 76 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8e9f9708..787a1a92 100644 --- a/README.md +++ b/README.md @@ -144,19 +144,65 @@ make html inside the UserGuide directory. It will generate a build directory that contains the html version of the full documentation. ## Installation using 'Meson' -Create a new directory to compile: -'''bash -mkdir builddir -''' -Use Meson to try to autoconfigure the build. -'''bash + +### Compiling with Meson + +To compile and install CellConstructor with Meson, follow these typical steps: + +### 1. Change to the Source Directory + +First, open a terminal and navigate to the root directory of the project source code. This is where the `meson.build` file is located. + +```bash +cd /path/to/source/root/cellconstructor +``` + + +### 2. Configure the Build Directory + +Create and configure a build directory by running: + +```bash meson setup builddir -''' -Compile the code. -'''bash -meson compile -C builddir -''' -Option: install the compilation. -'''bash -meson install -C builddir -''' +``` + +This command sets up a separate build directory (`builddir`) where all compiled files and build artifacts will be placed, keeping the source directory clean. After this, change into the build directory: + +```bash +cd builddir +``` + + +### 3. Compile the Project + +Once inside the build directory, compile the project using: + +```bash +meson compile +``` + +This will compile the source code according to the configuration from the previous step. + +### 4. Run Tests (Optional) + +If the project includes tests, you can run them with: + +```bash +meson test +``` + +This step helps verify that the build works correctly. + +### 5. Install the Project (Optional) + +To install the compiled binaries, libraries, and other files system-wide (or to a custom location), run: + +```bash +sudo meson install +``` + +You may need superuser privileges (hence `sudo`) to install to system directories. + +*** + +Following these steps will help you successfully compile, test, and install SSCHA with Meson as their build system. From ad67683e4b0212cf1ccf8b0429520495e69a4a39 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 2 Sep 2025 08:43:30 +0200 Subject: [PATCH 035/151] Added meson-python to implement the Python build system hooks --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3bc669a5..b5b79213 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ # 'meson-python' is the backend that translates pip calls to Meson. # 'meson' is the actual build tool. # 'ninja' is the low-level build system that Meson uses by default for rapid compilation. -requires = ["meson-python>=0.13.0", "meson>=1.0.0", "ninja>=1.10"] +requires = ["meson-python>=0.13.0", "meson>=1.0.0", "ninja>=1.10", "meson-python"] build-backend = "mesonpy" [project] From b60252edf36e264f99ae3a79e778e27f4ece6b5d Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 3 Sep 2025 09:19:13 +0200 Subject: [PATCH 036/151] Update 'README.md' with the instructions for running the tests. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 787a1a92..e822852c 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ This will compile the source code according to the configuration from the previo ### 4. Run Tests (Optional) -If the project includes tests, you can run them with: +The project includes tests, you need to install pytest and uncomment the last two lines of 'meson.build' to work. You can run them with: ```bash meson test From 5028fdfeb6dc19e37f54febbab6028777d9ffd03 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 3 Sep 2025 10:24:23 +0200 Subject: [PATCH 037/151] Automatic check for pytest --- meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 3dedcac8..481c54f7 100644 --- a/meson.build +++ b/meson.build @@ -198,5 +198,8 @@ install_dir: get_option('bindir') ) # Set the tests by pytest. (Needs pytest installed) -# pytest_exe = find_program('pytest') -# test('pytest', pytest_exe, args : ['-v', '-m', 'not release', 'tests']) +pytest_exe = find_program('pytest', required: true) + +test('pytest', pytest_exe, + args : ['-v', '-m', 'not release', 'tests'], + workdir : meson.source_root()) From d903a388b24017f9be1e00785ab338dce1db83fb Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 3 Sep 2025 10:29:46 +0200 Subject: [PATCH 038/151] If no pytest installed, no test done. --- meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 481c54f7..7fde578c 100644 --- a/meson.build +++ b/meson.build @@ -198,8 +198,12 @@ install_dir: get_option('bindir') ) # Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: true) +pytest_exe = find_program('pytest', required: false) -test('pytest', pytest_exe, - args : ['-v', '-m', 'not release', 'tests'], - workdir : meson.source_root()) +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v', '-m', 'not release', 'tests'], + workdir : meson.source_root()) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From e207150a129687ac60f338b275635042b12184ab Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 3 Sep 2025 10:37:37 +0200 Subject: [PATCH 039/151] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e822852c..f9f235e4 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ This will compile the source code according to the configuration from the previo ### 4. Run Tests (Optional) -The project includes tests, you need to install pytest and uncomment the last two lines of 'meson.build' to work. You can run them with: +The project includes tests, you need to install pytest to work. You can run them with: ```bash meson test From aadc3270588040438690a9f86add72f06d398f42 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 4 Sep 2025 08:15:48 +0200 Subject: [PATCH 040/151] (Commented) method for installing python sources by Meson. --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 7fde578c..6eb86b7a 100644 --- a/meson.build +++ b/meson.build @@ -196,6 +196,8 @@ install_data([ ], install_dir: get_option('bindir') ) +# python_installation.install_sources(['scripts/symmetrize_dynmat.py', +# 'scripts/cellconstructor_test.py','scripts/view_scf_atoms.py']) # Set the tests by pytest. (Needs pytest installed) pytest_exe = find_program('pytest', required: false) From 4f170c016ccb46df8986b244876564c3357d5c82 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 08:18:21 +0200 Subject: [PATCH 041/151] Test 'python.install_sources()' --- meson.build | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 6eb86b7a..c21f8a25 100644 --- a/meson.build +++ b/meson.build @@ -189,15 +189,18 @@ install_data( # 'scripts/cellconstructor_test.py', # 'scripts/view_scf_atoms.py' #) -install_data([ +#install_data([ +# 'scripts/symmetrize_dynmat.py', +# 'scripts/cellconstructor_test.py', +# 'scripts/view_scf_atoms.py' +#], +#install_dir: get_option('bindir') +#) +python_installation.install_sources([ 'scripts/symmetrize_dynmat.py', 'scripts/cellconstructor_test.py', 'scripts/view_scf_atoms.py' -], -install_dir: get_option('bindir') -) -# python_installation.install_sources(['scripts/symmetrize_dynmat.py', -# 'scripts/cellconstructor_test.py','scripts/view_scf_atoms.py']) + ]) # Set the tests by pytest. (Needs pytest installed) pytest_exe = find_program('pytest', required: false) From 8718fb18afc93e55922d62e5c8e2d4a79a708344 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 08:44:24 +0200 Subject: [PATCH 042/151] Test everything, including full installation. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c3a921a..57f8b409 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Install Python dependencies run: | - pip install meson ninja meson-python numpy scipy ase + pip install meson ninja meson-python numpy scipy ase pytest - name: Setup build directory run: meson setup builddir @@ -32,5 +32,5 @@ jobs: - name: Run tests run: meson test -C builddir -# - name: Install package -# run: meson install -C builddir + - name: Install package + run: meson install -C builddir From bff9e3095511845298a21e369bc4b63d0b277126 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 08:46:51 +0200 Subject: [PATCH 043/151] Test CellConstructor installation --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57f8b409..9f62dc8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Install Python dependencies run: | - pip install meson ninja meson-python numpy scipy ase pytest + pip install meson ninja meson-python numpy scipy ase - name: Setup build directory run: meson setup builddir From 63836d020551e6a68220e4cfcd793ebcc57d6a94 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 08:49:58 +0200 Subject: [PATCH 044/151] Test the tests with pytest. --- .github/workflows/build.yml | 4 ++-- meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f62dc8f..3c3a921a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,5 +32,5 @@ jobs: - name: Run tests run: meson test -C builddir - - name: Install package - run: meson install -C builddir +# - name: Install package +# run: meson install -C builddir diff --git a/meson.build b/meson.build index c21f8a25..773e51da 100644 --- a/meson.build +++ b/meson.build @@ -207,7 +207,7 @@ pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, - args : ['-v', '-m', 'not release', 'tests'], +# args : ['-v', '-m', 'not release', 'tests'], workdir : meson.source_root()) else message('pytest no encontrado; se omiten tests con pytest.') From 1f8897cd9c42ffd7eced4f8d8c6f56db493cf36c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 08:52:32 +0200 Subject: [PATCH 045/151] Full tests (pytest) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c3a921a..06615056 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Install Python dependencies run: | - pip install meson ninja meson-python numpy scipy ase + pip install meson ninja meson-python numpy scipy ase pytest - name: Setup build directory run: meson setup builddir From 8703a924424e457bf6569be9c5b38125cf5c3617 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 09:03:00 +0200 Subject: [PATCH 046/151] Testing with pytest from Meson builddir. --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 773e51da..7247c70b 100644 --- a/meson.build +++ b/meson.build @@ -207,7 +207,9 @@ pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, -# args : ['-v', '-m', 'not release', 'tests'], + args : ['-v', + #'-m', 'not release', + '../tests'], workdir : meson.source_root()) else message('pytest no encontrado; se omiten tests con pytest.') From cd7122646c2014295cc5eb0be5480103c6cb007f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 09:14:03 +0200 Subject: [PATCH 047/151] Using join_paths.source_root() because pytest do not find any test. --- meson.build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 7247c70b..53cbcf06 100644 --- a/meson.build +++ b/meson.build @@ -207,9 +207,7 @@ pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, - args : ['-v', - #'-m', 'not release', - '../tests'], + args : ['-v', '-m', 'not release', join_paths(meson.source_root(), 'tests'], workdir : meson.source_root()) else message('pytest no encontrado; se omiten tests con pytest.') From b019a47a883560a1edf70405d6f35a88316fa4c0 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 09:45:07 +0200 Subject: [PATCH 048/151] I made an 'error' by both changing the workdir and using join_paths. They do the same work. --- meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 53cbcf06..615f4d43 100644 --- a/meson.build +++ b/meson.build @@ -207,8 +207,12 @@ pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, - args : ['-v', '-m', 'not release', join_paths(meson.source_root(), 'tests'], - workdir : meson.source_root()) + args : ['-v', '-m', 'not release', +# join_paths(meson.source_root(), 'tests') + 'tests' + ], + workdir : meson.source_root() + ) else message('pytest no encontrado; se omiten tests con pytest.') endif From a60e0f96b05b869345ab1083ad69dedf43afc3b4 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 09:48:48 +0200 Subject: [PATCH 049/151] Test with join_paths from builddir. --- meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 615f4d43..6700834a 100644 --- a/meson.build +++ b/meson.build @@ -208,10 +208,11 @@ pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, args : ['-v', '-m', 'not release', -# join_paths(meson.source_root(), 'tests') - 'tests' - ], - workdir : meson.source_root() + join_paths(meson.source_root(), 'tests') +# 'tests' + ] +# , +# workdir : meson.source_root() ) else message('pytest no encontrado; se omiten tests con pytest.') From bc829e491a2d5cfc46c9e5fc9cfbc19637dc98bf Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 09:53:18 +0200 Subject: [PATCH 050/151] Removing "-m 'not release'" from the pytest call. --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 6700834a..0cbaa951 100644 --- a/meson.build +++ b/meson.build @@ -207,12 +207,12 @@ pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, - args : ['-v', '-m', 'not release', - join_paths(meson.source_root(), 'tests') -# 'tests' - ] -# , -# workdir : meson.source_root() + args : ['-v', +# '-m', 'not release', +# join_paths(meson.source_root(), 'tests') + 'tests' + ], + workdir : meson.source_root() ) else message('pytest no encontrado; se omiten tests con pytest.') From 6a545dc32edd5759b9696e8f667ed1919eb50b73 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 09:57:00 +0200 Subject: [PATCH 051/151] Test the tests with "pytest -v" from Meson. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0cbaa951..abf5b51a 100644 --- a/meson.build +++ b/meson.build @@ -210,7 +210,7 @@ if pytest_exe.found() args : ['-v', # '-m', 'not release', # join_paths(meson.source_root(), 'tests') - 'tests' +# 'tests' ], workdir : meson.source_root() ) From 998688b2483497146538972695570b775a5246b9 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 10:25:44 +0200 Subject: [PATCH 052/151] Github "PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.9'". So no install and test on github? --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06615056..95ec042d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,8 +29,9 @@ jobs: - name: Compile run: meson compile -C builddir - - name: Run tests - run: meson test -C builddir # - name: Install package # run: meson install -C builddir + +# - name: Run tests +# run: meson test -C builddir From ce695e915e8148902658c3b3e6753ea8f9e03f79 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 11:54:33 +0200 Subject: [PATCH 053/151] Forcing the RPATH --- README.md | 5 +++++ meson.build | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f9f235e4..53f0c50e 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,11 @@ Create and configure a build directory by running: meson setup builddir ``` +or if you are in a conda env (the best option for a local installation): +```bash +meson setup builddir --prefix=$CONDA_PREFIX +``` + This command sets up a separate build directory (`builddir`) where all compiled files and build artifacts will be placed, keeping the source directory clean. After this, change into the build directory: ```bash diff --git a/meson.build b/meson.build index abf5b51a..2f693018 100644 --- a/meson.build +++ b/meson.build @@ -60,7 +60,8 @@ py_symph_ext = python_installation.extension_module( # -cpp is already defined in default_options, but can be added here if needed. fortran_args: ['-cpp'], include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep] + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'secondorder' @@ -74,7 +75,8 @@ py_secondorder_ext = python_installation.extension_module( fortran_args: ['-cpp'], install: true, include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep] + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'thirdorder' @@ -90,7 +92,8 @@ py_thirdorder_ext = python_installation.extension_module( fortran_args: ['-cpp'], install: true, include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep] + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'thermal_conductivity' @@ -108,7 +111,8 @@ py_cond_ext = python_installation.extension_module( fortran_args: ['-fopenmp'], install: true, include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep, openmp_dep] + dependencies: [lapack_dep, blas_dep, openmp_dep], + install_rpath: '$ORIGIN/..' ) # --- Definition of the C Extension 'cc_linalg' --- @@ -127,7 +131,8 @@ py_cc_linalg_ext = python_installation.extension_module( include_directories: include_directories(numpy_incdir), install: true # I assume cc_linalg also needs numpy, if not it can be removed. - #dependencies: [numpy_dep] + #dependencies: [numpy_dep], + install_rpath: '$ORIGIN/..' ) # --- Installing Extension Modules --- @@ -212,7 +217,7 @@ if pytest_exe.found() # join_paths(meson.source_root(), 'tests') # 'tests' ], - workdir : meson.source_root() + workdir : meson.project_source_root() ) else message('pytest no encontrado; se omiten tests con pytest.') From de5d19583db03862369e49f875871e42636c65b1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 12:01:25 +0200 Subject: [PATCH 054/151] Automatic install RPATH --- meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 2f693018..ea2f0871 100644 --- a/meson.build +++ b/meson.build @@ -61,7 +61,7 @@ py_symph_ext = python_installation.extension_module( fortran_args: ['-cpp'], include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + install_rpath: true, ) # Extensión 'secondorder' @@ -76,7 +76,7 @@ py_secondorder_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + install_rpath: true, ) # Extensión 'thirdorder' @@ -93,7 +93,7 @@ py_thirdorder_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + install_rpath: true, ) # Extensión 'thermal_conductivity' @@ -112,7 +112,7 @@ py_cond_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep, openmp_dep], - install_rpath: '$ORIGIN/..' + install_rpath: true, ) # --- Definition of the C Extension 'cc_linalg' --- @@ -132,7 +132,7 @@ py_cc_linalg_ext = python_installation.extension_module( install: true # I assume cc_linalg also needs numpy, if not it can be removed. #dependencies: [numpy_dep], - install_rpath: '$ORIGIN/..' + install_rpath: true, ) # --- Installing Extension Modules --- From 09ed5183ff70e4b65ab341a08fe345bce092fb60 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 12:06:02 +0200 Subject: [PATCH 055/151] Fix typo --- meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index ea2f0871..d369500a 100644 --- a/meson.build +++ b/meson.build @@ -61,7 +61,7 @@ py_symph_ext = python_installation.extension_module( fortran_args: ['-cpp'], include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: true, + install_rpath: true ) # Extensión 'secondorder' @@ -76,7 +76,7 @@ py_secondorder_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: true, + install_rpath: true ) # Extensión 'thirdorder' @@ -93,7 +93,7 @@ py_thirdorder_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: true, + install_rpath: true ) # Extensión 'thermal_conductivity' @@ -112,7 +112,7 @@ py_cond_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep, openmp_dep], - install_rpath: true, + install_rpath: true ) # --- Definition of the C Extension 'cc_linalg' --- @@ -132,7 +132,7 @@ py_cc_linalg_ext = python_installation.extension_module( install: true # I assume cc_linalg also needs numpy, if not it can be removed. #dependencies: [numpy_dep], - install_rpath: true, + install_rpath: true ) # --- Installing Extension Modules --- From a7761abe3d4cf1f73802938f532ed450578df0e1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 5 Sep 2025 12:15:20 +0200 Subject: [PATCH 056/151] No boolean here --- meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index d369500a..7dd05ec9 100644 --- a/meson.build +++ b/meson.build @@ -61,7 +61,7 @@ py_symph_ext = python_installation.extension_module( fortran_args: ['-cpp'], include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: true + install_rpath: '$ORIGIN/..' ) # Extensión 'secondorder' @@ -76,7 +76,7 @@ py_secondorder_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: true + install_rpath: '$ORIGIN/..' ) # Extensión 'thirdorder' @@ -93,7 +93,7 @@ py_thirdorder_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep], - install_rpath: true + install_rpath: '$ORIGIN/..' ) # Extensión 'thermal_conductivity' @@ -112,7 +112,7 @@ py_cond_ext = python_installation.extension_module( install: true, include_directories: include_directories(numpy_incdir), dependencies: [lapack_dep, blas_dep, openmp_dep], - install_rpath: true + install_rpath: '$ORIGIN/..' ) # --- Definition of the C Extension 'cc_linalg' --- @@ -132,7 +132,7 @@ py_cc_linalg_ext = python_installation.extension_module( install: true # I assume cc_linalg also needs numpy, if not it can be removed. #dependencies: [numpy_dep], - install_rpath: true + , install_rpath: '$ORIGIN/..' ) # --- Installing Extension Modules --- From 3bbb003166466c50ef99e712d4c54f9636318415 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 08:25:27 +0200 Subject: [PATCH 057/151] Adding 1 more dependence to 'symph' library --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7dd05ec9..bd5d4d44 100644 --- a/meson.build +++ b/meson.build @@ -60,7 +60,7 @@ py_symph_ext = python_installation.extension_module( # -cpp is already defined in default_options, but can be added here if needed. fortran_args: ['-cpp'], include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep], + dependencies: [lapack_dep, blas_dep, openmp_dep], install_rpath: '$ORIGIN/..' ) From 8cbcc29c68c56ba4107114c040b627819ffdb6a1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 09:17:30 +0200 Subject: [PATCH 058/151] Try with f2py C wrapper --- meson.build | 76 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index bd5d4d44..81cb1462 100644 --- a/meson.build +++ b/meson.build @@ -16,11 +16,12 @@ numpy_incdir = run_command( check: true ).stdout().strip() -# Defines the Python dependencies that numpy.distutils used to handle. -# Meson will look for them in the current Python environment. -#numpy_dep = python_installation.dependency(module: 'numpy', required: true) -#ase_dep = python_installation.dependency(module: 'ase', required: true) -#scipy_dep = python_installation.dependency(module: 'scipy', required: true) +# Find the fpm and f2py programs +fpm_exe = find_program('fpm', required: true) +f2py_exe = python.find_installation().find_program('f2py', required: true) + +# Define the build directory for fpm +fpm_build_dir = meson.build_root() / 'fpm_build' # Searches the system for the BLAS and LAPACK libraries. # Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. @@ -33,6 +34,15 @@ openmp_dep = dependency('openmp', required: true) # --- Definition of Fortran Extensions --- +# Use fpm to build and install your Fortran sources +run_command( + fpm_exe, + 'install', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + '--prefix', fpm_build_dir, + check : true +) + # Extensión 'symph' symph_sources = files( 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', @@ -52,17 +62,57 @@ symph_sources = files( 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' ) # Create a Python extension module using the Fortran sources and dependencies. + +# --- The symph extension --- +# This is the Fortran source file that will be wrapped by f2py +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', + 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', + # ... [All your symph source files] ... +) + +# Use f2py to create the C wrapper +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', # The name of the module + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +# Create the Python extension module py_symph_ext = python_installation.extension_module( - 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) - symph_sources, - install: true, + 'symph', # Name of the resulting module + # We now pass the generated C wrapper and the static library from fpm + symph_wrapper, + fpm_build_dir / 'lib' / 'libsymph.a', + install: true, + include_directories: [ + include_directories(numpy_incdir), + fpm_build_dir / 'include' # Include directory for Fortran modules + ], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +#py_symph_ext = python_installation.extension_module( +# 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) +# symph_sources, +# install: true, # Compilation arguments specific to these Fortran sources. # -cpp is already defined in default_options, but can be added here if needed. - fortran_args: ['-cpp'], - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep, openmp_dep], - install_rpath: '$ORIGIN/..' -) +# fortran_args: ['-cpp'], +# include_directories: include_directories(numpy_incdir), +# dependencies: [lapack_dep, blas_dep, openmp_dep], +# install_rpath: '$ORIGIN/..' +#) # Extensión 'secondorder' secondorder_sources = files( From 3f0c3698a1bfd9008f1cb981cb3174e6ad5e675c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 09:28:30 +0200 Subject: [PATCH 059/151] Added "Fortran Package Manager" into the pip install list --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95ec042d..b18f5612 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Install Python dependencies run: | - pip install meson ninja meson-python numpy scipy ase pytest + pip install meson ninja meson-python numpy scipy ase pytest fpm - name: Setup build directory run: meson setup builddir From d3b6a61fe19810c7a0383a7b0116826d0d4f3cf2 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 09:31:26 +0200 Subject: [PATCH 060/151] Fix error --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 81cb1462..67295852 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ numpy_incdir = run_command( # Find the fpm and f2py programs fpm_exe = find_program('fpm', required: true) -f2py_exe = python.find_installation().find_program('f2py', required: true) +f2py_exe = python_installation.find_installation().find_program('f2py', required: true) # Define the build directory for fpm fpm_build_dir = meson.build_root() / 'fpm_build' From a978ac8ff96f7dabf108b7f5ae0d2c2339f14e77 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 09:41:21 +0200 Subject: [PATCH 061/151] Fix error --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 67295852..1179ccfd 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ numpy_incdir = run_command( # Find the fpm and f2py programs fpm_exe = find_program('fpm', required: true) -f2py_exe = python_installation.find_installation().find_program('f2py', required: true) +f2py_exe = python.find_program('f2py', required: true) # Define the build directory for fpm fpm_build_dir = meson.build_root() / 'fpm_build' From 6bf1bf51356cfe774f9a8f818dcbbd2eb127d0ee Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 09:51:50 +0200 Subject: [PATCH 062/151] Test f2py way --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1179ccfd..9afd115a 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ numpy_incdir = run_command( # Find the fpm and f2py programs fpm_exe = find_program('fpm', required: true) -f2py_exe = python.find_program('f2py', required: true) +f2py_exe = find_program('f2py', required: true) # Define the build directory for fpm fpm_build_dir = meson.build_root() / 'fpm_build' From b9e47bb2fa7d7a8bf1ef73195d2eb29f83b90a8d Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 09:59:09 +0200 Subject: [PATCH 063/151] Manually set fpm output name --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 9afd115a..196be99a 100644 --- a/meson.build +++ b/meson.build @@ -39,6 +39,7 @@ run_command( fpm_exe, 'install', '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + '--name', 'symph', '--prefix', fpm_build_dir, check : true ) From e555976f4824cfe9f9945e6c6f29fe1d72887787 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 10:16:35 +0200 Subject: [PATCH 064/151] Trying to fix the FORTRAN to python lib. --- meson.build | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 196be99a..1393f04c 100644 --- a/meson.build +++ b/meson.build @@ -35,14 +35,15 @@ openmp_dep = dependency('openmp', required: true) # --- Definition of Fortran Extensions --- # Use fpm to build and install your Fortran sources -run_command( - fpm_exe, - 'install', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - '--name', 'symph', - '--prefix', fpm_build_dir, - check : true -) +# NOTE: The fpm call has been moved to a `custom_target` for each extension. +#run_command( +# fpm_exe, +# 'install', +# '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], +# '--name', 'symph', +# '--prefix', fpm_build_dir, +# check : true +#) # Extensión 'symph' symph_sources = files( @@ -64,12 +65,22 @@ symph_sources = files( ) # Create a Python extension module using the Fortran sources and dependencies. -# --- The symph extension --- -# This is the Fortran source file that will be wrapped by f2py -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', - 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', - # ... [All your symph source files] ... +# NEW: Use custom_target to compile the Fortran sources into a static library with fpm. +# This ensures the library exists before we try to link it. +symph_fortran_lib = custom_target( + 'symph_fortran_lib', + output: 'libsymph.a', + command: [ + fpm_exe, + 'build', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + '--name', 'symph', + '--chdir', meson.source_root(), # <-- Crucial: fpm runs from the source root + '--prefix', meson.current_build_dir(), + '--install' # <-- Ensures fpm installs the library for Meson to find + ], + input: symph_sources, + build_by_default: true ) # Use f2py to create the C wrapper @@ -92,11 +103,11 @@ py_symph_ext = python_installation.extension_module( 'symph', # Name of the resulting module # We now pass the generated C wrapper and the static library from fpm symph_wrapper, - fpm_build_dir / 'lib' / 'libsymph.a', + symph_fortran_lib, # Use the target object directly install: true, include_directories: [ include_directories(numpy_incdir), - fpm_build_dir / 'include' # Include directory for Fortran modules + meson.current_build_dir() / 'fpm_build' / 'include' # Path to fpm-generated module files ], dependencies: [lapack_dep, blas_dep, openmp_dep], link_args: ['-fopenmp'], @@ -116,6 +127,7 @@ py_symph_ext = python_installation.extension_module( #) # Extensión 'secondorder' +# NOTE: It will need to apply the same logic as above for this and other extensions secondorder_sources = files( 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' From 10c6ea729ea27b3705b28cacc81c02674f84b260 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 10:21:55 +0200 Subject: [PATCH 065/151] Fixing error and looking for alternatives --- meson.build | 2 +- meson.build.test_fpm_toml | 154 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 meson.build.test_fpm_toml diff --git a/meson.build b/meson.build index 1393f04c..a2affe9e 100644 --- a/meson.build +++ b/meson.build @@ -86,7 +86,7 @@ symph_fortran_lib = custom_target( # Use f2py to create the C wrapper symph_wrapper = custom_target( 'symph_f2py_wrapper', - input: symph_fortran_src, + input: symph_sources, output: 'symph-f2pywrappers.c', command: [ f2py_exe, diff --git a/meson.build.test_fpm_toml b/meson.build.test_fpm_toml new file mode 100644 index 00000000..e4806083 --- /dev/null +++ b/meson.build.test_fpm_toml @@ -0,0 +1,154 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Searches the system for the BLAS and LAPACK libraries. +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# Use fpm to build and install your Fortran sources. +# Meson assumes a fpm.toml file exists in the source directory. +# fpm.toml tells fpm which files to compile and what to name the library. +run_command( + fpm_exe, + 'install', + '--prefix', meson.current_build_dir() / 'fpm_build', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + check : true +) + +# --- Definition of Fortran Extensions --- + +# Extensión 'symph' +# symph_sources is now defined by the fpm.toml file. +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', + 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', + 'FModules/error_handler.f90', 'FModules/io_global.f90', + 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', + 'FModules/q2qstar_out.f90', 'FModules/rotate_and_add_dyn.f90', + 'FModules/trntnsc.f90', 'FModules/star_q.f90', 'FModules/eqvect.f90', + 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', + 'FModules/constants.f90', 'FModules/eff_charge_interp.f90', + 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' +) + +# Use f2py to create the C wrapper +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower', + ], + build_by_default: true, +) + +# Create the Python extension module +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + meson.current_build_dir() / 'fpm_build' / 'lib' / 'libsymph.a', + install: true, + include_directories: [ + include_directories(numpy_incdir), + meson.current_build_dir() / 'fpm_build' / 'include' + ], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', +) + +# ... [The other extension definitions] ... + +# --- Definition of the C Extension 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Installing the Python package 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', + 'cellconstructor/AnharmonicForceFields.py', + 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', + 'cellconstructor/Phonons.py', + 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', + 'cellconstructor/Units.py', + 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', + 'cellconstructor/Manipulate.py', + 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', + 'cellconstructor/Structure.py', + 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', + 'cellconstructor/SymData/36_red.dat', + 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', + 'cellconstructor/SymData/64.bcs', + 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Installing the executable scripts --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 9a4e57175f5c5dd928bdcec3770136d741246401 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 8 Sep 2025 11:14:58 +0200 Subject: [PATCH 066/151] Test with "fpm.toml" --- fpm.toml | 53 +++++++++ meson.build | 300 ++++++++++++++++-------------------------------- meson.build.old | 287 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 442 insertions(+), 198 deletions(-) create mode 100644 fpm.toml create mode 100644 meson.build.old diff --git a/fpm.toml b/fpm.toml new file mode 100644 index 00000000..6f71b40e --- /dev/null +++ b/fpm.toml @@ -0,0 +1,53 @@ +[project] +name = "cellconstructor" +version = "1.5.0" +fpm_version = ">=0.8.0" + +[[library]] +source-dir = "FModules" +# This tells fpm to compile all Fortran files in the FModules directory. +# If you only want to compile specific files, you can use: + source-list = [ + "FModules/symdynph_gq_new.f90", "FModules/symm_base.f90", + "FModules/sgam_ph.f90", "FModules/invmat.f90", "FModules/set_asr.f90", + "FModules/error_handler.f90", "FModules/io_global.f90", + "FModules/flush_unit.f90", "FModules/symvector.f90", + "FModules/fc_supercell_from_dyn.f90", "FModules/set_tau.f90", + "FModules/cryst_to_car.f90", "FModules/recips.f90", + "FModules/q2qstar_out.f90", "FModules/rotate_and_add_dyn.f90", + "FModules/trntnsc.f90", "FModules/star_q.f90", "FModules/eqvect.f90", + "FModules/symm_matrix.f90", "FModules/from_matdyn.f90", + "FModules/interp.f90", "FModules/q_gen.f90", "FModules/smallgq.f90", + "FModules/symmetry_high_rank.f90", "FModules/unwrap_tensors.f90", + "FModules/get_latvec.f90", "FModules/contract_two_phonon_propagator.f90", + "FModules/get_q_grid_fast.f90", "FModules/kind.f90", + "FModules/constants.f90", "FModules/eff_charge_interp.f90", + "FModules/get_translations.f90", "FModules/get_equivalent_atoms.f90" + ] +[[library]] +name = "secondorder" +source-dir = "FModules" +source-list = [ + "FModules/second_order_centering.f90", + "FModules/second_order_ASR.f90" +] + +[[library]] +name = "thirdorder" +source-dir = "FModules" +source-list = [ + "FModules/third_order_centering.f90", + "FModules/third_order_ASR.f90", + "FModules/third_order_interpol.f90", + "FModules/third_order_dynbubble.f90" +] + +[[library]] +name = "thermal_conductivity" +source-dir = "FModules" +source-list = [ + "FModules/get_scattering_q_grid.f90", + "FModules/third_order_cond.f90", + "FModules/third_order_cond_centering.f90", + "FModules/get_lf.f90" +] diff --git a/meson.build b/meson.build index a2affe9e..a0a396e1 100644 --- a/meson.build +++ b/meson.build @@ -1,14 +1,10 @@ project('CellConstructor', 'fortran', 'c', version: '1.5.0', license: 'GPL', - # Common compilation options for Fortran. - # -cpp is essential for the Fortran preprocessor. - # -O2 is a general optimization you had in setup.py. default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] ) # --- System and Python Dependencies --- -# Imports the Meson Python module to handle extensions and Python installation. python = import('python') python_installation = python.find_installation() numpy_incdir = run_command( @@ -16,170 +12,131 @@ numpy_incdir = run_command( check: true ).stdout().strip() -# Find the fpm and f2py programs fpm_exe = find_program('fpm', required: true) f2py_exe = find_program('f2py', required: true) -# Define the build directory for fpm +# Define el directorio de compilación para fpm fpm_build_dir = meson.build_root() / 'fpm_build' -# Searches the system for the BLAS and LAPACK libraries. -# Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. +# Busca las librerías de sistema BLAS, LAPACK y OpenMP lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) - -# Look for the OpenMP library if it is needed for parallelization. openmp_dep = dependency('openmp', required: true) +# --- PASO 1: Compilar todas las librerías de Fortran con fpm --- +# Este comando usa fpm.toml para saber qué librerías compilar y dónde colocarlas. +run_command( + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + check : true +) -# --- Definition of Fortran Extensions --- - -# Use fpm to build and install your Fortran sources -# NOTE: The fpm call has been moved to a `custom_target` for each extension. -#run_command( -# fpm_exe, -# 'install', -# '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], -# '--name', 'symph', -# '--prefix', fpm_build_dir, -# check : true -#) +# --- PASO 2: Definir cada extensión de Python (Fortran) --- +# Cada extensión ahora tiene su propio bloque de compilación. # Extensión 'symph' -symph_sources = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', - 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', - 'FModules/error_handler.f90', 'FModules/io_global.f90', - 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', - 'FModules/q2qstar_out.f90', 'FModules/rotate_and_add_dyn.f90', - 'FModules/trntnsc.f90', 'FModules/star_q.f90', 'FModules/eqvect.f90', - 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', - 'FModules/constants.f90', 'FModules/eff_charge_interp.f90', - 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' -) -# Create a Python extension module using the Fortran sources and dependencies. - -# NEW: Use custom_target to compile the Fortran sources into a static library with fpm. -# This ensures the library exists before we try to link it. -symph_fortran_lib = custom_target( - 'symph_fortran_lib', - output: 'libsymph.a', - command: [ - fpm_exe, - 'build', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - '--name', 'symph', - '--chdir', meson.source_root(), # <-- Crucial: fpm runs from the source root - '--prefix', meson.current_build_dir(), - '--install' # <-- Ensures fpm installs the library for Meson to find - ], - input: symph_sources, - build_by_default: true +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' ) - -# Use f2py to create the C wrapper symph_wrapper = custom_target( 'symph_f2py_wrapper', - input: symph_sources, + input: symph_fortran_src, output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', # The name of the module - '@INPUT@', - '--quiet', - '--lower' - ], + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) - -# Create the Python extension module py_symph_ext = python_installation.extension_module( - 'symph', # Name of the resulting module - # We now pass the generated C wrapper and the static library from fpm + 'symph', symph_wrapper, - symph_fortran_lib, # Use the target object directly + fpm_build_dir / 'lib' / 'libsymph.a', install: true, - include_directories: [ - include_directories(numpy_incdir), - meson.current_build_dir() / 'fpm_build' / 'include' # Path to fpm-generated module files - ], + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], link_args: ['-fopenmp'], install_rpath: '$ORIGIN/..' ) -#py_symph_ext = python_installation.extension_module( -# 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) -# symph_sources, -# install: true, - # Compilation arguments specific to these Fortran sources. - # -cpp is already defined in default_options, but can be added here if needed. -# fortran_args: ['-cpp'], -# include_directories: include_directories(numpy_incdir), -# dependencies: [lapack_dep, blas_dep, openmp_dep], -# install_rpath: '$ORIGIN/..' -#) - # Extensión 'secondorder' -# NOTE: It will need to apply the same logic as above for this and other extensions -secondorder_sources = files( - 'FModules/second_order_centering.f90', - 'FModules/second_order_ASR.f90' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_sources, - fortran_args: ['-cpp'], - install: true, - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + 'secondorder', + secondorder_wrapper, + fpm_build_dir / 'lib' / 'libsecondorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'thirdorder' -thirdorder_sources = files( - 'FModules/third_order_centering.f90', - 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', - 'FModules/third_order_dynbubble.f90' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_sources, - fortran_args: ['-cpp'], - install: true, - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + 'thirdorder', + thirdorder_wrapper, + fpm_build_dir / 'lib' / 'libthirdorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'thermal_conductivity' -cond_sources = files( - 'FModules/get_scattering_q_grid.f90', - 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', - 'FModules/get_lf.f90' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_sources, - # '-fopenmp' is explicitly added here for this specific extension. - # "-O2" is already in default_options. - fortran_args: ['-fopenmp'], - install: true, - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep, openmp_dep], - install_rpath: '$ORIGIN/..' + 'thermal_conductivity', + cond_wrapper, + fpm_build_dir / 'lib' / 'libthermal_conductivity.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' ) -# --- Definition of the C Extension 'cc_linalg' --- -# Conditional logic for the wrapper file based on the Python version. +# --- Definición de la extensión C 'cc_linalg' --- wrapper_file = '' if python_installation.version().version_compare('<3.0') wrapper_file = 'CModules/wrapper.c' @@ -192,96 +149,43 @@ py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, include_directories: include_directories(numpy_incdir), - install: true -# I assume cc_linalg also needs numpy, if not it can be removed. - #dependencies: [numpy_dep], - , install_rpath: '$ORIGIN/..' + install: true, + install_rpath: '$ORIGIN/..' ) -# --- Installing Extension Modules --- -# Register each extension module so Meson knows to install them -# in the Python site-packages directory. -#python_installation.install_extmod(py_symph_ext) -#python_installation.install_extmod(py_secondorder_ext) -#python_installation.install_extmod(py_thirdorder_ext) -#python_installation.install_extmod(py_cond_ext) -#python_installation.install_extmod(py_cc_linalg_ext) - - -# --- Installing the Python package 'cellconstructor' --- -# This installs the .py files from the 'cellconstructor' directory -# into the 'cellconstructor' subdirectory within the Python site-packages. -#python_installation.install_sources( -# python_installation.find_sources('cellconstructor/*.py'), -# subdir: 'cellconstructor' -#) +# --- Instalación del paquete de Python 'cellconstructor' --- install_data( - 'cellconstructor/__init__.py', - 'cellconstructor/AnharmonicForceFields.py', - 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', - 'cellconstructor/Phonons.py', - 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', - 'cellconstructor/Units.py', - 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', - 'cellconstructor/Manipulate.py', - 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', - 'cellconstructor/Structure.py', - 'cellconstructor/symmetries.py', + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', 'cellconstructor/Timer.py', install_dir: python_installation.get_install_dir() / 'cellconstructor', ) - -# Installing package data (.dat files) -# They are installed in the 'cellconstructor/SymData' directory in the site-packages. install_data( -#'cellconstructor/SymData/gamma_symm_op.dat', - #'cellconstructor/SymData/space_groups_crystal.dat', - 'cellconstructor/SymData/15.dat', - 'cellconstructor/SymData/36_red.dat', - 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', - 'cellconstructor/SymData/64.bcs', - 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData') + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) -# --- Installing the executable scripts --- -# Installs the scripts directly into the Python environment's scripts directory. -#install_scripts( -# 'scripts/symmetrize_dynmat.py', -# 'scripts/cellconstructor_test.py', -# 'scripts/view_scf_atoms.py' -#) -#install_data([ -# 'scripts/symmetrize_dynmat.py', -# 'scripts/cellconstructor_test.py', -# 'scripts/view_scf_atoms.py' -#], -#install_dir: get_option('bindir') -#) +# --- Instalación de los scripts ejecutables --- python_installation.install_sources([ 'scripts/symmetrize_dynmat.py', 'scripts/cellconstructor_test.py', 'scripts/view_scf_atoms.py' - ]) +]) # Set the tests by pytest. (Needs pytest installed) pytest_exe = find_program('pytest', required: false) if pytest_exe.found() test('pytest', pytest_exe, - args : ['-v', -# '-m', 'not release', -# join_paths(meson.source_root(), 'tests') -# 'tests' - ], - workdir : meson.project_source_root() - ) + args : ['-v'], + workdir : meson.project_source_root() + ) else message('pytest no encontrado; se omiten tests con pytest.') endif diff --git a/meson.build.old b/meson.build.old new file mode 100644 index 00000000..a2affe9e --- /dev/null +++ b/meson.build.old @@ -0,0 +1,287 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + # Common compilation options for Fortran. + # -cpp is essential for the Fortran preprocessor. + # -O2 is a general optimization you had in setup.py. + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +# Imports the Meson Python module to handle extensions and Python installation. +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +# Find the fpm and f2py programs +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Define the build directory for fpm +fpm_build_dir = meson.build_root() / 'fpm_build' + +# Searches the system for the BLAS and LAPACK libraries. +# Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) + +# Look for the OpenMP library if it is needed for parallelization. +openmp_dep = dependency('openmp', required: true) + + +# --- Definition of Fortran Extensions --- + +# Use fpm to build and install your Fortran sources +# NOTE: The fpm call has been moved to a `custom_target` for each extension. +#run_command( +# fpm_exe, +# 'install', +# '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], +# '--name', 'symph', +# '--prefix', fpm_build_dir, +# check : true +#) + +# Extensión 'symph' +symph_sources = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', + 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', + 'FModules/error_handler.f90', 'FModules/io_global.f90', + 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', + 'FModules/q2qstar_out.f90', 'FModules/rotate_and_add_dyn.f90', + 'FModules/trntnsc.f90', 'FModules/star_q.f90', 'FModules/eqvect.f90', + 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', + 'FModules/constants.f90', 'FModules/eff_charge_interp.f90', + 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' +) +# Create a Python extension module using the Fortran sources and dependencies. + +# NEW: Use custom_target to compile the Fortran sources into a static library with fpm. +# This ensures the library exists before we try to link it. +symph_fortran_lib = custom_target( + 'symph_fortran_lib', + output: 'libsymph.a', + command: [ + fpm_exe, + 'build', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + '--name', 'symph', + '--chdir', meson.source_root(), # <-- Crucial: fpm runs from the source root + '--prefix', meson.current_build_dir(), + '--install' # <-- Ensures fpm installs the library for Meson to find + ], + input: symph_sources, + build_by_default: true +) + +# Use f2py to create the C wrapper +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_sources, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', # The name of the module + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +# Create the Python extension module +py_symph_ext = python_installation.extension_module( + 'symph', # Name of the resulting module + # We now pass the generated C wrapper and the static library from fpm + symph_wrapper, + symph_fortran_lib, # Use the target object directly + install: true, + include_directories: [ + include_directories(numpy_incdir), + meson.current_build_dir() / 'fpm_build' / 'include' # Path to fpm-generated module files + ], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +#py_symph_ext = python_installation.extension_module( +# 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) +# symph_sources, +# install: true, + # Compilation arguments specific to these Fortran sources. + # -cpp is already defined in default_options, but can be added here if needed. +# fortran_args: ['-cpp'], +# include_directories: include_directories(numpy_incdir), +# dependencies: [lapack_dep, blas_dep, openmp_dep], +# install_rpath: '$ORIGIN/..' +#) + +# Extensión 'secondorder' +# NOTE: It will need to apply the same logic as above for this and other extensions +secondorder_sources = files( + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +) +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_sources, + fortran_args: ['-cpp'], + install: true, + include_directories: include_directories(numpy_incdir), + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thirdorder' +thirdorder_sources = files( + 'FModules/third_order_centering.f90', + 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', + 'FModules/third_order_dynbubble.f90' +) +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_sources, + fortran_args: ['-cpp'], + install: true, + include_directories: include_directories(numpy_incdir), + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thermal_conductivity' +cond_sources = files( + 'FModules/get_scattering_q_grid.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/get_lf.f90' +) +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_sources, + # '-fopenmp' is explicitly added here for this specific extension. + # "-O2" is already in default_options. + fortran_args: ['-fopenmp'], + install: true, + include_directories: include_directories(numpy_incdir), + dependencies: [lapack_dep, blas_dep, openmp_dep], + install_rpath: '$ORIGIN/..' +) + +# --- Definition of the C Extension 'cc_linalg' --- +# Conditional logic for the wrapper file based on the Python version. +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true +# I assume cc_linalg also needs numpy, if not it can be removed. + #dependencies: [numpy_dep], + , install_rpath: '$ORIGIN/..' +) + +# --- Installing Extension Modules --- +# Register each extension module so Meson knows to install them +# in the Python site-packages directory. +#python_installation.install_extmod(py_symph_ext) +#python_installation.install_extmod(py_secondorder_ext) +#python_installation.install_extmod(py_thirdorder_ext) +#python_installation.install_extmod(py_cond_ext) +#python_installation.install_extmod(py_cc_linalg_ext) + + +# --- Installing the Python package 'cellconstructor' --- +# This installs the .py files from the 'cellconstructor' directory +# into the 'cellconstructor' subdirectory within the Python site-packages. +#python_installation.install_sources( +# python_installation.find_sources('cellconstructor/*.py'), +# subdir: 'cellconstructor' +#) +install_data( + 'cellconstructor/__init__.py', + 'cellconstructor/AnharmonicForceFields.py', + 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', + 'cellconstructor/Phonons.py', + 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', + 'cellconstructor/Units.py', + 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', + 'cellconstructor/Manipulate.py', + 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', + 'cellconstructor/Structure.py', + 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + + +# Installing package data (.dat files) +# They are installed in the 'cellconstructor/SymData' directory in the site-packages. +install_data( +#'cellconstructor/SymData/gamma_symm_op.dat', + #'cellconstructor/SymData/space_groups_crystal.dat', + 'cellconstructor/SymData/15.dat', + 'cellconstructor/SymData/36_red.dat', + 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', + 'cellconstructor/SymData/64.bcs', + 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData') + +# --- Installing the executable scripts --- +# Installs the scripts directly into the Python environment's scripts directory. +#install_scripts( +# 'scripts/symmetrize_dynmat.py', +# 'scripts/cellconstructor_test.py', +# 'scripts/view_scf_atoms.py' +#) +#install_data([ +# 'scripts/symmetrize_dynmat.py', +# 'scripts/cellconstructor_test.py', +# 'scripts/view_scf_atoms.py' +#], +#install_dir: get_option('bindir') +#) +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' + ]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v', +# '-m', 'not release', +# join_paths(meson.source_root(), 'tests') +# 'tests' + ], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From c258522d6f54b13d4e4aa6100089414c0b48cbe7 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 08:24:17 +0200 Subject: [PATCH 067/151] Fix and another try with f2py wrapper (with fpm). --- fpm.toml2 | 46 ++++++++ meson.build | 5 +- meson.build.old | 2 +- meson.build.test_fpm_toml2 | 217 +++++++++++++++++++++++++++++++++++++ 4 files changed, 268 insertions(+), 2 deletions(-) create mode 100644 fpm.toml2 create mode 100644 meson.build.test_fpm_toml2 diff --git a/fpm.toml2 b/fpm.toml2 new file mode 100644 index 00000000..49719e3d --- /dev/null +++ b/fpm.toml2 @@ -0,0 +1,46 @@ +[project] +name = "cellconstructor" +version = "1.5.0" +fpm_version = ">=0.8.0" + +[[library]] +name = "libsymph" +source-dir = "FModules" +source-list = [ + "symdynph_gq_new.f90", "symm_base.f90", "sgam_ph.f90", "invmat.f90", + "set_asr.f90", "error_handler.f90", "io_global.f90", "flush_unit.f90", + "symvector.f90", "fc_supercell_from_dyn.f90", "set_tau.f90", "cryst_to_car.f90", + "recips.f90", "q2qstar_out.f90", "rotate_and_add_dyn.f90", "trntnsc.f90", + "star_q.f90", "eqvect.f90", "symm_matrix.f90", "from_matdyn.f90", "interp.f90", + "q_gen.f90", "smallgq.f90", "symmetry_high_rank.f90", "unwrap_tensors.f90", + "get_latvec.f90", "contract_two_phonon_propagator.f90", "get_q_grid_fast.f90", + "kind.f90", "constants.f90", "eff_charge_interp.f90", "get_translations.f90", + "get_equivalent_atoms.f90" +] +build-type = "static" + +[[library]] +name = "libsecondorder" +source-dir = "FModules" +source-list = [ + "second_order_centering.f90", "second_order_ASR.f90" +] +build-type = "static" + +[[library]] +name = "libthirdorder" +source-dir = "FModules" +source-list = [ + "third_order_centering.f90", "third_order_ASR.f90", + "third_order_interpol.f90", "third_order_dynbubble.f90" +] +build-type = "static" + +[[library]] +name = "libthermal_conductivity" +source-dir = "FModules" +source-list = [ + "get_scattering_q_grid.f90", "third_order_cond.f90", + "third_order_cond_centering.f90", "get_lf.f90" +] +build-type = "static" diff --git a/meson.build b/meson.build index a0a396e1..8a1dabff 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,7 @@ fpm_exe = find_program('fpm', required: true) f2py_exe = find_program('f2py', required: true) # Define el directorio de compilación para fpm -fpm_build_dir = meson.build_root() / 'fpm_build' +fpm_build_dir = meson.project_build_root() / 'fpm_build' # Busca las librerías de sistema BLAS, LAPACK y OpenMP lapack_dep = dependency('lapack', required: true) @@ -25,9 +25,12 @@ openmp_dep = dependency('openmp', required: true) # --- PASO 1: Compilar todas las librerías de Fortran con fpm --- # Este comando usa fpm.toml para saber qué librerías compilar y dónde colocarlas. +#fflags = '-g -fPIC -funroll-loops -fstack-arrays -Ofast -frepack-arrays -faggressive-function-elimination -fopenmp' +#cflags = '-fPIC' run_command( fpm_exe, 'install', +# '--profile', 'release', '--prefix', fpm_build_dir, '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], check : true diff --git a/meson.build.old b/meson.build.old index a2affe9e..8dc20aa3 100644 --- a/meson.build.old +++ b/meson.build.old @@ -21,7 +21,7 @@ fpm_exe = find_program('fpm', required: true) f2py_exe = find_program('f2py', required: true) # Define the build directory for fpm -fpm_build_dir = meson.build_root() / 'fpm_build' +fpm_build_dir = meson.project_build_root() / 'fpm_build' # Searches the system for the BLAS and LAPACK libraries. # Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. diff --git a/meson.build.test_fpm_toml2 b/meson.build.test_fpm_toml2 new file mode 100644 index 00000000..82600c67 --- /dev/null +++ b/meson.build.test_fpm_toml2 @@ -0,0 +1,217 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Define el directorio de compilación para fpm +fpm_build_dir = meson.project_build_root() / 'fpm_build' + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- PASO 1: Compilar todas las librerías de Fortran con fpm como custom_target --- +fpm_install_target = custom_target( + 'fpm_install', + output: [ + 'lib/libsymph.a', + 'lib/libsecondorder.a', + 'lib/libthirdorder.a', + 'lib/libthermal_conductivity.a', + ], + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--flag=-g', + '--flag=-fPIC', + '--flag=-O2', + '--flag=-fopenmp', + ], + install: false, + build_always_stale: true, +) + +# --- PASO 2: Definir cada extensión de Python (Fortran) --- +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + fpm_build_dir / 'lib' / 'libsymph.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + fpm_build_dir / 'lib' / 'libsecondorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + fpm_build_dir / 'lib' / 'libthirdorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + fpm_build_dir / 'lib' / 'libthermal_conductivity.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) + +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) +if pytest_exe.found() + test('pytest', pytest_exe, + args: ['-v'], + workdir: meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From d0df90a0a2cab7ea1bcd8504c85bf072954b9cec Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 10:02:23 +0200 Subject: [PATCH 068/151] New way of solving the FORTRAN library with Meson --- fpm.toml | 57 +++++----- fpm.toml.old2 | 53 +++++++++ fpm.toml2 | 46 -------- meson.build | 185 +++++++++++++++++-------------- meson.build.old2 | 194 +++++++++++++++++++++++++++++++++ meson.build.test_fpm_toml2 | 217 ------------------------------------- 6 files changed, 376 insertions(+), 376 deletions(-) create mode 100644 fpm.toml.old2 delete mode 100644 fpm.toml2 create mode 100644 meson.build.old2 delete mode 100644 meson.build.test_fpm_toml2 diff --git a/fpm.toml b/fpm.toml index 6f71b40e..49719e3d 100644 --- a/fpm.toml +++ b/fpm.toml @@ -4,50 +4,43 @@ version = "1.5.0" fpm_version = ">=0.8.0" [[library]] +name = "libsymph" source-dir = "FModules" -# This tells fpm to compile all Fortran files in the FModules directory. -# If you only want to compile specific files, you can use: - source-list = [ - "FModules/symdynph_gq_new.f90", "FModules/symm_base.f90", - "FModules/sgam_ph.f90", "FModules/invmat.f90", "FModules/set_asr.f90", - "FModules/error_handler.f90", "FModules/io_global.f90", - "FModules/flush_unit.f90", "FModules/symvector.f90", - "FModules/fc_supercell_from_dyn.f90", "FModules/set_tau.f90", - "FModules/cryst_to_car.f90", "FModules/recips.f90", - "FModules/q2qstar_out.f90", "FModules/rotate_and_add_dyn.f90", - "FModules/trntnsc.f90", "FModules/star_q.f90", "FModules/eqvect.f90", - "FModules/symm_matrix.f90", "FModules/from_matdyn.f90", - "FModules/interp.f90", "FModules/q_gen.f90", "FModules/smallgq.f90", - "FModules/symmetry_high_rank.f90", "FModules/unwrap_tensors.f90", - "FModules/get_latvec.f90", "FModules/contract_two_phonon_propagator.f90", - "FModules/get_q_grid_fast.f90", "FModules/kind.f90", - "FModules/constants.f90", "FModules/eff_charge_interp.f90", - "FModules/get_translations.f90", "FModules/get_equivalent_atoms.f90" - ] +source-list = [ + "symdynph_gq_new.f90", "symm_base.f90", "sgam_ph.f90", "invmat.f90", + "set_asr.f90", "error_handler.f90", "io_global.f90", "flush_unit.f90", + "symvector.f90", "fc_supercell_from_dyn.f90", "set_tau.f90", "cryst_to_car.f90", + "recips.f90", "q2qstar_out.f90", "rotate_and_add_dyn.f90", "trntnsc.f90", + "star_q.f90", "eqvect.f90", "symm_matrix.f90", "from_matdyn.f90", "interp.f90", + "q_gen.f90", "smallgq.f90", "symmetry_high_rank.f90", "unwrap_tensors.f90", + "get_latvec.f90", "contract_two_phonon_propagator.f90", "get_q_grid_fast.f90", + "kind.f90", "constants.f90", "eff_charge_interp.f90", "get_translations.f90", + "get_equivalent_atoms.f90" +] +build-type = "static" + [[library]] -name = "secondorder" +name = "libsecondorder" source-dir = "FModules" source-list = [ - "FModules/second_order_centering.f90", - "FModules/second_order_ASR.f90" + "second_order_centering.f90", "second_order_ASR.f90" ] +build-type = "static" [[library]] -name = "thirdorder" +name = "libthirdorder" source-dir = "FModules" source-list = [ - "FModules/third_order_centering.f90", - "FModules/third_order_ASR.f90", - "FModules/third_order_interpol.f90", - "FModules/third_order_dynbubble.f90" + "third_order_centering.f90", "third_order_ASR.f90", + "third_order_interpol.f90", "third_order_dynbubble.f90" ] +build-type = "static" [[library]] -name = "thermal_conductivity" +name = "libthermal_conductivity" source-dir = "FModules" source-list = [ - "FModules/get_scattering_q_grid.f90", - "FModules/third_order_cond.f90", - "FModules/third_order_cond_centering.f90", - "FModules/get_lf.f90" + "get_scattering_q_grid.f90", "third_order_cond.f90", + "third_order_cond_centering.f90", "get_lf.f90" ] +build-type = "static" diff --git a/fpm.toml.old2 b/fpm.toml.old2 new file mode 100644 index 00000000..6f71b40e --- /dev/null +++ b/fpm.toml.old2 @@ -0,0 +1,53 @@ +[project] +name = "cellconstructor" +version = "1.5.0" +fpm_version = ">=0.8.0" + +[[library]] +source-dir = "FModules" +# This tells fpm to compile all Fortran files in the FModules directory. +# If you only want to compile specific files, you can use: + source-list = [ + "FModules/symdynph_gq_new.f90", "FModules/symm_base.f90", + "FModules/sgam_ph.f90", "FModules/invmat.f90", "FModules/set_asr.f90", + "FModules/error_handler.f90", "FModules/io_global.f90", + "FModules/flush_unit.f90", "FModules/symvector.f90", + "FModules/fc_supercell_from_dyn.f90", "FModules/set_tau.f90", + "FModules/cryst_to_car.f90", "FModules/recips.f90", + "FModules/q2qstar_out.f90", "FModules/rotate_and_add_dyn.f90", + "FModules/trntnsc.f90", "FModules/star_q.f90", "FModules/eqvect.f90", + "FModules/symm_matrix.f90", "FModules/from_matdyn.f90", + "FModules/interp.f90", "FModules/q_gen.f90", "FModules/smallgq.f90", + "FModules/symmetry_high_rank.f90", "FModules/unwrap_tensors.f90", + "FModules/get_latvec.f90", "FModules/contract_two_phonon_propagator.f90", + "FModules/get_q_grid_fast.f90", "FModules/kind.f90", + "FModules/constants.f90", "FModules/eff_charge_interp.f90", + "FModules/get_translations.f90", "FModules/get_equivalent_atoms.f90" + ] +[[library]] +name = "secondorder" +source-dir = "FModules" +source-list = [ + "FModules/second_order_centering.f90", + "FModules/second_order_ASR.f90" +] + +[[library]] +name = "thirdorder" +source-dir = "FModules" +source-list = [ + "FModules/third_order_centering.f90", + "FModules/third_order_ASR.f90", + "FModules/third_order_interpol.f90", + "FModules/third_order_dynbubble.f90" +] + +[[library]] +name = "thermal_conductivity" +source-dir = "FModules" +source-list = [ + "FModules/get_scattering_q_grid.f90", + "FModules/third_order_cond.f90", + "FModules/third_order_cond_centering.f90", + "FModules/get_lf.f90" +] diff --git a/fpm.toml2 b/fpm.toml2 deleted file mode 100644 index 49719e3d..00000000 --- a/fpm.toml2 +++ /dev/null @@ -1,46 +0,0 @@ -[project] -name = "cellconstructor" -version = "1.5.0" -fpm_version = ">=0.8.0" - -[[library]] -name = "libsymph" -source-dir = "FModules" -source-list = [ - "symdynph_gq_new.f90", "symm_base.f90", "sgam_ph.f90", "invmat.f90", - "set_asr.f90", "error_handler.f90", "io_global.f90", "flush_unit.f90", - "symvector.f90", "fc_supercell_from_dyn.f90", "set_tau.f90", "cryst_to_car.f90", - "recips.f90", "q2qstar_out.f90", "rotate_and_add_dyn.f90", "trntnsc.f90", - "star_q.f90", "eqvect.f90", "symm_matrix.f90", "from_matdyn.f90", "interp.f90", - "q_gen.f90", "smallgq.f90", "symmetry_high_rank.f90", "unwrap_tensors.f90", - "get_latvec.f90", "contract_two_phonon_propagator.f90", "get_q_grid_fast.f90", - "kind.f90", "constants.f90", "eff_charge_interp.f90", "get_translations.f90", - "get_equivalent_atoms.f90" -] -build-type = "static" - -[[library]] -name = "libsecondorder" -source-dir = "FModules" -source-list = [ - "second_order_centering.f90", "second_order_ASR.f90" -] -build-type = "static" - -[[library]] -name = "libthirdorder" -source-dir = "FModules" -source-list = [ - "third_order_centering.f90", "third_order_ASR.f90", - "third_order_interpol.f90", "third_order_dynbubble.f90" -] -build-type = "static" - -[[library]] -name = "libthermal_conductivity" -source-dir = "FModules" -source-list = [ - "get_scattering_q_grid.f90", "third_order_cond.f90", - "third_order_cond_centering.f90", "get_lf.f90" -] -build-type = "static" diff --git a/meson.build b/meson.build index 8a1dabff..82600c67 100644 --- a/meson.build +++ b/meson.build @@ -23,120 +23,143 @@ lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) -# --- PASO 1: Compilar todas las librerías de Fortran con fpm --- -# Este comando usa fpm.toml para saber qué librerías compilar y dónde colocarlas. -#fflags = '-g -fPIC -funroll-loops -fstack-arrays -Ofast -frepack-arrays -faggressive-function-elimination -fopenmp' -#cflags = '-fPIC' -run_command( +# --- PASO 1: Compilar todas las librerías de Fortran con fpm como custom_target --- +fpm_install_target = custom_target( + 'fpm_install', + output: [ + 'lib/libsymph.a', + 'lib/libsecondorder.a', + 'lib/libthirdorder.a', + 'lib/libthermal_conductivity.a', + ], + command: [ fpm_exe, 'install', -# '--profile', 'release', '--prefix', fpm_build_dir, - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - check : true + '--flag=-g', + '--flag=-fPIC', + '--flag=-O2', + '--flag=-fopenmp', + ], + install: false, + build_always_stale: true, ) # --- PASO 2: Definir cada extensión de Python (Fortran) --- -# Cada extensión ahora tiene su propio bloque de compilación. - # Extensión 'symph' symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' ) + symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, ) + py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - fpm_build_dir / 'lib' / 'libsymph.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' + 'symph', + symph_wrapper, + fpm_build_dir / 'lib' / 'libsymph.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, ) # Extensión 'secondorder' secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) + secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, ) + py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - fpm_build_dir / 'lib' / 'libsecondorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + 'secondorder', + secondorder_wrapper, + fpm_build_dir / 'lib' / 'libsecondorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, ) # Extensión 'thirdorder' thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) + thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, ) + py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - fpm_build_dir / 'lib' / 'libthirdorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' + 'thirdorder', + thirdorder_wrapper, + fpm_build_dir / 'lib' / 'libthirdorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, ) # Extensión 'thermal_conductivity' cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) + cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, ) + py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - fpm_build_dir / 'lib' / 'libthermal_conductivity.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' + 'thermal_conductivity', + cond_wrapper, + fpm_build_dir / 'lib' / 'libthermal_conductivity.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, ) # --- Definición de la extensión C 'cc_linalg' --- @@ -148,6 +171,7 @@ else endif cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) + py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, @@ -183,11 +207,10 @@ python_installation.install_sources([ # Set the tests by pytest. (Needs pytest installed) pytest_exe = find_program('pytest', required: false) - if pytest_exe.found() test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() + args: ['-v'], + workdir: meson.project_source_root() ) else message('pytest no encontrado; se omiten tests con pytest.') diff --git a/meson.build.old2 b/meson.build.old2 new file mode 100644 index 00000000..8a1dabff --- /dev/null +++ b/meson.build.old2 @@ -0,0 +1,194 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Define el directorio de compilación para fpm +fpm_build_dir = meson.project_build_root() / 'fpm_build' + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- PASO 1: Compilar todas las librerías de Fortran con fpm --- +# Este comando usa fpm.toml para saber qué librerías compilar y dónde colocarlas. +#fflags = '-g -fPIC -funroll-loops -fstack-arrays -Ofast -frepack-arrays -faggressive-function-elimination -fopenmp' +#cflags = '-fPIC' +run_command( + fpm_exe, + 'install', +# '--profile', 'release', + '--prefix', fpm_build_dir, + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + check : true +) + +# --- PASO 2: Definir cada extensión de Python (Fortran) --- +# Cada extensión ahora tiene su propio bloque de compilación. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + fpm_build_dir / 'lib' / 'libsymph.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + fpm_build_dir / 'lib' / 'libsecondorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + fpm_build_dir / 'lib' / 'libthirdorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + fpm_build_dir / 'lib' / 'libthermal_conductivity.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif diff --git a/meson.build.test_fpm_toml2 b/meson.build.test_fpm_toml2 deleted file mode 100644 index 82600c67..00000000 --- a/meson.build.test_fpm_toml2 +++ /dev/null @@ -1,217 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Define el directorio de compilación para fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- PASO 1: Compilar todas las librerías de Fortran con fpm como custom_target --- -fpm_install_target = custom_target( - 'fpm_install', - output: [ - 'lib/libsymph.a', - 'lib/libsecondorder.a', - 'lib/libthirdorder.a', - 'lib/libthermal_conductivity.a', - ], - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--flag=-g', - '--flag=-fPIC', - '--flag=-O2', - '--flag=-fopenmp', - ], - install: false, - build_always_stale: true, -) - -# --- PASO 2: Definir cada extensión de Python (Fortran) --- -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - fpm_build_dir / 'lib' / 'libsymph.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - fpm_build_dir / 'lib' / 'libsecondorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - fpm_build_dir / 'lib' / 'libthirdorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - fpm_build_dir / 'lib' / 'libthermal_conductivity.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) - -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) -if pytest_exe.found() - test('pytest', pytest_exe, - args: ['-v'], - workdir: meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif From 35d19f3dcdf6a1c2e95492414525cc2525e188bf Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 10:23:47 +0200 Subject: [PATCH 069/151] Fix the "meson.build:27:21: ERROR: custom_target keyword argument "output" Output 'lib/libsymph.a' must not contain a path segment." --- meson.build | 179 +++++++++++++-------------- meson.build.old3 | 217 +++++++++++++++++++++++++++++++++ meson.build.old3.fpm_f2py_toml | 204 +++++++++++++++++++++++++++++++ 3 files changed, 504 insertions(+), 96 deletions(-) create mode 100644 meson.build.old3 create mode 100644 meson.build.old3.fpm_f2py_toml diff --git a/meson.build b/meson.build index 82600c67..f4b7181f 100644 --- a/meson.build +++ b/meson.build @@ -23,143 +23,130 @@ lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) -# --- PASO 1: Compilar todas las librerías de Fortran con fpm como custom_target --- +# --- PASO 1: Compilar e instalar todas las librerías de Fortran con fpm --- +# Usamos un custom_target para que Meson sepa que se generarán los archivos. fpm_install_target = custom_target( 'fpm_install', + # Las salidas se declaran sin la ruta del directorio, Meson las espera en el directorio de compilación del target. output: [ - 'lib/libsymph.a', - 'lib/libsecondorder.a', - 'lib/libthirdorder.a', - 'lib/libthermal_conductivity.a', + 'libsymph.a', + 'libsecondorder.a', + 'libthirdorder.a', + 'libthermal_conductivity.a', ], command: [ fpm_exe, 'install', '--prefix', fpm_build_dir, - '--flag=-g', - '--flag=-fPIC', - '--flag=-O2', - '--flag=-fopenmp', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], ], + # No lo instalamos, ya que las librerías generadas se moverán más tarde. install: false, + # Asegura que el target se ejecute cada vez para regenerar las librerías. build_always_stale: true, ) # --- PASO 2: Definir cada extensión de Python (Fortran) --- +# Cada extensión ahora tiene su propio bloque de compilación. + # Extensión 'symph' symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' ) - symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) - py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - fpm_build_dir / 'lib' / 'libsymph.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, + 'symph', + symph_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[0]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' ) # Extensión 'secondorder' secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) - secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) - py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - fpm_build_dir / 'lib' / 'libsecondorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, + 'secondorder', + secondorder_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[1]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'thirdorder' thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) - thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) - py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - fpm_build_dir / 'lib' / 'libthirdorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, + 'thirdorder', + thirdorder_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[2]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' ) # Extensión 'thermal_conductivity' cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) - cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) - py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - fpm_build_dir / 'lib' / 'libthermal_conductivity.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, + 'thermal_conductivity', + cond_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[3]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' ) # --- Definición de la extensión C 'cc_linalg' --- @@ -171,7 +158,6 @@ else endif cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) - py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, @@ -207,10 +193,11 @@ python_installation.install_sources([ # Set the tests by pytest. (Needs pytest installed) pytest_exe = find_program('pytest', required: false) + if pytest_exe.found() test('pytest', pytest_exe, - args: ['-v'], - workdir: meson.project_source_root() + args : ['-v'], + workdir : meson.project_source_root() ) else message('pytest no encontrado; se omiten tests con pytest.') diff --git a/meson.build.old3 b/meson.build.old3 new file mode 100644 index 00000000..82600c67 --- /dev/null +++ b/meson.build.old3 @@ -0,0 +1,217 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Define el directorio de compilación para fpm +fpm_build_dir = meson.project_build_root() / 'fpm_build' + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- PASO 1: Compilar todas las librerías de Fortran con fpm como custom_target --- +fpm_install_target = custom_target( + 'fpm_install', + output: [ + 'lib/libsymph.a', + 'lib/libsecondorder.a', + 'lib/libthirdorder.a', + 'lib/libthermal_conductivity.a', + ], + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--flag=-g', + '--flag=-fPIC', + '--flag=-O2', + '--flag=-fopenmp', + ], + install: false, + build_always_stale: true, +) + +# --- PASO 2: Definir cada extensión de Python (Fortran) --- +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + fpm_build_dir / 'lib' / 'libsymph.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + fpm_build_dir / 'lib' / 'libsecondorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + fpm_build_dir / 'lib' / 'libthirdorder.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true, + depends: fpm_install_target, +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + fpm_build_dir / 'lib' / 'libthermal_conductivity.a', + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..', + dependencies_extra: fpm_install_target, +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) + +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) +if pytest_exe.found() + test('pytest', pytest_exe, + args: ['-v'], + workdir: meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif diff --git a/meson.build.old3.fpm_f2py_toml b/meson.build.old3.fpm_f2py_toml new file mode 100644 index 00000000..f4b7181f --- /dev/null +++ b/meson.build.old3.fpm_f2py_toml @@ -0,0 +1,204 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Define el directorio de compilación para fpm +fpm_build_dir = meson.project_build_root() / 'fpm_build' + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- PASO 1: Compilar e instalar todas las librerías de Fortran con fpm --- +# Usamos un custom_target para que Meson sepa que se generarán los archivos. +fpm_install_target = custom_target( + 'fpm_install', + # Las salidas se declaran sin la ruta del directorio, Meson las espera en el directorio de compilación del target. + output: [ + 'libsymph.a', + 'libsecondorder.a', + 'libthirdorder.a', + 'libthermal_conductivity.a', + ], + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], + ], + # No lo instalamos, ya que las librerías generadas se moverán más tarde. + install: false, + # Asegura que el target se ejecute cada vez para regenerar las librerías. + build_always_stale: true, +) + +# --- PASO 2: Definir cada extensión de Python (Fortran) --- +# Cada extensión ahora tiene su propio bloque de compilación. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[0]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[1]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[2]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + fpm_install_target.full_path(fpm_install_target.outputs()[3]), + install: true, + include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From eb44651e78a5ad5fc4aeabf911ac2f6fdb7495ff Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 10:33:31 +0200 Subject: [PATCH 070/151] Fix "meson.build:78:52: ERROR: Unknown method "outputs" in object ['/opt/hostedtoolcache/Python/3.9.23/x64/bin/fpm']>, 'install', '--prefix', '/home/runner/work/CellConstructor/CellConstructor/builddir/fpm_build', '--flag', '-g', '-fPIC', '-O2', '-fopenmp']> of type CustomTargetHolder." --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index f4b7181f..e0ed2c7a 100644 --- a/meson.build +++ b/meson.build @@ -75,7 +75,7 @@ symph_wrapper = custom_target( py_symph_ext = python_installation.extension_module( 'symph', symph_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[0]), + fpm_install_target.full_path(fpm_install_target.outputs[0]), install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], @@ -97,7 +97,7 @@ secondorder_wrapper = custom_target( py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[1]), + fpm_install_target.full_path(fpm_install_target.outputs[1]), install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -119,7 +119,7 @@ thirdorder_wrapper = custom_target( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[2]), + fpm_install_target.full_path(fpm_install_target.outputs[2]), install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -141,7 +141,7 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[3]), + fpm_install_target.full_path(fpm_install_target.outputs[3]), install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], From 8703b03d10d7b2dc215d0ca45bb97a843ccc1c8a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 10:47:21 +0200 Subject: [PATCH 071/151] Fix "meson.build:78:59: ERROR: Expecting lparen got lbracket. fpm_install_target.full_path(fpm_install_target.outputs[0])," --- meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index e0ed2c7a..56495d37 100644 --- a/meson.build +++ b/meson.build @@ -72,10 +72,11 @@ symph_wrapper = custom_target( command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) +libsymph_path = fpm_install_target.full_path(fpm_install_target.outputs[0]) py_symph_ext = python_installation.extension_module( 'symph', symph_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs[0]), + libsymph_path, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], @@ -94,10 +95,11 @@ secondorder_wrapper = custom_target( command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) +libsecondorder_path = fpm_install_target.full_path(fpm_install_target.outputs[1]) py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs[1]), + libsecondorder_path, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -116,10 +118,11 @@ thirdorder_wrapper = custom_target( command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) +libthirdorder_path = fpm_install_target.full_path(fpm_install_target.outputs[2]) py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs[2]), + libthirdorder_path, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -138,10 +141,11 @@ cond_wrapper = custom_target( command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) +libthermal_conductivity_path = fpm_install_target.full_path(fpm_install_target.outputs[3]) py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs[3]), + libthermal_conductivity_path, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], From 8893c66247cfe736c3189a3cb331a5d017e03391 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 10:56:35 +0200 Subject: [PATCH 072/151] Fix "meson.build:75:71: ERROR: Expecting lparen got lbracket. libsymph_path = fpm_install_target.full_path(fpm_install_target.outputs[0])" --- meson.build | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 56495d37..5bce98bf 100644 --- a/meson.build +++ b/meson.build @@ -48,6 +48,14 @@ fpm_install_target = custom_target( # --- PASO 2: Definir cada extensión de Python (Fortran) --- # Cada extensión ahora tiene su propio bloque de compilación. +# Obtener la lista de outputs primero +fpm_outputs = fpm_install_target.outputs + +# Obtener la ruta completa para cada librería +libsymph_path = fpm_install_target.full_path(fpm_outputs[0]) +libsecondorder_path = fpm_install_target.full_path(fpm_outputs[1]) +libthirdorder_path = fpm_install_target.full_path(fpm_outputs[2]) +libthermal_path = fpm_install_target.full_path(fpm_outputs[3]) # Extensión 'symph' symph_fortran_src = files( @@ -72,7 +80,7 @@ symph_wrapper = custom_target( command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) -libsymph_path = fpm_install_target.full_path(fpm_install_target.outputs[0]) + py_symph_ext = python_installation.extension_module( 'symph', symph_wrapper, @@ -95,7 +103,7 @@ secondorder_wrapper = custom_target( command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) -libsecondorder_path = fpm_install_target.full_path(fpm_install_target.outputs[1]) + py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_wrapper, @@ -118,7 +126,7 @@ thirdorder_wrapper = custom_target( command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) -libthirdorder_path = fpm_install_target.full_path(fpm_install_target.outputs[2]) + py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_wrapper, @@ -141,7 +149,7 @@ cond_wrapper = custom_target( command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) -libthermal_conductivity_path = fpm_install_target.full_path(fpm_install_target.outputs[3]) + py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, From 056baeed724d7c13eefb14e64795f93d16dae3e4 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 11:09:14 +0200 Subject: [PATCH 073/151] Fix "meson.build:52:40: ERROR: Expecting lparen got eol. fpm_outputs = fpm_install_target.outputs" --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5bce98bf..6eb9b61f 100644 --- a/meson.build +++ b/meson.build @@ -49,7 +49,7 @@ fpm_install_target = custom_target( # --- PASO 2: Definir cada extensión de Python (Fortran) --- # Cada extensión ahora tiene su propio bloque de compilación. # Obtener la lista de outputs primero -fpm_outputs = fpm_install_target.outputs +fpm_outputs = fpm_install_target.outputs() # Obtener la ruta completa para cada librería libsymph_path = fpm_install_target.full_path(fpm_outputs[0]) From f5ff56d8555ba664002ffd1120761e8b0dd48be2 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 11:21:37 +0200 Subject: [PATCH 074/151] This is a error from fpm, not Meson: "meson.build:52:33: ERROR: Unknown method "outputs" in object of type CustomTargetHolder.". I'll try to fix it. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6eb9b61f..71b8da74 100644 --- a/meson.build +++ b/meson.build @@ -49,7 +49,7 @@ fpm_install_target = custom_target( # --- PASO 2: Definir cada extensión de Python (Fortran) --- # Cada extensión ahora tiene su propio bloque de compilación. # Obtener la lista de outputs primero -fpm_outputs = fpm_install_target.outputs() +fpm_outputs = fpm_install_target.output() # Obtener la ruta completa para cada librería libsymph_path = fpm_install_target.full_path(fpm_outputs[0]) From 527adf17e26e8338389940abccb7218cdea84389 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 11:39:14 +0200 Subject: [PATCH 075/151] The most robust way to handle this is to use a dedicated custom_target for each Fortran library, which is a return to a slightly earlier version of our process. This makes the dependencies explicit and avoids the outputs() issue. --- meson.build | 74 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 71b8da74..f3a7ae2e 100644 --- a/meson.build +++ b/meson.build @@ -23,7 +23,7 @@ lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) -# --- PASO 1: Compilar e instalar todas las librerías de Fortran con fpm --- +/*# --- PASO 1: Compilar e instalar todas las librerías de Fortran con fpm --- # Usamos un custom_target para que Meson sepa que se generarán los archivos. fpm_install_target = custom_target( 'fpm_install', @@ -55,7 +55,10 @@ fpm_outputs = fpm_install_target.output() libsymph_path = fpm_install_target.full_path(fpm_outputs[0]) libsecondorder_path = fpm_install_target.full_path(fpm_outputs[1]) libthirdorder_path = fpm_install_target.full_path(fpm_outputs[2]) -libthermal_path = fpm_install_target.full_path(fpm_outputs[3]) +libthermal_path = fpm_install_target.full_path(fpm_outputs[3])*/ + +# --- Definición de cada extensión de Python (Fortran) --- +# Cada extensión ahora tiene su propio bloque de compilación, lo que es más robusto. # Extensión 'symph' symph_fortran_src = files( @@ -73,6 +76,22 @@ symph_fortran_src = files( 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' ) + +# Creamos un custom_target solo para la librería symph. +symph_fortran_lib = custom_target( + 'symph_fortran_lib', + output: 'libsymph.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'symph', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: symph_fortran_src, + build_by_default: true +) + symph_wrapper = custom_target( 'symph_f2py_wrapper', input: symph_fortran_src, @@ -84,7 +103,7 @@ symph_wrapper = custom_target( py_symph_ext = python_installation.extension_module( 'symph', symph_wrapper, - libsymph_path, + symph_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], @@ -96,6 +115,19 @@ py_symph_ext = python_installation.extension_module( secondorder_fortran_src = files( 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) +secondorder_fortran_lib = custom_target( + 'secondorder_fortran_lib', + output: 'libsecondorder.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'secondorder', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: secondorder_fortran_src, + build_by_default: true +) secondorder_wrapper = custom_target( 'secondorder_f2py_wrapper', input: secondorder_fortran_src, @@ -107,7 +139,7 @@ secondorder_wrapper = custom_target( py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_wrapper, - libsecondorder_path, + secondorder_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -119,6 +151,19 @@ thirdorder_fortran_src = files( 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) +thirdorder_fortran_lib = custom_target( + 'thirdorder_fortran_lib', + output: 'libthirdorder.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'thirdorder', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: thirdorder_fortran_src, + build_by_default: true +) thirdorder_wrapper = custom_target( 'thirdorder_f2py_wrapper', input: thirdorder_fortran_src, @@ -130,7 +175,7 @@ thirdorder_wrapper = custom_target( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_wrapper, - libthirdorder_path, + thirdorder_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -138,13 +183,26 @@ py_thirdorder_ext = python_installation.extension_module( ) # Extensión 'thermal_conductivity' -cond_fortran_src = files( +thermal_conductivity_fortran_src = files( 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) +thermal_conductivity_fortran_lib = custom_target( + 'thermal_conductivity_fortran_lib', + output: 'libthermal_conductivity.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'thermal_conductivity', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: thermal_conductivity_fortran_src, + build_by_default: true +) cond_wrapper = custom_target( 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, + input: thermal_conductivity_fortran_src, output: 'thermal_conductivity-f2pywrappers.c', command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], build_by_default: true @@ -153,7 +211,7 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, - libthermal_conductivity_path, + thirdorder_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], From d482536fc18dfa9107a465eeb7a7f0a2134bf6e1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 9 Sep 2025 11:43:01 +0200 Subject: [PATCH 076/151] Clean code --- meson.build | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/meson.build b/meson.build index f3a7ae2e..b900a3ce 100644 --- a/meson.build +++ b/meson.build @@ -23,40 +23,6 @@ lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) -/*# --- PASO 1: Compilar e instalar todas las librerías de Fortran con fpm --- -# Usamos un custom_target para que Meson sepa que se generarán los archivos. -fpm_install_target = custom_target( - 'fpm_install', - # Las salidas se declaran sin la ruta del directorio, Meson las espera en el directorio de compilación del target. - output: [ - 'libsymph.a', - 'libsecondorder.a', - 'libthirdorder.a', - 'libthermal_conductivity.a', - ], - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - ], - # No lo instalamos, ya que las librerías generadas se moverán más tarde. - install: false, - # Asegura que el target se ejecute cada vez para regenerar las librerías. - build_always_stale: true, -) - -# --- PASO 2: Definir cada extensión de Python (Fortran) --- -# Cada extensión ahora tiene su propio bloque de compilación. -# Obtener la lista de outputs primero -fpm_outputs = fpm_install_target.output() - -# Obtener la ruta completa para cada librería -libsymph_path = fpm_install_target.full_path(fpm_outputs[0]) -libsecondorder_path = fpm_install_target.full_path(fpm_outputs[1]) -libthirdorder_path = fpm_install_target.full_path(fpm_outputs[2]) -libthermal_path = fpm_install_target.full_path(fpm_outputs[3])*/ - # --- Definición de cada extensión de Python (Fortran) --- # Cada extensión ahora tiene su propio bloque de compilación, lo que es más robusto. From b4e7b9ad02d60e325a9772807a8e9637340b7d55 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 09:33:06 +0200 Subject: [PATCH 077/151] Setting 'link_with:' in the FORTRAN libraries creation scripts. --- meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index b900a3ce..ebd0593e 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,7 @@ numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true ).stdout().strip() +# quizás usar dependency('numpy'), por ahora funciona así porque Meson aún no ha implementado f2py desde dependency('numpy'), pero es recomendable usar dependency en general. fpm_exe = find_program('fpm', required: true) f2py_exe = find_program('f2py', required: true) @@ -69,7 +70,7 @@ symph_wrapper = custom_target( py_symph_ext = python_installation.extension_module( 'symph', symph_wrapper, - symph_fortran_lib, + link_with: symph_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], @@ -105,7 +106,7 @@ secondorder_wrapper = custom_target( py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_wrapper, - secondorder_fortran_lib, + link_with: secondorder_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -141,7 +142,7 @@ thirdorder_wrapper = custom_target( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_wrapper, - thirdorder_fortran_lib, + link_with: thirdorder_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep], @@ -177,7 +178,7 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, - thirdorder_fortran_lib, + link_with: thirdorder_fortran_lib, install: true, include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], dependencies: [lapack_dep, blas_dep, openmp_dep], From 4d8524ce80ad9360efecb56178fe16428c20afb1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 09:52:13 +0200 Subject: [PATCH 078/151] Fixing "meson.build:70:35: ERROR: Tried to form an absolute path to a dir in the source tree." --- meson.build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index ebd0593e..3e68b086 100644 --- a/meson.build +++ b/meson.build @@ -43,6 +43,12 @@ symph_fortran_src = files( 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' ) +# Creamos las direcciones de numpy y fpm para ser usadas luego +numpy_inc = include_directories(numpy_incdir) +fpm_inc = include_directories(fpm_build_dir / 'include') + +# Luego usa las variables en las extensiones +include_dirs = [numpy_inc, fpm_inc] # Creamos un custom_target solo para la librería symph. symph_fortran_lib = custom_target( @@ -72,7 +78,7 @@ py_symph_ext = python_installation.extension_module( symph_wrapper, link_with: symph_fortran_lib, install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep], link_args: ['-fopenmp'], install_rpath: '$ORIGIN/..' @@ -108,7 +114,7 @@ py_secondorder_ext = python_installation.extension_module( secondorder_wrapper, link_with: secondorder_fortran_lib, install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep], install_rpath: '$ORIGIN/..' ) @@ -144,7 +150,7 @@ py_thirdorder_ext = python_installation.extension_module( thirdorder_wrapper, link_with: thirdorder_fortran_lib, install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep], install_rpath: '$ORIGIN/..' ) @@ -180,7 +186,7 @@ py_cond_ext = python_installation.extension_module( cond_wrapper, link_with: thirdorder_fortran_lib, install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep], link_args: ['-fopenmp'], install_rpath: '$ORIGIN/..' From 715069c66a759738baa0ee7b867b97410740917b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 10:03:35 +0200 Subject: [PATCH 079/151] Fix another absolute path: "meson.build:48:10: ERROR: Tried to form an absolute path to a dir in the source tree." --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 3e68b086..96982328 100644 --- a/meson.build +++ b/meson.build @@ -45,7 +45,8 @@ symph_fortran_src = files( ) # Creamos las direcciones de numpy y fpm para ser usadas luego numpy_inc = include_directories(numpy_incdir) -fpm_inc = include_directories(fpm_build_dir / 'include') +#fpm_inc = include_directories(fpm_build_dir / 'include') +fpm_inc = include_directories('fpm_build/include') # Luego usa las variables en las extensiones include_dirs = [numpy_inc, fpm_inc] From 6ed55a1ff9295e8652b7274b719a47e294d4a80f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 10:28:31 +0200 Subject: [PATCH 080/151] I will not use include_directories, I'll use compiler args instead. --- meson.build | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 96982328..3c3269da 100644 --- a/meson.build +++ b/meson.build @@ -50,7 +50,11 @@ fpm_inc = include_directories('fpm_build/include') # Luego usa las variables en las extensiones include_dirs = [numpy_inc, fpm_inc] - +# Ruta absoluta de includes generados +fpm_include_dir = meson.project_build_root() / 'fpm_build' / 'include' +# Argumentos para el compilador +cpp_inc_args = ['-I' + fpm_include_dir.to_string(), '-I' + numpy_incdir] +fortran_inc_args = ['-I' + fpm_include_dir.to_string()] # Creamos un custom_target solo para la librería symph. symph_fortran_lib = custom_target( 'symph_fortran_lib', @@ -79,7 +83,9 @@ py_symph_ext = python_installation.extension_module( symph_wrapper, link_with: symph_fortran_lib, install: true, - include_directories: include_dirs, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep, openmp_dep], link_args: ['-fopenmp'], install_rpath: '$ORIGIN/..' @@ -115,7 +121,9 @@ py_secondorder_ext = python_installation.extension_module( secondorder_wrapper, link_with: secondorder_fortran_lib, install: true, - include_directories: include_dirs, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep], install_rpath: '$ORIGIN/..' ) @@ -151,7 +159,9 @@ py_thirdorder_ext = python_installation.extension_module( thirdorder_wrapper, link_with: thirdorder_fortran_lib, install: true, - include_directories: include_dirs, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep], install_rpath: '$ORIGIN/..' ) @@ -187,7 +197,9 @@ py_cond_ext = python_installation.extension_module( cond_wrapper, link_with: thirdorder_fortran_lib, install: true, - include_directories: include_dirs, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep, openmp_dep], link_args: ['-fopenmp'], install_rpath: '$ORIGIN/..' From a982bd94cfbe8c9b42dd6a0f86d8b658c9cbe0e9 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 10:39:59 +0200 Subject: [PATCH 081/151] Revert to previous fpm_inc definition. --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 3c3269da..8fa9b643 100644 --- a/meson.build +++ b/meson.build @@ -45,8 +45,8 @@ symph_fortran_src = files( ) # Creamos las direcciones de numpy y fpm para ser usadas luego numpy_inc = include_directories(numpy_incdir) -#fpm_inc = include_directories(fpm_build_dir / 'include') -fpm_inc = include_directories('fpm_build/include') +fpm_inc = include_directories(fpm_build_dir / 'include') +#fpm_inc = include_directories('fpm_build/include') # Luego usa las variables en las extensiones include_dirs = [numpy_inc, fpm_inc] From 9e2b1ebb53eee25e03003ec165f9a725c7ddcb1b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 10:43:35 +0200 Subject: [PATCH 082/151] Comment out unused code. --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 8fa9b643..5a6ec443 100644 --- a/meson.build +++ b/meson.build @@ -45,11 +45,11 @@ symph_fortran_src = files( ) # Creamos las direcciones de numpy y fpm para ser usadas luego numpy_inc = include_directories(numpy_incdir) -fpm_inc = include_directories(fpm_build_dir / 'include') +#fpm_inc = include_directories(fpm_build_dir / 'include') #fpm_inc = include_directories('fpm_build/include') # Luego usa las variables en las extensiones -include_dirs = [numpy_inc, fpm_inc] +#include_dirs = [numpy_inc, fpm_inc] # Ruta absoluta de includes generados fpm_include_dir = meson.project_build_root() / 'fpm_build' / 'include' # Argumentos para el compilador From d9d5a7077f9c92ff427dfadfc6ae61fbb9fe85e3 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 11:12:24 +0200 Subject: [PATCH 083/151] Removing "to_string()" due to the fact that probably fpm_include_dir is already a srting. --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 5a6ec443..d4a9a99b 100644 --- a/meson.build +++ b/meson.build @@ -53,8 +53,8 @@ numpy_inc = include_directories(numpy_incdir) # Ruta absoluta de includes generados fpm_include_dir = meson.project_build_root() / 'fpm_build' / 'include' # Argumentos para el compilador -cpp_inc_args = ['-I' + fpm_include_dir.to_string(), '-I' + numpy_incdir] -fortran_inc_args = ['-I' + fpm_include_dir.to_string()] +cpp_inc_args = ['-I' + fpm_include_dir, '-I' + numpy_incdir] +fortran_inc_args = ['-I' + fpm_include_dir] # Creamos un custom_target solo para la librería symph. symph_fortran_lib = custom_target( 'symph_fortran_lib', From 901b9c2bd6a21829fc8c0c59e6eb5cc8b869bf5a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 11:17:58 +0200 Subject: [PATCH 084/151] Fix bug --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index d4a9a99b..9de107e2 100644 --- a/meson.build +++ b/meson.build @@ -195,7 +195,7 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, - link_with: thirdorder_fortran_lib, + link_with: thermal_conductivity_fortran_lib, install: true, #include_directories: include_dirs, cpp_args: cpp_inc_args, From f97adc7d9f689e3ffc85163c27d591f8e16449c3 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 11:57:32 +0200 Subject: [PATCH 085/151] Removing the fpm wrapper and try with all the automatic Meson tricks (hope this works) --- meson.build | 118 ++++----------------- meson.build.old4 | 260 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 282 insertions(+), 96 deletions(-) create mode 100644 meson.build.old4 diff --git a/meson.build b/meson.build index 9de107e2..afde0f79 100644 --- a/meson.build +++ b/meson.build @@ -11,21 +11,15 @@ numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true ).stdout().strip() -# quizás usar dependency('numpy'), por ahora funciona así porque Meson aún no ha implementado f2py desde dependency('numpy'), pero es recomendable usar dependency en general. - fpm_exe = find_program('fpm', required: true) f2py_exe = find_program('f2py', required: true) -# Define el directorio de compilación para fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - # Busca las librerías de sistema BLAS, LAPACK y OpenMP lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) # --- Definición de cada extensión de Python (Fortran) --- -# Cada extensión ahora tiene su propio bloque de compilación, lo que es más robusto. # Extensión 'symph' symph_fortran_src = files( @@ -43,50 +37,27 @@ symph_fortran_src = files( 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' ) -# Creamos las direcciones de numpy y fpm para ser usadas luego -numpy_inc = include_directories(numpy_incdir) -#fpm_inc = include_directories(fpm_build_dir / 'include') -#fpm_inc = include_directories('fpm_build/include') - -# Luego usa las variables en las extensiones -#include_dirs = [numpy_inc, fpm_inc] -# Ruta absoluta de includes generados -fpm_include_dir = meson.project_build_root() / 'fpm_build' / 'include' -# Argumentos para el compilador -cpp_inc_args = ['-I' + fpm_include_dir, '-I' + numpy_incdir] -fortran_inc_args = ['-I' + fpm_include_dir] -# Creamos un custom_target solo para la librería symph. -symph_fortran_lib = custom_target( - 'symph_fortran_lib', - output: 'libsymph.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'symph', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: symph_fortran_src, - build_by_default: true -) symph_wrapper = custom_target( 'symph_f2py_wrapper', input: symph_fortran_src, output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], build_by_default: true ) py_symph_ext = python_installation.extension_module( 'symph', - symph_wrapper, - link_with: symph_fortran_lib, + [symph_wrapper, symph_fortran_src], install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir), link_args: ['-fopenmp'], install_rpath: '$ORIGIN/..' ) @@ -95,19 +66,7 @@ py_symph_ext = python_installation.extension_module( secondorder_fortran_src = files( 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) -secondorder_fortran_lib = custom_target( - 'secondorder_fortran_lib', - output: 'libsecondorder.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'secondorder', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: secondorder_fortran_src, - build_by_default: true -) + secondorder_wrapper = custom_target( 'secondorder_f2py_wrapper', input: secondorder_fortran_src, @@ -118,13 +77,10 @@ secondorder_wrapper = custom_target( py_secondorder_ext = python_installation.extension_module( 'secondorder', - secondorder_wrapper, - link_with: secondorder_fortran_lib, + [secondorder_wrapper, secondorder_fortran_src], install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir), install_rpath: '$ORIGIN/..' ) @@ -133,19 +89,7 @@ thirdorder_fortran_src = files( 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) -thirdorder_fortran_lib = custom_target( - 'thirdorder_fortran_lib', - output: 'libthirdorder.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'thirdorder', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: thirdorder_fortran_src, - build_by_default: true -) + thirdorder_wrapper = custom_target( 'thirdorder_f2py_wrapper', input: thirdorder_fortran_src, @@ -156,37 +100,22 @@ thirdorder_wrapper = custom_target( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', - thirdorder_wrapper, - link_with: thirdorder_fortran_lib, + [thirdorder_wrapper, thirdorder_fortran_src], install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir), install_rpath: '$ORIGIN/..' ) # Extensión 'thermal_conductivity' -thermal_conductivity_fortran_src = files( +cond_fortran_src = files( 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) -thermal_conductivity_fortran_lib = custom_target( - 'thermal_conductivity_fortran_lib', - output: 'libthermal_conductivity.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'thermal_conductivity', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: thermal_conductivity_fortran_src, - build_by_default: true -) + cond_wrapper = custom_target( 'thermal_conductivity_f2py_wrapper', - input: thermal_conductivity_fortran_src, + input: cond_fortran_src, output: 'thermal_conductivity-f2pywrappers.c', command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], build_by_default: true @@ -194,14 +123,11 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', - cond_wrapper, - link_with: thermal_conductivity_fortran_lib, - install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, + [cond_wrapper, cond_fortran_src], dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir), link_args: ['-fopenmp'], + install: true, install_rpath: '$ORIGIN/..' ) @@ -247,7 +173,7 @@ python_installation.install_sources([ 'scripts/view_scf_atoms.py' ]) -# Set the tests by pytest. (Needs pytest installed) +# Set the tests by pytest. pytest_exe = find_program('pytest', required: false) if pytest_exe.found() diff --git a/meson.build.old4 b/meson.build.old4 new file mode 100644 index 00000000..9de107e2 --- /dev/null +++ b/meson.build.old4 @@ -0,0 +1,260 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +# quizás usar dependency('numpy'), por ahora funciona así porque Meson aún no ha implementado f2py desde dependency('numpy'), pero es recomendable usar dependency en general. + +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Define el directorio de compilación para fpm +fpm_build_dir = meson.project_build_root() / 'fpm_build' + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- +# Cada extensión ahora tiene su propio bloque de compilación, lo que es más robusto. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) +# Creamos las direcciones de numpy y fpm para ser usadas luego +numpy_inc = include_directories(numpy_incdir) +#fpm_inc = include_directories(fpm_build_dir / 'include') +#fpm_inc = include_directories('fpm_build/include') + +# Luego usa las variables en las extensiones +#include_dirs = [numpy_inc, fpm_inc] +# Ruta absoluta de includes generados +fpm_include_dir = meson.project_build_root() / 'fpm_build' / 'include' +# Argumentos para el compilador +cpp_inc_args = ['-I' + fpm_include_dir, '-I' + numpy_incdir] +fortran_inc_args = ['-I' + fpm_include_dir] +# Creamos un custom_target solo para la librería symph. +symph_fortran_lib = custom_target( + 'symph_fortran_lib', + output: 'libsymph.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'symph', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: symph_fortran_src, + build_by_default: true +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + link_with: symph_fortran_lib, + install: true, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) +secondorder_fortran_lib = custom_target( + 'secondorder_fortran_lib', + output: 'libsecondorder.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'secondorder', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: secondorder_fortran_src, + build_by_default: true +) +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + link_with: secondorder_fortran_lib, + install: true, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) +thirdorder_fortran_lib = custom_target( + 'thirdorder_fortran_lib', + output: 'libthirdorder.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'thirdorder', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: thirdorder_fortran_src, + build_by_default: true +) +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + link_with: thirdorder_fortran_lib, + install: true, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, + dependencies: [lapack_dep, blas_dep], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thermal_conductivity' +thermal_conductivity_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) +thermal_conductivity_fortran_lib = custom_target( + 'thermal_conductivity_fortran_lib', + output: 'libthermal_conductivity.a', + command: [ + fpm_exe, + 'install', + '--prefix', fpm_build_dir, + '--name', 'thermal_conductivity', + '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] + ], + input: thermal_conductivity_fortran_src, + build_by_default: true +) +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: thermal_conductivity_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + link_with: thermal_conductivity_fortran_lib, + install: true, + #include_directories: include_dirs, + cpp_args: cpp_inc_args, + fortran_args: fortran_inc_args, + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. (Needs pytest installed) +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 518c5316fb836d2c6f8be6ccfae3967c83d14794 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 10 Sep 2025 12:29:13 +0200 Subject: [PATCH 086/151] Setting the '-cpp' explicity to try to force the preprocessiing on FORTRAN sources. --- meson.build | 6 +- meson.build.old5 | 186 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 meson.build.old5 diff --git a/meson.build b/meson.build index afde0f79..3bb70569 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('CellConstructor', 'fortran', 'c', version: '1.5.0', license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] + default_options: ['fortran_args=-O2'] ) # --- System and Python Dependencies --- @@ -59,6 +59,7 @@ py_symph_ext = python_installation.extension_module( dependencies: [lapack_dep, blas_dep, openmp_dep], include_directories: include_directories(numpy_incdir), link_args: ['-fopenmp'], + fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -81,6 +82,7 @@ py_secondorder_ext = python_installation.extension_module( install: true, dependencies: [lapack_dep, blas_dep], include_directories: include_directories(numpy_incdir), + fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -104,6 +106,7 @@ py_thirdorder_ext = python_installation.extension_module( install: true, dependencies: [lapack_dep, blas_dep], include_directories: include_directories(numpy_incdir), + fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -127,6 +130,7 @@ py_cond_ext = python_installation.extension_module( dependencies: [lapack_dep, blas_dep, openmp_dep], include_directories: include_directories(numpy_incdir), link_args: ['-fopenmp'], + fortran_args: ['-cpp'], install: true, install_rpath: '$ORIGIN/..' ) diff --git a/meson.build.old5 b/meson.build.old5 new file mode 100644 index 00000000..afde0f79 --- /dev/null +++ b/meson.build.old5 @@ -0,0 +1,186 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir), + link_args: ['-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir), + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir), + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir), + link_args: ['-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 9f26c34dbb48bde7eb60723aab93064cb3db116a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 08:30:28 +0200 Subject: [PATCH 087/151] Separating the compilation of the Fortran code from the compilation of the C wrapper --- meson.build | 74 +++++++++++++----- meson.build.old6 | 190 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+), 19 deletions(-) create mode 100644 meson.build.old6 diff --git a/meson.build b/meson.build index 3bb70569..f2feac14 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,6 @@ numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true ).stdout().strip() -fpm_exe = find_program('fpm', required: true) f2py_exe = find_program('f2py', required: true) # Busca las librerías de sistema BLAS, LAPACK y OpenMP @@ -38,6 +37,17 @@ symph_fortran_src = files( 'FModules/get_equivalent_atoms.f90' ) +# Compila el código Fortran en una librería compartida. +symph_lib = shared_library( + 'symph_lib', + symph_fortran_src, + dependencies: [lapack_dep, blas_dep, openmp_dep], + fortran_args: ['-cpp', '-fopenmp'], + link_args: ['-fopenmp'], + install: false, # No la instalamos, solo se usa para el enlace. +) + +# Crea el wrapper de C. symph_wrapper = custom_target( 'symph_f2py_wrapper', input: symph_fortran_src, @@ -52,22 +62,31 @@ symph_wrapper = custom_target( build_by_default: true ) +# Crea el módulo de extensión de Python enlazando el wrapper y la librería. py_symph_ext = python_installation.extension_module( 'symph', - [symph_wrapper, symph_fortran_src], + symph_wrapper, + link_with: symph_lib, + dependencies: [numpy_incdir], install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir), - link_args: ['-fopenmp'], - fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) +--- + # Extensión 'secondorder' secondorder_fortran_src = files( 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) +secondorder_lib = shared_library( + 'secondorder_lib', + secondorder_fortran_src, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install: false, +) + secondorder_wrapper = custom_target( 'secondorder_f2py_wrapper', input: secondorder_fortran_src, @@ -78,20 +97,29 @@ secondorder_wrapper = custom_target( py_secondorder_ext = python_installation.extension_module( 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], + secondorder_wrapper, + link_with: secondorder_lib, + dependencies: [numpy_incdir], install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir), - fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) +--- + # Extensión 'thirdorder' thirdorder_fortran_src = files( 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) +thirdorder_lib = shared_library( + 'thirdorder_lib', + thirdorder_fortran_src, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install: false, +) + thirdorder_wrapper = custom_target( 'thirdorder_f2py_wrapper', input: thirdorder_fortran_src, @@ -102,20 +130,30 @@ thirdorder_wrapper = custom_target( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], + thirdorder_wrapper, + link_with: thirdorder_lib, + dependencies: [numpy_incdir], install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir), - fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) +--- + # Extensión 'thermal_conductivity' cond_fortran_src = files( 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) +cond_lib = shared_library( + 'cond_lib', + cond_fortran_src, + dependencies: [lapack_dep, blas_dep, openmp_dep], + fortran_args: ['-cpp', '-fopenmp'], + link_args: ['-fopenmp'], + install: false, +) + cond_wrapper = custom_target( 'thermal_conductivity_f2py_wrapper', input: cond_fortran_src, @@ -126,11 +164,9 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir), - link_args: ['-fopenmp'], - fortran_args: ['-cpp'], + cond_wrapper, + link_with: cond_lib, + dependencies: [numpy_incdir], install: true, install_rpath: '$ORIGIN/..' ) diff --git a/meson.build.old6 b/meson.build.old6 new file mode 100644 index 00000000..2bf7000a --- /dev/null +++ b/meson.build.old6 @@ -0,0 +1,190 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +#fpm_exe = find_program('fpm', required: true) +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir), + link_args: ['-fopenmp'], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir), + link_args: ['-fopenmp'], + fortran_args: ['-cpp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 830bd26ceaa04b0b5b5114653ae27290d3395ff7 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 08:53:25 +0200 Subject: [PATCH 088/151] Clear the 'dependencies' for now. --- meson.build | 13 ++- meson.build.old7 | 226 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+), 4 deletions(-) create mode 100644 meson.build.old7 diff --git a/meson.build b/meson.build index f2feac14..c8692bbf 100644 --- a/meson.build +++ b/meson.build @@ -67,7 +67,8 @@ py_symph_ext = python_installation.extension_module( 'symph', symph_wrapper, link_with: symph_lib, - dependencies: [numpy_incdir], + dependencies: [], + include_directories: include_directories(numpy_incdir), install: true, install_rpath: '$ORIGIN/..' ) @@ -99,7 +100,8 @@ py_secondorder_ext = python_installation.extension_module( 'secondorder', secondorder_wrapper, link_with: secondorder_lib, - dependencies: [numpy_incdir], + dependencies: [], + include_directories: include_directories(numpy_incdir), install: true, install_rpath: '$ORIGIN/..' ) @@ -132,7 +134,8 @@ py_thirdorder_ext = python_installation.extension_module( 'thirdorder', thirdorder_wrapper, link_with: thirdorder_lib, - dependencies: [numpy_incdir], + dependencies: [], + include_directories: include_directories(numpy_incdir), install: true, install_rpath: '$ORIGIN/..' ) @@ -166,7 +169,8 @@ py_cond_ext = python_installation.extension_module( 'thermal_conductivity', cond_wrapper, link_with: cond_lib, - dependencies: [numpy_incdir], + dependencies: [], + include_directories: include_directories(numpy_incdir), install: true, install_rpath: '$ORIGIN/..' ) @@ -183,6 +187,7 @@ cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, + dependencies: [], include_directories: include_directories(numpy_incdir), install: true, install_rpath: '$ORIGIN/..' diff --git a/meson.build.old7 b/meson.build.old7 new file mode 100644 index 00000000..f2feac14 --- /dev/null +++ b/meson.build.old7 @@ -0,0 +1,226 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +# Compila el código Fortran en una librería compartida. +symph_lib = shared_library( + 'symph_lib', + symph_fortran_src, + dependencies: [lapack_dep, blas_dep, openmp_dep], + fortran_args: ['-cpp', '-fopenmp'], + link_args: ['-fopenmp'], + install: false, # No la instalamos, solo se usa para el enlace. +) + +# Crea el wrapper de C. +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +# Crea el módulo de extensión de Python enlazando el wrapper y la librería. +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + link_with: symph_lib, + dependencies: [numpy_incdir], + install: true, + install_rpath: '$ORIGIN/..' +) + +--- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_lib = shared_library( + 'secondorder_lib', + secondorder_fortran_src, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install: false, +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + link_with: secondorder_lib, + dependencies: [numpy_incdir], + install: true, + install_rpath: '$ORIGIN/..' +) + +--- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_lib = shared_library( + 'thirdorder_lib', + thirdorder_fortran_src, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install: false, +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + link_with: thirdorder_lib, + dependencies: [numpy_incdir], + install: true, + install_rpath: '$ORIGIN/..' +) + +--- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_lib = shared_library( + 'cond_lib', + cond_fortran_src, + dependencies: [lapack_dep, blas_dep, openmp_dep], + fortran_args: ['-cpp', '-fopenmp'], + link_args: ['-fopenmp'], + install: false, +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + link_with: cond_lib, + dependencies: [numpy_incdir], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 14823e958627665c07cd5bd85caa44c26e376fb0 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 09:02:16 +0200 Subject: [PATCH 089/151] Fix small bug --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index c8692bbf..834f0dea 100644 --- a/meson.build +++ b/meson.build @@ -73,7 +73,7 @@ py_symph_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) ---- +# --- # Extensión 'secondorder' secondorder_fortran_src = files( @@ -106,7 +106,7 @@ py_secondorder_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) ---- +# --- # Extensión 'thirdorder' thirdorder_fortran_src = files( @@ -140,7 +140,7 @@ py_thirdorder_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) ---- +# --- # Extensión 'thermal_conductivity' cond_fortran_src = files( From f5ca36964093309296d7632f6884494bee2e168b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 09:17:35 +0200 Subject: [PATCH 090/151] A step back, and set include_directories (I think I'm going in circles). --- meson.build | 73 ++++----------- meson.build.old8 | 231 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 250 insertions(+), 54 deletions(-) create mode 100644 meson.build.old8 diff --git a/meson.build b/meson.build index 834f0dea..9eb52ad2 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,7 @@ blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) # --- Definición de cada extensión de Python (Fortran) --- +# Hemos vuelto a una estructura más simple y robusta. # Extensión 'symph' symph_fortran_src = files( @@ -37,17 +38,6 @@ symph_fortran_src = files( 'FModules/get_equivalent_atoms.f90' ) -# Compila el código Fortran en una librería compartida. -symph_lib = shared_library( - 'symph_lib', - symph_fortran_src, - dependencies: [lapack_dep, blas_dep, openmp_dep], - fortran_args: ['-cpp', '-fopenmp'], - link_args: ['-fopenmp'], - install: false, # No la instalamos, solo se usa para el enlace. -) - -# Crea el wrapper de C. symph_wrapper = custom_target( 'symph_f2py_wrapper', input: symph_fortran_src, @@ -62,14 +52,14 @@ symph_wrapper = custom_target( build_by_default: true ) -# Crea el módulo de extensión de Python enlazando el wrapper y la librería. py_symph_ext = python_installation.extension_module( 'symph', - symph_wrapper, - link_with: symph_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), + [symph_wrapper, symph_fortran_src], install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], install_rpath: '$ORIGIN/..' ) @@ -80,14 +70,6 @@ secondorder_fortran_src = files( 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) -secondorder_lib = shared_library( - 'secondorder_lib', - secondorder_fortran_src, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install: false, -) - secondorder_wrapper = custom_target( 'secondorder_f2py_wrapper', input: secondorder_fortran_src, @@ -98,11 +80,11 @@ secondorder_wrapper = custom_target( py_secondorder_ext = python_installation.extension_module( 'secondorder', - secondorder_wrapper, - link_with: secondorder_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), + [secondorder_wrapper, secondorder_fortran_src], install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -114,14 +96,6 @@ thirdorder_fortran_src = files( 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) -thirdorder_lib = shared_library( - 'thirdorder_lib', - thirdorder_fortran_src, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install: false, -) - thirdorder_wrapper = custom_target( 'thirdorder_f2py_wrapper', input: thirdorder_fortran_src, @@ -132,11 +106,11 @@ thirdorder_wrapper = custom_target( py_thirdorder_ext = python_installation.extension_module( 'thirdorder', - thirdorder_wrapper, - link_with: thirdorder_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), + [thirdorder_wrapper, thirdorder_fortran_src], install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -148,15 +122,6 @@ cond_fortran_src = files( 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) -cond_lib = shared_library( - 'cond_lib', - cond_fortran_src, - dependencies: [lapack_dep, blas_dep, openmp_dep], - fortran_args: ['-cpp', '-fopenmp'], - link_args: ['-fopenmp'], - install: false, -) - cond_wrapper = custom_target( 'thermal_conductivity_f2py_wrapper', input: cond_fortran_src, @@ -167,10 +132,11 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', - cond_wrapper, - link_with: cond_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], install: true, install_rpath: '$ORIGIN/..' ) @@ -187,7 +153,6 @@ cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, - dependencies: [], include_directories: include_directories(numpy_incdir), install: true, install_rpath: '$ORIGIN/..' diff --git a/meson.build.old8 b/meson.build.old8 new file mode 100644 index 00000000..834f0dea --- /dev/null +++ b/meson.build.old8 @@ -0,0 +1,231 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +# Compila el código Fortran en una librería compartida. +symph_lib = shared_library( + 'symph_lib', + symph_fortran_src, + dependencies: [lapack_dep, blas_dep, openmp_dep], + fortran_args: ['-cpp', '-fopenmp'], + link_args: ['-fopenmp'], + install: false, # No la instalamos, solo se usa para el enlace. +) + +# Crea el wrapper de C. +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +# Crea el módulo de extensión de Python enlazando el wrapper y la librería. +py_symph_ext = python_installation.extension_module( + 'symph', + symph_wrapper, + link_with: symph_lib, + dependencies: [], + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_lib = shared_library( + 'secondorder_lib', + secondorder_fortran_src, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install: false, +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + secondorder_wrapper, + link_with: secondorder_lib, + dependencies: [], + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_lib = shared_library( + 'thirdorder_lib', + thirdorder_fortran_src, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install: false, +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + thirdorder_wrapper, + link_with: thirdorder_lib, + dependencies: [], + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_lib = shared_library( + 'cond_lib', + cond_fortran_src, + dependencies: [lapack_dep, blas_dep, openmp_dep], + fortran_args: ['-cpp', '-fopenmp'], + link_args: ['-fopenmp'], + install: false, +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + cond_wrapper, + link_with: cond_lib, + dependencies: [], + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + dependencies: [], + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 25f652c84e72e6a541b7e0c2a8024a36e091422d Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 09:40:00 +0200 Subject: [PATCH 091/151] OK lets test using the '.' directory. --- meson.build | 8 +- meson.build.old9 | 196 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+), 4 deletions(-) create mode 100644 meson.build.old9 diff --git a/meson.build b/meson.build index 9eb52ad2..2b44aada 100644 --- a/meson.build +++ b/meson.build @@ -57,7 +57,7 @@ py_symph_ext = python_installation.extension_module( [symph_wrapper, symph_fortran_src], install: true, dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + include_directories: include_directories(numpy_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install_rpath: '$ORIGIN/..' @@ -83,7 +83,7 @@ py_secondorder_ext = python_installation.extension_module( [secondorder_wrapper, secondorder_fortran_src], install: true, dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + include_directories: include_directories(numpy_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -109,7 +109,7 @@ py_thirdorder_ext = python_installation.extension_module( [thirdorder_wrapper, thirdorder_fortran_src], install: true, dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + include_directories: include_directories(numpy_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -134,7 +134,7 @@ py_cond_ext = python_installation.extension_module( 'thermal_conductivity', [cond_wrapper, cond_fortran_src], dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + include_directories: include_directories(numpy_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install: true, diff --git a/meson.build.old9 b/meson.build.old9 new file mode 100644 index 00000000..9eb52ad2 --- /dev/null +++ b/meson.build.old9 @@ -0,0 +1,196 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- +# Hemos vuelto a una estructura más simple y robusta. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, meson.current_build_dir()), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 4e66e22de64cdd231d717b185cc7ebfacd17b430 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 09:51:53 +0200 Subject: [PATCH 092/151] Just renaming the files to help meson find the files. --- meson.build | 8 +- meson.build.old10 | 196 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+), 4 deletions(-) create mode 100644 meson.build.old10 diff --git a/meson.build b/meson.build index 2b44aada..881ef67b 100644 --- a/meson.build +++ b/meson.build @@ -41,7 +41,7 @@ symph_fortran_src = files( symph_wrapper = custom_target( 'symph_f2py_wrapper', input: symph_fortran_src, - output: 'symph-f2pywrappers.c', + output: 'symphmodule.c', command: [ f2py_exe, '-m', 'symph', @@ -73,7 +73,7 @@ secondorder_fortran_src = files( secondorder_wrapper = custom_target( 'secondorder_f2py_wrapper', input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', + output: 'secondordermodule.c', command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) @@ -99,7 +99,7 @@ thirdorder_fortran_src = files( thirdorder_wrapper = custom_target( 'thirdorder_f2py_wrapper', input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', + output: 'thirdordermodule.c', command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) @@ -125,7 +125,7 @@ cond_fortran_src = files( cond_wrapper = custom_target( 'thermal_conductivity_f2py_wrapper', input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', + output: 'thermal_conductivitymodule.c', command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) diff --git a/meson.build.old10 b/meson.build.old10 new file mode 100644 index 00000000..2b44aada --- /dev/null +++ b/meson.build.old10 @@ -0,0 +1,196 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- +# Hemos vuelto a una estructura más simple y robusta. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symph-f2pywrappers.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, '.'), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, '.'), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdorder-f2pywrappers.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, '.'), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivity-f2pywrappers.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, '.'), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 9c2128b481911774dbf29deff1bd25a1382c4250 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 10:07:57 +0200 Subject: [PATCH 093/151] Set the anidated compilation headers --- meson.build | 15 +++- meson.build.old11 | 196 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+), 4 deletions(-) create mode 100644 meson.build.old11 diff --git a/meson.build b/meson.build index 881ef67b..33581111 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,13 @@ numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true ).stdout().strip() + +# Obtenemos la ruta padre para incluir los headers de numpy anidados +numpy_parent_incdir = run_command( + python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', + check: true +).stdout().strip() + f2py_exe = find_program('f2py', required: true) # Busca las librerías de sistema BLAS, LAPACK y OpenMP @@ -57,7 +64,7 @@ py_symph_ext = python_installation.extension_module( [symph_wrapper, symph_fortran_src], install: true, dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, '.'), + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install_rpath: '$ORIGIN/..' @@ -83,7 +90,7 @@ py_secondorder_ext = python_installation.extension_module( [secondorder_wrapper, secondorder_fortran_src], install: true, dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, '.'), + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -109,7 +116,7 @@ py_thirdorder_ext = python_installation.extension_module( [thirdorder_wrapper, thirdorder_fortran_src], install: true, dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, '.'), + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -134,7 +141,7 @@ py_cond_ext = python_installation.extension_module( 'thermal_conductivity', [cond_wrapper, cond_fortran_src], dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, '.'), + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install: true, diff --git a/meson.build.old11 b/meson.build.old11 new file mode 100644 index 00000000..881ef67b --- /dev/null +++ b/meson.build.old11 @@ -0,0 +1,196 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- +# Hemos vuelto a una estructura más simple y robusta. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, '.'), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, '.'), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdordermodule.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, '.'), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivitymodule.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, '.'), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From c03fdcd6ce840138c749b13c9b61a2b4d6fa188a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 10:20:07 +0200 Subject: [PATCH 094/151] A simple fix? --- meson.build | 8 +- meson.build.old12 | 203 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+), 4 deletions(-) create mode 100644 meson.build.old12 diff --git a/meson.build b/meson.build index 33581111..3cd84f9b 100644 --- a/meson.build +++ b/meson.build @@ -70,7 +70,7 @@ py_symph_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) -# --- +--- # Extensión 'secondorder' secondorder_fortran_src = files( @@ -95,7 +95,7 @@ py_secondorder_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) -# --- +--- # Extensión 'thirdorder' thirdorder_fortran_src = files( @@ -121,7 +121,7 @@ py_thirdorder_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) -# --- +--- # Extensión 'thermal_conductivity' cond_fortran_src = files( @@ -160,7 +160,7 @@ cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, - include_directories: include_directories(numpy_incdir), + include_directories: include_directories(numpy_incdir, numpy_parent_incdir), install: true, install_rpath: '$ORIGIN/..' ) diff --git a/meson.build.old12 b/meson.build.old12 new file mode 100644 index 00000000..33581111 --- /dev/null +++ b/meson.build.old12 @@ -0,0 +1,203 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +# Obtenemos la ruta padre para incluir los headers de numpy anidados +numpy_parent_incdir = run_command( + python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', + check: true +).stdout().strip() + +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- +# Hemos vuelto a una estructura más simple y robusta. + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdordermodule.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + dependencies: [lapack_dep, blas_dep], + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivitymodule.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + dependencies: [lapack_dep, blas_dep, openmp_dep], + include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir), + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From bf4a56ef3c06f94a82ebcfc5a4869a08e8d97db4 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 10:22:21 +0200 Subject: [PATCH 095/151] QuickFix --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 3cd84f9b..283b8be8 100644 --- a/meson.build +++ b/meson.build @@ -70,7 +70,7 @@ py_symph_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) ---- +# --- # Extensión 'secondorder' secondorder_fortran_src = files( @@ -95,7 +95,7 @@ py_secondorder_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) ---- +# --- # Extensión 'thirdorder' thirdorder_fortran_src = files( @@ -121,7 +121,7 @@ py_thirdorder_ext = python_installation.extension_module( install_rpath: '$ORIGIN/..' ) ---- +# --- # Extensión 'thermal_conductivity' cond_fortran_src = files( From f04a16c19b2e797fa2b96d7d7c4208d35814c8ee Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 11:18:10 +0200 Subject: [PATCH 096/151] Include directories to have the numpy libs at hand --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 283b8be8..9df8fa6e 100644 --- a/meson.build +++ b/meson.build @@ -18,6 +18,8 @@ numpy_parent_incdir = run_command( check: true ).stdout().strip() +include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, '.') + f2py_exe = find_program('f2py', required: true) # Busca las librerías de sistema BLAS, LAPACK y OpenMP @@ -63,6 +65,7 @@ py_symph_ext = python_installation.extension_module( 'symph', [symph_wrapper, symph_fortran_src], install: true, + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep], include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], @@ -89,6 +92,7 @@ py_secondorder_ext = python_installation.extension_module( 'secondorder', [secondorder_wrapper, secondorder_fortran_src], install: true, + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep], include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], @@ -115,6 +119,7 @@ py_thirdorder_ext = python_installation.extension_module( 'thirdorder', [thirdorder_wrapper, thirdorder_fortran_src], install: true, + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep], include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], @@ -140,6 +145,7 @@ cond_wrapper = custom_target( py_cond_ext = python_installation.extension_module( 'thermal_conductivity', [cond_wrapper, cond_fortran_src], + include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep], include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], From 1232b9764fc78a23d5ee0f6765a586b500d6929b Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 12:14:23 +0200 Subject: [PATCH 097/151] Update, now the problem is with nupmpy? --- meson.build | 8 ++-- test.meson.build | 115 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 test.meson.build diff --git a/meson.build b/meson.build index 9df8fa6e..4b3499d9 100644 --- a/meson.build +++ b/meson.build @@ -67,7 +67,7 @@ py_symph_ext = python_installation.extension_module( install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install_rpath: '$ORIGIN/..' @@ -94,7 +94,7 @@ py_secondorder_ext = python_installation.extension_module( install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -121,7 +121,7 @@ py_thirdorder_ext = python_installation.extension_module( install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -147,7 +147,7 @@ py_cond_ext = python_installation.extension_module( [cond_wrapper, cond_fortran_src], include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install: true, diff --git a/test.meson.build b/test.meson.build new file mode 100644 index 00000000..5ea2938c --- /dev/null +++ b/test.meson.build @@ -0,0 +1,115 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() + +# Obtener ruta común de includes: numpy.get_include() y su padre para fortranobject.h +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +numpy_parent_incdir = run_command( + python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', + check: true +).stdout().strip() + +f2py_exe = find_program('f2py', required: true) + +# Dependencias de sistema +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de extensiones Python (Fortran) --- + +# Ejemplo para la extensión symph +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +# Define los includes agrupados con ambos directorios +numpy_includes = include_directories(numpy_incdir, numpy_parent_incdir, '.') + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + include_directories: numpy_includes, + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# Repite patrón análogo para las demás extensiones ... + +# Ejemplo para la extensión secondorder +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + include_directories: numpy_includes, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# (Y así sucesivamente para thirdorder y thermal_conductivity...) + +# --- Definición de la extensión C 'cc_linalg' --- + +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) + +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: numpy_includes, + install: true, + install_rpath: '$ORIGIN/..' +) + +# Luego continúa la sección de install_data y tests según tus necesidades From 314b08bc38d1cde0f2da5b50d0c2044b8f307bc2 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 11 Sep 2025 13:14:09 +0200 Subject: [PATCH 098/151] Include f2py directory --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 4b3499d9..9d7fc900 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,13 @@ numpy_parent_incdir = run_command( check: true ).stdout().strip() -include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, '.') +# Obtenemos la ruta específica para los headers de f2py +f2py_incdir = run_command( + python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', + check: true +).stdout().strip() + +include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') f2py_exe = find_program('f2py', required: true) From 4794d6d80d226da41cf41fd8f0fcabedc62728e2 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 12 Sep 2025 08:15:37 +0200 Subject: [PATCH 099/151] Adding python dependency --- meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 9d7fc900..583acd0e 100644 --- a/meson.build +++ b/meson.build @@ -7,6 +7,8 @@ project('CellConstructor', 'fortran', 'c', # --- System and Python Dependencies --- python = import('python') python_installation = python.find_installation() +py_dep = dependency('python3', required: true) + numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true @@ -72,7 +74,7 @@ py_symph_ext = python_installation.extension_module( [symph_wrapper, symph_fortran_src], install: true, include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep], + dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], @@ -99,7 +101,7 @@ py_secondorder_ext = python_installation.extension_module( [secondorder_wrapper, secondorder_fortran_src], install: true, include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep], + dependencies: [lapack_dep, blas_dep, py_dep], #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' @@ -126,7 +128,7 @@ py_thirdorder_ext = python_installation.extension_module( [thirdorder_wrapper, thirdorder_fortran_src], install: true, include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep], + dependencies: [lapack_dep, blas_dep, py_dep], #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' @@ -152,7 +154,7 @@ py_cond_ext = python_installation.extension_module( 'thermal_conductivity', [cond_wrapper, cond_fortran_src], include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep], + dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], From d2d4cf1fcddd6d86cf658d1a310a6adf7c87d8ba Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 12 Sep 2025 09:22:55 +0200 Subject: [PATCH 100/151] Now it compiles but gives a problem when importing symph on python (but not cc_linalg) --- meson.build | 20 +++- test.meson.build | 213 ++++++++++++++++++++++++++++++---------- test_old.meson.build | 115 ++++++++++++++++++++++ test_old3.meson.build | 222 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 511 insertions(+), 59 deletions(-) create mode 100644 test_old.meson.build create mode 100644 test_old3.meson.build diff --git a/meson.build b/meson.build index 583acd0e..287b3f7d 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,7 @@ python = import('python') python_installation = python.find_installation() py_dep = dependency('python3', required: true) +# Obtenemos la ruta principal de los headers de numpy numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true @@ -26,8 +27,17 @@ f2py_incdir = run_command( check: true ).stdout().strip() +# Creamos una lista de directorios de inclusión para usar en todas las extensiones include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') +# Obtenemos la ruta de la biblioteca de f2py para la vinculación +f2py_libdir = run_command( + python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(os.path.dirname(numpy.f2py.__file__)), "core", "lib"))', + check: true +).stdout().strip() +# Obtenemos la ruta del directorio de bibliotecas de Python +py_libdir = python_installation.get_install_dir() / 'lib' + f2py_exe = find_program('f2py', required: true) # Busca las librerías de sistema BLAS, LAPACK y OpenMP @@ -36,7 +46,6 @@ blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) # --- Definición de cada extensión de Python (Fortran) --- -# Hemos vuelto a una estructura más simple y robusta. # Extensión 'symph' symph_fortran_src = files( @@ -75,8 +84,8 @@ py_symph_ext = python_installation.extension_module( install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], + #link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], fortran_args: ['-cpp', '-fopenmp'], install_rpath: '$ORIGIN/..' ) @@ -102,7 +111,7 @@ py_secondorder_ext = python_installation.extension_module( install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, py_dep], - #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + #link_args: ['-L' + py_libdir, '-lnpy-c-api'], fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -129,7 +138,7 @@ py_thirdorder_ext = python_installation.extension_module( install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, py_dep], - #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), + #link_args: ['-L' + py_libdir, '-lnpy-c-api'], fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -155,8 +164,8 @@ py_cond_ext = python_installation.extension_module( [cond_wrapper, cond_fortran_src], include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - #include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), link_args: ['-fopenmp'], + #link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], fortran_args: ['-cpp', '-fopenmp'], install: true, install_rpath: '$ORIGIN/..' @@ -176,6 +185,7 @@ py_cc_linalg_ext = python_installation.extension_module( cc_modules_sources, include_directories: include_directories(numpy_incdir, numpy_parent_incdir), install: true, + dependencies: [py_dep], install_rpath: '$ORIGIN/..' ) diff --git a/test.meson.build b/test.meson.build index 5ea2938c..c8c73b50 100644 --- a/test.meson.build +++ b/test.meson.build @@ -1,100 +1,170 @@ project('CellConstructor', 'fortran', 'c', version: '1.5.0', license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] + default_options: ['fortran_args=-O2'] ) # --- System and Python Dependencies --- python = import('python') python_installation = python.find_installation() +py_dep = dependency('python3', required: true) -# Obtener ruta común de includes: numpy.get_include() y su padre para fortranobject.h +# Obtenemos la ruta principal de los headers de numpy numpy_incdir = run_command( python_installation, '-c', 'import numpy; print(numpy.get_include())', check: true ).stdout().strip() +# Obtenemos la ruta padre para incluir los headers de numpy anidados numpy_parent_incdir = run_command( python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', check: true ).stdout().strip() +# Obtenemos la ruta específica para los headers de f2py +f2py_incdir = run_command( + python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', + check: true +).stdout().strip() + +# Creamos una lista de directorios de inclusión para usar en todas las extensiones +include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') + +# Obtenemos la ruta del directorio de bibliotecas de Python +py_libdir = python_installation.get_install_dir() / 'lib' + f2py_exe = find_program('f2py', required: true) -# Dependencias de sistema +# Busca las librerías de sistema BLAS, LAPACK y OpenMP lapack_dep = dependency('lapack', required: true) blas_dep = dependency('blas', required: true) openmp_dep = dependency('openmp', required: true) -# --- Definición de extensiones Python (Fortran) --- +# --- Definición de cada extensión de Python (Fortran) --- -# Ejemplo para la extensión symph +# Extensión 'symph' symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' ) symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true ) -# Define los includes agrupados con ambos directorios -numpy_includes = include_directories(numpy_incdir, numpy_parent_incdir, '.') - py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - include_directories: numpy_includes, - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], + link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' ) -# Repite patrón análogo para las demás extensiones ... +# --- -# Ejemplo para la extensión secondorder +# Extensión 'secondorder' secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) + secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true ) py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - include_directories: numpy_includes, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, py_dep], + link_args: ['-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' ) -# (Y así sucesivamente para thirdorder y thermal_conductivity...) +# --- -# --- Definición de la extensión C 'cc_linalg' --- +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdordermodule.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, py_dep], + link_args: ['-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivitymodule.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], + link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) +# --- Definición de la extensión C 'cc_linalg' --- wrapper_file = '' if python_installation.version().version_compare('<3.0') wrapper_file = 'CModules/wrapper.c' @@ -103,13 +173,48 @@ else endif cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) - py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, - include_directories: numpy_includes, + include_directories: include_directories(numpy_incdir, numpy_parent_incdir), install: true, + dependencies: [py_dep], install_rpath: '$ORIGIN/..' ) -# Luego continúa la sección de install_data y tests según tus necesidades +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif diff --git a/test_old.meson.build b/test_old.meson.build new file mode 100644 index 00000000..5ea2938c --- /dev/null +++ b/test_old.meson.build @@ -0,0 +1,115 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() + +# Obtener ruta común de includes: numpy.get_include() y su padre para fortranobject.h +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +numpy_parent_incdir = run_command( + python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', + check: true +).stdout().strip() + +f2py_exe = find_program('f2py', required: true) + +# Dependencias de sistema +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de extensiones Python (Fortran) --- + +# Ejemplo para la extensión symph +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +# Define los includes agrupados con ambos directorios +numpy_includes = include_directories(numpy_incdir, numpy_parent_incdir, '.') + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + include_directories: numpy_includes, + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# Repite patrón análogo para las demás extensiones ... + +# Ejemplo para la extensión secondorder +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + include_directories: numpy_includes, + dependencies: [lapack_dep, blas_dep], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# (Y así sucesivamente para thirdorder y thermal_conductivity...) + +# --- Definición de la extensión C 'cc_linalg' --- + +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) + +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: numpy_includes, + install: true, + install_rpath: '$ORIGIN/..' +) + +# Luego continúa la sección de install_data y tests según tus necesidades diff --git a/test_old3.meson.build b/test_old3.meson.build new file mode 100644 index 00000000..60a333bd --- /dev/null +++ b/test_old3.meson.build @@ -0,0 +1,222 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() + +# Obtenemos la ruta principal de los headers de numpy +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +# Obtenemos la ruta padre para incluir los headers de numpy anidados +numpy_parent_incdir = run_command( + python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', + check: true +).stdout().strip() + +# Obtenemos la ruta específica para los headers de f2py +f2py_incdir = run_command( + python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', + check: true +).stdout().strip() + +# Creamos una lista de directorios de inclusión para usar en todas las extensiones +include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') + +# Obtenemos la ruta de la biblioteca de f2py para la vinculación +f2py_libdir = run_command( + python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(os.path.dirname(numpy.f2py.__file__)), "core", "lib"))', + check: true +).stdout().strip() + +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp', '-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep], + link_args: ['-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdordermodule.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep], + link_args: ['-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivitymodule.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, openmp_dep], + link_args: ['-fopenmp', '-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_dirs, + install: true, + link_args: ['-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources( + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 4000585f9cab55449c4a9ecabdba96082b5aa059 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 12 Sep 2025 15:38:33 +0200 Subject: [PATCH 101/151] Added some files to work later with meson --- meson.build.secondorder | 57 ++++++++ meson.build.thermal_conductivity | 59 +++++++++ meson.build.thirdorder | 61 +++++++++ meson.build_symph | 89 +++++++++++++ test.meson.build | 99 +++++++------- test_old4.meson.build | 220 +++++++++++++++++++++++++++++++ 6 files changed, 540 insertions(+), 45 deletions(-) create mode 100644 meson.build.secondorder create mode 100644 meson.build.thermal_conductivity create mode 100644 meson.build.thirdorder create mode 100644 meson.build_symph create mode 100644 test_old4.meson.build diff --git a/meson.build.secondorder b/meson.build.secondorder new file mode 100644 index 00000000..a4e459d9 --- /dev/null +++ b/meson.build.secondorder @@ -0,0 +1,57 @@ +project('secondorder', + ['c', 'fortran'], + version : '0.1', + meson_version: '>= 1.1.0', + default_options : [ + 'warning_level=1', + 'buildtype=release' + ]) +fc = meson.get_compiler('fortran') + +py = import('python').find_installation(pure: false) +py_dep = py.dependency() + +incdir_numpy = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +incdir_f2py = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy) +np_dep = declare_dependency(include_directories: inc_np) + +incdir_f2py = incdir_numpy / '..' / '..' / 'f2py' / 'src' +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# gh-25000 +quadmath_dep = fc.find_library('quadmath', required: false) + + + + +py.extension_module('secondorder', + [ + 'second_order_centering.f90', + 'second_order_ASR.f90', + 'secondordermodule.c', + 'secondorder-f2pywrappers2.f90', + fortranobject_c + ], + include_directories: [ + inc_np, + + ], + dependencies : [ + py_dep, + quadmath_dep, + dependency('mpi') + + + ], + install : true) diff --git a/meson.build.thermal_conductivity b/meson.build.thermal_conductivity new file mode 100644 index 00000000..c2ca694c --- /dev/null +++ b/meson.build.thermal_conductivity @@ -0,0 +1,59 @@ +project('thermal_conductivity', + ['c', 'fortran'], + version : '0.1', + meson_version: '>= 1.1.0', + default_options : [ + 'warning_level=1', + 'buildtype=release' + ]) +fc = meson.get_compiler('fortran') + +py = import('python').find_installation(pure: false) +py_dep = py.dependency() + +incdir_numpy = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +incdir_f2py = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy) +np_dep = declare_dependency(include_directories: inc_np) + +incdir_f2py = incdir_numpy / '..' / '..' / 'f2py' / 'src' +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# gh-25000 +quadmath_dep = fc.find_library('quadmath', required: false) + + + + +py.extension_module('thermal_conductivity', + [ + 'get_lf.f90', + 'get_scattering_q_grid.f90', + 'third_order_centering.f90', + 'third_order_cond.f90', + 'thermal_conductivitymodule.c', + 'thermal_conductivity-f2pywrappers2.f90', + fortranobject_c + ], + include_directories: [ + inc_np, + + ], + dependencies : [ + py_dep, + quadmath_dep, + dependency('mpi') + + + ], + install : true) diff --git a/meson.build.thirdorder b/meson.build.thirdorder new file mode 100644 index 00000000..fd59806b --- /dev/null +++ b/meson.build.thirdorder @@ -0,0 +1,61 @@ +project('thirdorder', + ['c', 'fortran'], + version : '0.1', + meson_version: '>= 1.1.0', + default_options : [ + 'warning_level=1', + 'buildtype=release' + ]) +fc = meson.get_compiler('fortran') + +py = import('python').find_installation(pure: false) +py_dep = py.dependency() + +incdir_numpy = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +incdir_f2py = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy) +np_dep = declare_dependency(include_directories: inc_np) + +incdir_f2py = incdir_numpy / '..' / '..' / 'f2py' / 'src' +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# gh-25000 +quadmath_dep = fc.find_library('quadmath', required: false) + + + + +py.extension_module('thirdorder', + [ + 'third_order_ASR.f90', + 'third_order_centering.f90', + 'third_order_cond_centering.f90', + 'third_order_cond.f90', + 'third_order_dynbubble.f90', + 'third_order_interpol.f90', + 'thirdordermodule.c', + 'thirdorder-f2pywrappers2.f90', + fortranobject_c + ], + include_directories: [ + inc_np, + + ], + dependencies : [ + py_dep, + quadmath_dep, + dependency('mpi') + + + ], + install : true) diff --git a/meson.build_symph b/meson.build_symph new file mode 100644 index 00000000..7a927dd8 --- /dev/null +++ b/meson.build_symph @@ -0,0 +1,89 @@ +project('symph', + ['c', 'fortran'], + version : '0.1', + meson_version: '>= 1.1.0', + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', 'fortran_args=-cpp']) +fc = meson.get_compiler('fortran') + +py = import('python').find_installation(pure: false) +py_dep = py.dependency() + +incdir_numpy = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +incdir_f2py = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy) +np_dep = declare_dependency(include_directories: inc_np) + +incdir_f2py = incdir_numpy / '..' / '..' / 'f2py' / 'src' +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# gh-25000 +quadmath_dep = fc.find_library('quadmath', required: false) + + + + +py.extension_module('symph', + [ + 'constants.f90', + 'error_handler.f90', + 'get_latvec.f90', + 'io_global.f90', + 'rotate_and_add_dyn.f90', + 'smallgq.f90', + 'symm_matrix.f90', + 'contract_two_phonon_propagator.f90', + 'fc_supercell_from_dyn.f90', + 'get_q_grid_fast.f90', + 'kind.f90', + 'star_q.f90', + 'symvector.f90', + 'cryst_to_car.f90', + 'flush_unit.f90', + 'get_translations.f90', + 'q2qstar_out.f90', + 'set_asr.f90', + 'symdynph_gq_new.f90', + 'trntnsc.f90', + 'eff_charge_interp.f90', + 'from_matdyn.f90', + 'interp.f90', + 'q_gen.f90', + 'set_tau.f90', + 'symm_base.f90', + 'unwrap_tensors.f90', + 'eqvect.f90', + 'get_equivalent_atoms.f90', + 'invmat.f90', + 'recips.f90', + 'sgam_ph.f90', + 'symmetry_high_rank.f90', + 'symphmodule.c', + 'symph-f2pywrappers2.f90', + 'symph-f2pywrappers.f', + fortranobject_c + ], + include_directories: [ + inc_np, + + ], + dependencies : [ + py_dep, + quadmath_dep, + dependency('mpi') + + + ], + install : true) diff --git a/test.meson.build b/test.meson.build index c8c73b50..49ebab8f 100644 --- a/test.meson.build +++ b/test.meson.build @@ -1,37 +1,41 @@ -project('CellConstructor', 'fortran', 'c', +project('CellConstructor', ['c', 'fortran'], version: '1.5.0', license: 'GPL', - default_options: ['fortran_args=-O2'] + default_options: ['fortran_args=-O2', 'warning_level=1', 'buildtype=release'] ) +fc = meson.get_compiler('fortran') -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -py_dep = dependency('python3', required: true) +# --- Dependencias del sistema y de Python --- +python = import('python').find_installation(pure: false) +#python_installation = python.find_installation() +py_dep = python.dependency() # Usamos la dependencia de Meson para obtener rutas automáticamente -# Obtenemos la ruta principal de los headers de numpy +# Obtenemos las rutas de los headers de numpy y f2py numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', + #python_installation, '-c', 'import numpy; print(numpy.get_include())', + python, + ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], check: true ).stdout().strip() - -# Obtenemos la ruta padre para incluir los headers de numpy anidados -numpy_parent_incdir = run_command( - python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', - check: true -).stdout().strip() - -# Obtenemos la ruta específica para los headers de f2py f2py_incdir = run_command( - python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', + #python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', + python, + ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], check: true ).stdout().strip() -# Creamos una lista de directorios de inclusión para usar en todas las extensiones -include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') +# El archivo de la API de f2py que contiene la definición de PyFortran_Type +fortranobject_c = f2py_incdir / 'fortranobject.c' -# Obtenemos la ruta del directorio de bibliotecas de Python -py_libdir = python_installation.get_install_dir() / 'lib' +# Creamos una lista de directorios de inclusión +include_dirs = include_directories(numpy_incdir, f2py_incdir) +np_dep = declare_dependency(include_directories: numpy_incdir) +incdir_f2py = numpy_incdir / '..' / '..' / 'f2py' / 'src' +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' +inc_np = include_directories(numpy_incdir, incdir_f2py) +# gh-25000 +quadmath_dep = fc.find_library('quadmath', required: false) f2py_exe = find_program('f2py', required: true) @@ -42,6 +46,27 @@ openmp_dep = dependency('openmp', required: true) # --- Definición de cada extensión de Python (Fortran) --- +#py.extension_module('invmat', +# [ +# 'invmat.f90', +# 'invmatmodule.c', +# 'invmat-f2pywrappers.f', +# fortranobject_c +# ], +# include_directories: [ +# inc_np, +# +# ], +# dependencies : [ +# py_dep, +# quadmath_dep, +# dependency('mpi') +# +# +# ], +# install : true) + + # Extensión 'symph' symph_fortran_src = files( 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', @@ -58,28 +83,20 @@ symph_fortran_src = files( 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' ) - symph_wrapper = custom_target( 'symph_f2py_wrapper', input: symph_fortran_src, output: 'symphmodule.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], + command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) - py_symph_ext = python_installation.extension_module( 'symph', - [symph_wrapper, symph_fortran_src], + [symph_wrapper, symph_fortran_src, fortranobject_c], install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], + link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install_rpath: '$ORIGIN/..' ) @@ -90,7 +107,6 @@ py_symph_ext = python_installation.extension_module( secondorder_fortran_src = files( 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ) - secondorder_wrapper = custom_target( 'secondorder_f2py_wrapper', input: secondorder_fortran_src, @@ -98,14 +114,12 @@ secondorder_wrapper = custom_target( command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) - py_secondorder_ext = python_installation.extension_module( 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], + [secondorder_wrapper, secondorder_fortran_src, fortranobject_c], install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, py_dep], - link_args: ['-L' + py_libdir, '-lnpy-c-api'], fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -117,7 +131,6 @@ thirdorder_fortran_src = files( 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' ) - thirdorder_wrapper = custom_target( 'thirdorder_f2py_wrapper', input: thirdorder_fortran_src, @@ -125,14 +138,12 @@ thirdorder_wrapper = custom_target( command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) - py_thirdorder_ext = python_installation.extension_module( 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], + [thirdorder_wrapper, thirdorder_fortran_src, fortranobject_c], install: true, include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, py_dep], - link_args: ['-L' + py_libdir, '-lnpy-c-api'], fortran_args: ['-cpp'], install_rpath: '$ORIGIN/..' ) @@ -144,7 +155,6 @@ cond_fortran_src = files( 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' ) - cond_wrapper = custom_target( 'thermal_conductivity_f2py_wrapper', input: cond_fortran_src, @@ -152,13 +162,12 @@ cond_wrapper = custom_target( command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], build_by_default: true ) - py_cond_ext = python_installation.extension_module( 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], + [cond_wrapper, cond_fortran_src, fortranobject_c], include_directories: include_dirs, dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], + link_args: ['-fopenmp'], fortran_args: ['-cpp', '-fopenmp'], install: true, install_rpath: '$ORIGIN/..' @@ -176,7 +185,7 @@ cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) py_cc_linalg_ext = python_installation.extension_module( 'cc_linalg', cc_modules_sources, - include_directories: include_directories(numpy_incdir, numpy_parent_incdir), + include_directories: include_directories(numpy_incdir, f2py_incdir), install: true, dependencies: [py_dep], install_rpath: '$ORIGIN/..' diff --git a/test_old4.meson.build b/test_old4.meson.build new file mode 100644 index 00000000..c8c73b50 --- /dev/null +++ b/test_old4.meson.build @@ -0,0 +1,220 @@ +project('CellConstructor', 'fortran', 'c', + version: '1.5.0', + license: 'GPL', + default_options: ['fortran_args=-O2'] +) + +# --- System and Python Dependencies --- +python = import('python') +python_installation = python.find_installation() +py_dep = dependency('python3', required: true) + +# Obtenemos la ruta principal de los headers de numpy +numpy_incdir = run_command( + python_installation, '-c', 'import numpy; print(numpy.get_include())', + check: true +).stdout().strip() + +# Obtenemos la ruta padre para incluir los headers de numpy anidados +numpy_parent_incdir = run_command( + python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', + check: true +).stdout().strip() + +# Obtenemos la ruta específica para los headers de f2py +f2py_incdir = run_command( + python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', + check: true +).stdout().strip() + +# Creamos una lista de directorios de inclusión para usar en todas las extensiones +include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') + +# Obtenemos la ruta del directorio de bibliotecas de Python +py_libdir = python_installation.get_install_dir() / 'lib' + +f2py_exe = find_program('f2py', required: true) + +# Busca las librerías de sistema BLAS, LAPACK y OpenMP +lapack_dep = dependency('lapack', required: true) +blas_dep = dependency('blas', required: true) +openmp_dep = dependency('openmp', required: true) + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' +symph_fortran_src = files( + 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', + 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', + 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', + 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', + 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', + 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', + 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', + 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', + 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', + 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', + 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', + 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', + 'FModules/get_equivalent_atoms.f90' +) + +symph_wrapper = custom_target( + 'symph_f2py_wrapper', + input: symph_fortran_src, + output: 'symphmodule.c', + command: [ + f2py_exe, + '-m', 'symph', + '@INPUT@', + '--quiet', + '--lower' + ], + build_by_default: true +) + +py_symph_ext = python_installation.extension_module( + 'symph', + [symph_wrapper, symph_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], + link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp', '-fopenmp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'secondorder' +secondorder_fortran_src = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +secondorder_wrapper = custom_target( + 'secondorder_f2py_wrapper', + input: secondorder_fortran_src, + output: 'secondordermodule.c', + command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_secondorder_ext = python_installation.extension_module( + 'secondorder', + [secondorder_wrapper, secondorder_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, py_dep], + link_args: ['-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thirdorder' +thirdorder_fortran_src = files( + 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', + 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' +) + +thirdorder_wrapper = custom_target( + 'thirdorder_f2py_wrapper', + input: thirdorder_fortran_src, + output: 'thirdordermodule.c', + command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_thirdorder_ext = python_installation.extension_module( + 'thirdorder', + [thirdorder_wrapper, thirdorder_fortran_src], + install: true, + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, py_dep], + link_args: ['-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp'], + install_rpath: '$ORIGIN/..' +) + +# --- + +# Extensión 'thermal_conductivity' +cond_fortran_src = files( + 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', + 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' +) + +cond_wrapper = custom_target( + 'thermal_conductivity_f2py_wrapper', + input: cond_fortran_src, + output: 'thermal_conductivitymodule.c', + command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], + build_by_default: true +) + +py_cond_ext = python_installation.extension_module( + 'thermal_conductivity', + [cond_wrapper, cond_fortran_src], + include_directories: include_dirs, + dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], + link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], + fortran_args: ['-cpp', '-fopenmp'], + install: true, + install_rpath: '$ORIGIN/..' +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if python_installation.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) +py_cc_linalg_ext = python_installation.extension_module( + 'cc_linalg', + cc_modules_sources, + include_directories: include_directories(numpy_incdir, numpy_parent_incdir), + install: true, + dependencies: [py_dep], + install_rpath: '$ORIGIN/..' +) + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +python_installation.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 0c22d15234ac870274a59070030e7ea6e591c1ae Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 10:16:57 +0200 Subject: [PATCH 102/151] A total rebuild and clean. --- meson.build | 277 +++++++++++++++++++++++----------------------------- 1 file changed, 123 insertions(+), 154 deletions(-) diff --git a/meson.build b/meson.build index 287b3f7d..61efcf5a 100644 --- a/meson.build +++ b/meson.build @@ -1,194 +1,163 @@ -project('CellConstructor', 'fortran', 'c', +project('CellConstructor', + ['c','fortran'], version: '1.5.0', license: 'GPL', - default_options: ['fortran_args=-O2'] -) + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', + 'fortran_args=-cpp' + ] + ) # --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -py_dep = dependency('python3', required: true) - -# Obtenemos la ruta principal de los headers de numpy -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -# Obtenemos la ruta padre para incluir los headers de numpy anidados -numpy_parent_incdir = run_command( - python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', - check: true +# Encuentra las instalaciones necesarias +py = import('python').find_installation(pure: false) +py_dep = py.dependency() +fc = meson.get_compiler('fortran') + +# Dependencias adicionales +mpi_dep = dependency('mpi') +# Busca la librería quadmath, si está disponible +quadmath_dep = fc.find_library('quadmath', required: false) + +# --- CONFIGURACIÓN DE NUMPY --- +# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +incdir_numpy = run_command(py, + ['-c', 'import numpy; print(numpy.get_include())'], + check : true ).stdout().strip() -# Obtenemos la ruta específica para los headers de f2py -f2py_incdir = run_command( - python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', - check: true -).stdout().strip() - -# Creamos una lista de directorios de inclusión para usar en todas las extensiones -include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') - -# Obtenemos la ruta de la biblioteca de f2py para la vinculación -f2py_libdir = run_command( - python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(os.path.dirname(numpy.f2py.__file__)), "core", "lib"))', - check: true +# f2py también requiere la cabecera fortranobject.h +incdir_f2py = run_command(py, + ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], + check : true ).stdout().strip() -# Obtenemos la ruta del directorio de bibliotecas de Python -py_libdir = python_installation.get_install_dir() / 'lib' -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) +inc_np = include_directories(incdir_numpy, incdir_f2py) +# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- # --- Definición de cada extensión de Python (Fortran) --- # Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true +# Compilación del módulo Fortran: symph +fortran_sources_symph = [ + 'FModules/constants.f90', + 'FModules/error_handler.f90', + 'FModules/get_latvec.f90', + 'FModules/io_global.f90', + 'FModules/rotate_and_add_dyn.f90', + 'FModules/smallgq.f90', + 'FModules/symm_matrix.f90', + 'FModules/contract_two_phonon_propagator.f90', + 'FModules/fc_supercell_from_dyn.f90', + 'FModules/get_q_grid_fast.f90', + 'FModules/kind.f90', + 'FModules/star_q.f90', + 'FModules/symvector.f90', + 'FModules/cryst_to_car.f90', + 'FModules/flush_unit.f90', + 'FModules/get_translations.f90', + 'FModules/q2qstar_out.f90', + 'FModules/set_asr.f90', + 'FModules/symdynph_gq_new.f90', + 'FModules/trntnsc.f90', + 'FModules/eff_charge_interp.f90', + 'FModules/from_matdyn.f90', + 'FModules/interp.f90', + 'FModules/q_gen.f90', + 'FModules/set_tau.f90', + 'FModules/symm_base.f90', + 'FModules/unwrap_tensors.f90', + 'FModules/eqvect.f90', + 'FModules/get_equivalent_atoms.f90', + 'FModules/invmat.f90', + 'FModules/recips.f90', + 'FModules/sgam_ph.f90', + 'FModules/symmetry_high_rank.f90' +] + +py.extension_module('symph', + fortran_sources_symph, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep], + install: true ) -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp'], - #link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - # Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) +# Compilación del módulo Fortran: secondorder +fortran_sources_secondorder = [ + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +] -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, py_dep], - #link_args: ['-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' +py.extension_module('secondorder', + fortran_sources_secondorder, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep], + install: true ) -# --- - # Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdordermodule.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) +# Compilación del módulo Fortran: thirdorder -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, py_dep], - #link_args: ['-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) +fortran_sources_thirdorder = [ + 'FModules/third_order_ASR.f90', + 'FModules/third_order_centering.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_dynbubble.f90', + 'FModules/third_order_interpol.f90' +] -# --- +py.extension_module('thirdorder', + fortran_sources_thirdorder, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep], + install: true +) # Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivitymodule.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true +thermal_conductivity_fortran_src = files( +'FModules/get_scattering_q_grid.f90', +'FModules/third_order_cond.f90', +'FModules/third_order_cond_centering.f90', +'FModules/get_lf.f90' ) -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp'], - #link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' +py.extension_module('thermal_conductivity', + thermal_conductivity_fortran_src, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep], + install: true ) # --- Definición de la extensión C 'cc_linalg' --- wrapper_file = '' -if python_installation.version().version_compare('<3.0') +if py.version().version_compare('<3.0') wrapper_file = 'CModules/wrapper.c' else wrapper_file = 'CModules/wrapper3.c' endif -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir, numpy_parent_incdir), - install: true, - dependencies: [py_dep], - install_rpath: '$ORIGIN/..' +# Compilación del módulo C: cc_linalg +c_linalg_sources = [ + 'CModules/LinAlg.c', + wrapper_file +] + +py.extension_module('cc_linalg', + c_linalg_sources, + include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + dependencies: py_dep, + install: true ) + # --- Instalación del paquete de Python 'cellconstructor' --- install_data( 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', @@ -197,18 +166,18 @@ install_data( 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', + install_dir: py.get_install_dir() / 'cellconstructor', ) install_data( 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' + install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' ) # --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ +py.install_sources([ 'scripts/symmetrize_dynmat.py', 'scripts/cellconstructor_test.py', 'scripts/view_scf_atoms.py' From 977b1905776ef7abeeab0454a41979f9454a6443 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 10:41:36 +0200 Subject: [PATCH 103/151] Include the mpi dependence and set it as not required --- meson.build | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 61efcf5a..766d6b05 100644 --- a/meson.build +++ b/meson.build @@ -17,7 +17,37 @@ py_dep = py.dependency() fc = meson.get_compiler('fortran') # Dependencias adicionales -mpi_dep = dependency('mpi') +#mpi_dep = dependency('mpi') +# --- MPI Detection --- +# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). +# Meson has a built-in MPI module. +mpi_args = [] +mpi_link_args = [] +mpi_compile_args = [] +has_mpi = false + +# Attempts to find the MPI dependency. +# You can specify a specific MPI compiler with the 'mpi_compiler' parameter +# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. +# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. +#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) +mpi_dep = dependency('mpi', required: false) + +if mpi_dep.found() + message('MPI environment detected correctly.') + has_mpi = true + # Meson handles adding appropriate flags. We just add the define. + # If you need specific MPI flags beyond what Meson adds automatically, + # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() + # and add them to extra_compile_args/extra_link_args. + mpi_compile_args += ['-D_MPI'] +else + # Here you can add warning logic if MPI is not found. + # Meson prints a warning if required: true and it is not found. + # For required: false, you can print your own warning. + warning('No MPI compiler found, please ensure MPI is installed and configured.') + warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') +endif # Busca la librería quadmath, si está disponible quadmath_dep = fc.find_library('quadmath', required: false) From 5eab08012002d9a79b4182814ced332d1f94fa07 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 11:11:43 +0200 Subject: [PATCH 104/151] Almost forgot to include the lapack and blas dependences in 'meson.build' --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index 766d6b05..a654edf6 100644 --- a/meson.build +++ b/meson.build @@ -18,6 +18,10 @@ fc = meson.get_compiler('fortran') # Dependencias adicionales #mpi_dep = dependency('mpi') +# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +lapack_dep = dependency('lapack') +blas_dep = dependency('blas') + # --- MPI Detection --- # This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). # Meson has a built-in MPI module. From fa5a7c2c1a4a82c648cbd00612910f71e3b479ff Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 11:47:01 +0200 Subject: [PATCH 105/151] Adding the openblas and lapak in the comppilation of the FORTRAN modules --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index a654edf6..282ab935 100644 --- a/meson.build +++ b/meson.build @@ -115,7 +115,7 @@ fortran_sources_symph = [ py.extension_module('symph', fortran_sources_symph, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep], + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], install: true ) @@ -130,7 +130,7 @@ fortran_sources_secondorder = [ py.extension_module('secondorder', fortran_sources_secondorder, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep], + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], install: true ) @@ -150,7 +150,7 @@ fortran_sources_thirdorder = [ py.extension_module('thirdorder', fortran_sources_thirdorder, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep], + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], install: true ) @@ -166,7 +166,7 @@ thermal_conductivity_fortran_src = files( py.extension_module('thermal_conductivity', thermal_conductivity_fortran_src, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep], + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], install: true ) From 91fdb4b8c834769a59c26d4b2d5f0015aa2e84d2 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 15:15:05 +0200 Subject: [PATCH 106/151] tests --- meson.build.old_100 | 230 +++++++++++++++++++++++++++++++++++++ meson.build.old_100a | 266 +++++++++++++++++++++++++++++++++++++++++++ meson.build.old_101 | 231 +++++++++++++++++++++++++++++++++++++ 3 files changed, 727 insertions(+) create mode 100644 meson.build.old_100 create mode 100644 meson.build.old_100a create mode 100644 meson.build.old_101 diff --git a/meson.build.old_100 b/meson.build.old_100 new file mode 100644 index 00000000..282ab935 --- /dev/null +++ b/meson.build.old_100 @@ -0,0 +1,230 @@ +project('CellConstructor', + ['c','fortran'], + version: '1.5.0', + license: 'GPL', + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', + 'fortran_args=-cpp' + ] + ) + +# --- System and Python Dependencies --- +# Encuentra las instalaciones necesarias +py = import('python').find_installation(pure: false) +py_dep = py.dependency() +fc = meson.get_compiler('fortran') + +# Dependencias adicionales +#mpi_dep = dependency('mpi') +# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +lapack_dep = dependency('lapack') +blas_dep = dependency('blas') + +# --- MPI Detection --- +# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). +# Meson has a built-in MPI module. +mpi_args = [] +mpi_link_args = [] +mpi_compile_args = [] +has_mpi = false + +# Attempts to find the MPI dependency. +# You can specify a specific MPI compiler with the 'mpi_compiler' parameter +# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. +# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. +#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) +mpi_dep = dependency('mpi', required: false) + +if mpi_dep.found() + message('MPI environment detected correctly.') + has_mpi = true + # Meson handles adding appropriate flags. We just add the define. + # If you need specific MPI flags beyond what Meson adds automatically, + # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() + # and add them to extra_compile_args/extra_link_args. + mpi_compile_args += ['-D_MPI'] +else + # Here you can add warning logic if MPI is not found. + # Meson prints a warning if required: true and it is not found. + # For required: false, you can print your own warning. + warning('No MPI compiler found, please ensure MPI is installed and configured.') + warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') +endif +# Busca la librería quadmath, si está disponible +quadmath_dep = fc.find_library('quadmath', required: false) + +# --- CONFIGURACIÓN DE NUMPY --- +# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +incdir_numpy = run_command(py, + ['-c', 'import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +# f2py también requiere la cabecera fortranobject.h +incdir_f2py = run_command(py, + ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' + +# Compilación del módulo Fortran: symph +fortran_sources_symph = [ + 'FModules/constants.f90', + 'FModules/error_handler.f90', + 'FModules/get_latvec.f90', + 'FModules/io_global.f90', + 'FModules/rotate_and_add_dyn.f90', + 'FModules/smallgq.f90', + 'FModules/symm_matrix.f90', + 'FModules/contract_two_phonon_propagator.f90', + 'FModules/fc_supercell_from_dyn.f90', + 'FModules/get_q_grid_fast.f90', + 'FModules/kind.f90', + 'FModules/star_q.f90', + 'FModules/symvector.f90', + 'FModules/cryst_to_car.f90', + 'FModules/flush_unit.f90', + 'FModules/get_translations.f90', + 'FModules/q2qstar_out.f90', + 'FModules/set_asr.f90', + 'FModules/symdynph_gq_new.f90', + 'FModules/trntnsc.f90', + 'FModules/eff_charge_interp.f90', + 'FModules/from_matdyn.f90', + 'FModules/interp.f90', + 'FModules/q_gen.f90', + 'FModules/set_tau.f90', + 'FModules/symm_base.f90', + 'FModules/unwrap_tensors.f90', + 'FModules/eqvect.f90', + 'FModules/get_equivalent_atoms.f90', + 'FModules/invmat.f90', + 'FModules/recips.f90', + 'FModules/sgam_ph.f90', + 'FModules/symmetry_high_rank.f90' +] + +py.extension_module('symph', + fortran_sources_symph, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# Extensión 'secondorder' + +# Compilación del módulo Fortran: secondorder +fortran_sources_secondorder = [ + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +] + +py.extension_module('secondorder', + fortran_sources_secondorder, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# Extensión 'thirdorder' + +# Compilación del módulo Fortran: thirdorder + +fortran_sources_thirdorder = [ + 'FModules/third_order_ASR.f90', + 'FModules/third_order_centering.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_dynbubble.f90', + 'FModules/third_order_interpol.f90' +] + +py.extension_module('thirdorder', + fortran_sources_thirdorder, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# Extensión 'thermal_conductivity' + +thermal_conductivity_fortran_src = files( +'FModules/get_scattering_q_grid.f90', +'FModules/third_order_cond.f90', +'FModules/third_order_cond_centering.f90', +'FModules/get_lf.f90' +) + +py.extension_module('thermal_conductivity', + thermal_conductivity_fortran_src, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if py.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +# Compilación del módulo C: cc_linalg +c_linalg_sources = [ + 'CModules/LinAlg.c', + wrapper_file +] + +py.extension_module('cc_linalg', + c_linalg_sources, + include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + dependencies: py_dep, + install: true +) + + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: py.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +py.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif diff --git a/meson.build.old_100a b/meson.build.old_100a new file mode 100644 index 00000000..8fa2a10c --- /dev/null +++ b/meson.build.old_100a @@ -0,0 +1,266 @@ +project('CellConstructor', + ['c','fortran'], + version: '1.5.0', + license: 'GPL', + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', + 'fortran_args=-cpp' + ] + ) + +# --- System and Python Dependencies --- +# Encuentra las instalaciones necesarias +py = import('python').find_installation(pure: false) +py_dep = py.dependency() +fc = meson.get_compiler('fortran') + +# Dependencias adicionales +#mpi_dep = dependency('mpi') +# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +lapack_dep = dependency('lapack') +blas_dep = dependency('blas') +openblas_dep = dependency('openblas') + +# --- MPI Detection --- +# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). +# Meson has a built-in MPI module. +mpi_args = [] +mpi_link_args = [] +mpi_compile_args = [] +has_mpi = false + +# Attempts to find the MPI dependency. +# You can specify a specific MPI compiler with the 'mpi_compiler' parameter +# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. +# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. +#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) +mpi_dep = dependency('mpi', required: false) + +if mpi_dep.found() + message('MPI environment detected correctly.') + has_mpi = true + # Meson handles adding appropriate flags. We just add the define. + # If you need specific MPI flags beyond what Meson adds automatically, + # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() + # and add them to extra_compile_args/extra_link_args. + mpi_compile_args += ['-D_MPI'] +else + # Here you can add warning logic if MPI is not found. + # Meson prints a warning if required: true and it is not found. + # For required: false, you can print your own warning. + warning('No MPI compiler found, please ensure MPI is installed and configured.') + warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') +endif +# Busca la librería quadmath, si está disponible +quadmath_dep = fc.find_library('quadmath', required: false) + +# --- CONFIGURACIÓN DE NUMPY --- +# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +#incdir_numpy = run_command(py, +# ['-c', 'import numpy; print(numpy.get_include())'], +# check : true +#).stdout().strip() + +# f2py también requiere la cabecera fortranobject.h +#incdir_f2py = run_command(py, +# ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], +# check : true +#).stdout().strip() +# We need numpy's include directory for both C and Fortran modules +incdir_numpy = run_command(py, ['-c', 'import os; import numpy; print(os.path.join(os.path.dirname(numpy.__file__), "core", "include"))'], check : true).stdout().strip() +incdir_numpy_f2py = run_command(py, ['-c', 'import os; import numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))'], check : true).stdout().strip() +incdirs = [incdir_numpy, incdir_numpy_f2py] +inc_np = include_directories(incdir_numpy) + +# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- + +# --- Definición de cada extensión de Python (Fortran) --- + +## symph module +#fortran_sources_symph = files( +# 'FModules/constants.f90', 'FModules/error_handler.f90', 'FModules/get_latvec.f90', +# 'FModules/io_global.f90', 'FModules/rotate_and_add_dyn.f90', 'FModules/smallgq.f90', +# 'FModules/symm_matrix.f90', 'FModules/contract_two_phonon_propagator.f90', +# 'FModules/fc_supercell_from_dyn.f90', 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', +# 'FModules/star_q.f90', 'FModules/symvector.f90', 'FModules/cryst_to_car.f90', +# 'FModules/flush_unit.f90', 'FModules/get_translations.f90', 'FModules/q2qstar_out.f90', +# 'FModules/set_asr.f90', 'FModules/symdynph_gq_new.f90', 'FModules/trntnsc.f90', +# 'FModules/eff_charge_interp.f90', 'FModules/from_matdyn.f90', 'FModules/interp.f90', +# 'FModules/q_gen.f90', 'FModules/set_tau.f90', 'FModules/symm_base.f90', +# 'FModules/unwrap_tensors.f90', 'FModules/eqvect.f90', +# 'FModules/get_equivalent_atoms.f90', 'FModules/invmat.f90', 'FModules/recips.f90', +# 'FModules/sgam_ph.f90', 'FModules/symmetry_high_rank.f90' +#) +# +#f2py_symph_target = custom_target('symph-f2py-wrapper', +# input: fortran_sources_symph, +# output: 'symph-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'symph' +# ], +# install: false +#) +# +#symph_module = py.extension_module('symph', +# fortran_sources_symph, f2py_symph_target, +# include_directories: incdirs, +# dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], +# install: true +#) + +# secondorder module +fortran_sources_secondorder = files( + 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' +) + +f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', + input: fortran_sources_secondorder, + output: 'secondorder-f2py.c', + command: [ + py.full_path(), '-m', 'numpy.f2py', + '--backend', 'meson', + '--dep', 'mpi', + '--quiet', + '-c', + '@INPUT0@', + '-m', 'secondorder' + ], + install: false +) + +secondorder_module = py.extension_module('secondorder', + fortran_sources_secondorder, f2py_secondorder_target, + include_directories: incdirs, + dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], + install: true +) + +# #thirdorder module +#fortran_sources_thirdorder = files( +# 'FModules/third_order_ASR.f90', 'FModules/third_order_centering.f90', +# 'FModules/third_order_cond_centering.f90', 'FModules/third_order_cond.f90', +# 'FModules/third_order_dynbubble.f90', 'FModules/third_order_interpol.f90' +#) +# +## Generate the C wrapper with f2py using a custom target +#f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', +# input: fortran_sources_thirdorder, +# output: 'thirdorder-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'thirdorder' +# ], +# install: false +#) +# +## Compile the module with the generated C wrapper and Fortran sources +#thirdorder_module = py.extension_module('thirdorder', +# fortran_sources_thirdorder, f2py_thirdorder_target, +# include_directories: incdirs, +# dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], +# install: true +#) + + +## thermal_conductivity module +#fortran_sources_thermal_conductivity = files( +# 'FModules/get_scattering_q_grid.f90', +# 'FModules/third_order_cond.f90', +# 'FModules/third_order_cond_centering.f90', +# 'FModules/get_lf.f90' +#) +# +#f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', +# input: fortran_sources_thermal_conductivity, +# output: 'thermal_conductivity-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'thermal_conductivity' +# ], +# install: false +#) +# +#thermal_conductivity_module = py.extension_module('thermal_conductivity', +# fortran_sources_thermal_conductivity, f2py_thermal_conductivity_target, +# include_directories: incdirs, +# dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], +# install: true +#) + + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if py.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +# Compilación del módulo C: cc_linalg +c_linalg_sources = [ + 'CModules/LinAlg.c', + wrapper_file +] + +py.extension_module('cc_linalg', + c_linalg_sources, + include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + dependencies: py_dep, + install: true +) + + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: py.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +py.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif diff --git a/meson.build.old_101 b/meson.build.old_101 new file mode 100644 index 00000000..e9b696a5 --- /dev/null +++ b/meson.build.old_101 @@ -0,0 +1,231 @@ +project('CellConstructor', + ['c','fortran'], + version: '1.5.0', + license: 'GPL', + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', + 'fortran_args=-cpp' + ] + ) + +# --- System and Python Dependencies --- +# Encuentra las instalaciones necesarias +py = import('python').find_installation(pure: false) +py_dep = py.dependency() +fc = meson.get_compiler('fortran') + +# Dependencias adicionales +#mpi_dep = dependency('mpi') +# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +lapack_dep = dependency('lapack') +blas_dep = dependency('blas') +openblas_dep = dependency('openblas') + +# --- MPI Detection --- +# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). +# Meson has a built-in MPI module. +mpi_args = [] +mpi_link_args = [] +mpi_compile_args = [] +has_mpi = false + +# Attempts to find the MPI dependency. +# You can specify a specific MPI compiler with the 'mpi_compiler' parameter +# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. +# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. +#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) +mpi_dep = dependency('mpi', required: false) + +if mpi_dep.found() + message('MPI environment detected correctly.') + has_mpi = true + # Meson handles adding appropriate flags. We just add the define. + # If you need specific MPI flags beyond what Meson adds automatically, + # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() + # and add them to extra_compile_args/extra_link_args. + mpi_compile_args += ['-D_MPI'] +else + # Here you can add warning logic if MPI is not found. + # Meson prints a warning if required: true and it is not found. + # For required: false, you can print your own warning. + warning('No MPI compiler found, please ensure MPI is installed and configured.') + warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') +endif +# Busca la librería quadmath, si está disponible +quadmath_dep = fc.find_library('quadmath', required: false) + +# --- CONFIGURACIÓN DE NUMPY --- +# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +incdir_numpy = run_command(py, + ['-c', 'import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +# f2py también requiere la cabecera fortranobject.h +incdir_f2py = run_command(py, + ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- + +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' + +# Compilación del módulo Fortran: symph +fortran_sources_symph = [ + 'FModules/constants.f90', + 'FModules/error_handler.f90', + 'FModules/get_latvec.f90', + 'FModules/io_global.f90', + 'FModules/rotate_and_add_dyn.f90', + 'FModules/smallgq.f90', + 'FModules/symm_matrix.f90', + 'FModules/contract_two_phonon_propagator.f90', + 'FModules/fc_supercell_from_dyn.f90', + 'FModules/get_q_grid_fast.f90', + 'FModules/kind.f90', + 'FModules/star_q.f90', + 'FModules/symvector.f90', + 'FModules/cryst_to_car.f90', + 'FModules/flush_unit.f90', + 'FModules/get_translations.f90', + 'FModules/q2qstar_out.f90', + 'FModules/set_asr.f90', + 'FModules/symdynph_gq_new.f90', + 'FModules/trntnsc.f90', + 'FModules/eff_charge_interp.f90', + 'FModules/from_matdyn.f90', + 'FModules/interp.f90', + 'FModules/q_gen.f90', + 'FModules/set_tau.f90', + 'FModules/symm_base.f90', + 'FModules/unwrap_tensors.f90', + 'FModules/eqvect.f90', + 'FModules/get_equivalent_atoms.f90', + 'FModules/invmat.f90', + 'FModules/recips.f90', + 'FModules/sgam_ph.f90', + 'FModules/symmetry_high_rank.f90' +] + +py.extension_module('symph', + fortran_sources_symph, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# Extensión 'secondorder' + +# Compilación del módulo Fortran: secondorder +fortran_sources_secondorder = [ + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +] + +py.extension_module('secondorder', + fortran_sources_secondorder, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# Extensión 'thirdorder' + +# Compilación del módulo Fortran: thirdorder + +fortran_sources_thirdorder = [ + 'FModules/third_order_ASR.f90', + 'FModules/third_order_centering.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_dynbubble.f90', + 'FModules/third_order_interpol.f90' +] + +py.extension_module('thirdorder', + fortran_sources_thirdorder, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# Extensión 'thermal_conductivity' + +thermal_conductivity_fortran_src = files( +'FModules/get_scattering_q_grid.f90', +'FModules/third_order_cond.f90', +'FModules/third_order_cond_centering.f90', +'FModules/get_lf.f90' +) + +py.extension_module('thermal_conductivity', + thermal_conductivity_fortran_src, + include_directories: inc_np, + dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + install: true +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if py.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +# Compilación del módulo C: cc_linalg +c_linalg_sources = [ + 'CModules/LinAlg.c', + wrapper_file +] + +py.extension_module('cc_linalg', + c_linalg_sources, + include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + dependencies: py_dep, + install: true +) + + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: py.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +py.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 7773b72df408e0d81b32460c1ca0bb2bf29147aa Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 16:07:57 +0200 Subject: [PATCH 107/151] Forgot to add the openblas dependency --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 282ab935..e9b696a5 100644 --- a/meson.build +++ b/meson.build @@ -21,6 +21,7 @@ fc = meson.get_compiler('fortran') # Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. lapack_dep = dependency('lapack') blas_dep = dependency('blas') +openblas_dep = dependency('openblas') # --- MPI Detection --- # This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). From c5648238078fc9688308d0b3d9a11060b3b604fb Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 16:15:07 +0200 Subject: [PATCH 108/151] Put the dependecies in a list --- meson.build | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index e9b696a5..998b5a42 100644 --- a/meson.build +++ b/meson.build @@ -21,7 +21,7 @@ fc = meson.get_compiler('fortran') # Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. lapack_dep = dependency('lapack') blas_dep = dependency('blas') -openblas_dep = dependency('openblas') +openblas_dep = dependency('openblas', required: false) # --- MPI Detection --- # This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). @@ -71,7 +71,12 @@ incdir_f2py = run_command(py, inc_np = include_directories(incdir_numpy, incdir_f2py) # --- FIN DE LA CONFIGURACIÓN DE NUMPY --- - +if openblas_dep.found() + message('openblas environment detected correctly.') + list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] +else + list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] + warning('No openblas found.') # --- Definición de cada extensión de Python (Fortran) --- # Extensión 'symph' @@ -116,7 +121,7 @@ fortran_sources_symph = [ py.extension_module('symph', fortran_sources_symph, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + dependencies: list_dep, install: true ) @@ -131,7 +136,7 @@ fortran_sources_secondorder = [ py.extension_module('secondorder', fortran_sources_secondorder, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + dependencies: list_dep, install: true ) @@ -151,7 +156,7 @@ fortran_sources_thirdorder = [ py.extension_module('thirdorder', fortran_sources_thirdorder, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + dependencies: list_dep, install: true ) @@ -167,7 +172,7 @@ thermal_conductivity_fortran_src = files( py.extension_module('thermal_conductivity', thermal_conductivity_fortran_src, include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], + dependencies: list_dep, install: true ) From 658dc9ae9a0a3c6ebc41c7615751259de0eaa53f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 16:17:45 +0200 Subject: [PATCH 109/151] Put the 'endif' --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 998b5a42..f09c1587 100644 --- a/meson.build +++ b/meson.build @@ -75,8 +75,9 @@ if openblas_dep.found() message('openblas environment detected correctly.') list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] else - list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] warning('No openblas found.') + list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] +endif # --- Definición de cada extensión de Python (Fortran) --- # Extensión 'symph' From bbb75d175c4cfe8aaad4bd14e28f28228a3bdb26 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 16:19:21 +0200 Subject: [PATCH 110/151] test without openblas --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index f09c1587..39381a1f 100644 --- a/meson.build +++ b/meson.build @@ -71,13 +71,13 @@ incdir_f2py = run_command(py, inc_np = include_directories(incdir_numpy, incdir_f2py) # --- FIN DE LA CONFIGURACIÓN DE NUMPY --- -if openblas_dep.found() - message('openblas environment detected correctly.') - list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] -else - warning('No openblas found.') +#if openblas_dep.found() +# message('openblas environment detected correctly.') +# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] +#else +# warning('No openblas found.') list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] -endif +#endif # --- Definición de cada extensión de Python (Fortran) --- # Extensión 'symph' From b26927057087bf06e064a795e16ee4ddb1a8c6e0 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 15 Sep 2025 16:22:34 +0200 Subject: [PATCH 111/151] remove unused 'fpm' code --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b18f5612..95ec042d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Install Python dependencies run: | - pip install meson ninja meson-python numpy scipy ase pytest fpm + pip install meson ninja meson-python numpy scipy ase pytest - name: Setup build directory run: meson setup builddir From fb3f3771327c8293392b3adb8a31147a90af2fe7 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 16 Sep 2025 08:16:09 +0200 Subject: [PATCH 112/151] Removing old configurations --- meson.build.old | 287 --------------------------------- meson.build.old10 | 196 ---------------------- meson.build.old11 | 196 ---------------------- meson.build.old12 | 203 ----------------------- meson.build.old2 | 194 ---------------------- meson.build.old3 | 217 ------------------------- meson.build.old3.fpm_f2py_toml | 204 ----------------------- meson.build.old4 | 260 ----------------------------- meson.build.old5 | 186 --------------------- meson.build.old6 | 190 ---------------------- meson.build.old7 | 226 -------------------------- meson.build.old8 | 231 -------------------------- meson.build.old9 | 196 ---------------------- 13 files changed, 2786 deletions(-) delete mode 100644 meson.build.old delete mode 100644 meson.build.old10 delete mode 100644 meson.build.old11 delete mode 100644 meson.build.old12 delete mode 100644 meson.build.old2 delete mode 100644 meson.build.old3 delete mode 100644 meson.build.old3.fpm_f2py_toml delete mode 100644 meson.build.old4 delete mode 100644 meson.build.old5 delete mode 100644 meson.build.old6 delete mode 100644 meson.build.old7 delete mode 100644 meson.build.old8 delete mode 100644 meson.build.old9 diff --git a/meson.build.old b/meson.build.old deleted file mode 100644 index 8dc20aa3..00000000 --- a/meson.build.old +++ /dev/null @@ -1,287 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - # Common compilation options for Fortran. - # -cpp is essential for the Fortran preprocessor. - # -O2 is a general optimization you had in setup.py. - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -# Imports the Meson Python module to handle extensions and Python installation. -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -# Find the fpm and f2py programs -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Define the build directory for fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - -# Searches the system for the BLAS and LAPACK libraries. -# Meson can find implementations such as OpenBLAS, BLIS, Intel MKL, or generic ones. -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) - -# Look for the OpenMP library if it is needed for parallelization. -openmp_dep = dependency('openmp', required: true) - - -# --- Definition of Fortran Extensions --- - -# Use fpm to build and install your Fortran sources -# NOTE: The fpm call has been moved to a `custom_target` for each extension. -#run_command( -# fpm_exe, -# 'install', -# '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], -# '--name', 'symph', -# '--prefix', fpm_build_dir, -# check : true -#) - -# Extensión 'symph' -symph_sources = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', - 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', - 'FModules/error_handler.f90', 'FModules/io_global.f90', - 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', - 'FModules/q2qstar_out.f90', 'FModules/rotate_and_add_dyn.f90', - 'FModules/trntnsc.f90', 'FModules/star_q.f90', 'FModules/eqvect.f90', - 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', - 'FModules/constants.f90', 'FModules/eff_charge_interp.f90', - 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' -) -# Create a Python extension module using the Fortran sources and dependencies. - -# NEW: Use custom_target to compile the Fortran sources into a static library with fpm. -# This ensures the library exists before we try to link it. -symph_fortran_lib = custom_target( - 'symph_fortran_lib', - output: 'libsymph.a', - command: [ - fpm_exe, - 'build', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - '--name', 'symph', - '--chdir', meson.source_root(), # <-- Crucial: fpm runs from the source root - '--prefix', meson.current_build_dir(), - '--install' # <-- Ensures fpm installs the library for Meson to find - ], - input: symph_sources, - build_by_default: true -) - -# Use f2py to create the C wrapper -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_sources, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', # The name of the module - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -# Create the Python extension module -py_symph_ext = python_installation.extension_module( - 'symph', # Name of the resulting module - # We now pass the generated C wrapper and the static library from fpm - symph_wrapper, - symph_fortran_lib, # Use the target object directly - install: true, - include_directories: [ - include_directories(numpy_incdir), - meson.current_build_dir() / 'fpm_build' / 'include' # Path to fpm-generated module files - ], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -#py_symph_ext = python_installation.extension_module( -# 'symph', # Name of the resulting module (e.g. symph.cpython-310-x86_64-linux-gnu.so) -# symph_sources, -# install: true, - # Compilation arguments specific to these Fortran sources. - # -cpp is already defined in default_options, but can be added here if needed. -# fortran_args: ['-cpp'], -# include_directories: include_directories(numpy_incdir), -# dependencies: [lapack_dep, blas_dep, openmp_dep], -# install_rpath: '$ORIGIN/..' -#) - -# Extensión 'secondorder' -# NOTE: It will need to apply the same logic as above for this and other extensions -secondorder_sources = files( - 'FModules/second_order_centering.f90', - 'FModules/second_order_ASR.f90' -) -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_sources, - fortran_args: ['-cpp'], - install: true, - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thirdorder' -thirdorder_sources = files( - 'FModules/third_order_centering.f90', - 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', - 'FModules/third_order_dynbubble.f90' -) -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_sources, - fortran_args: ['-cpp'], - install: true, - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thermal_conductivity' -cond_sources = files( - 'FModules/get_scattering_q_grid.f90', - 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', - 'FModules/get_lf.f90' -) -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_sources, - # '-fopenmp' is explicitly added here for this specific extension. - # "-O2" is already in default_options. - fortran_args: ['-fopenmp'], - install: true, - include_directories: include_directories(numpy_incdir), - dependencies: [lapack_dep, blas_dep, openmp_dep], - install_rpath: '$ORIGIN/..' -) - -# --- Definition of the C Extension 'cc_linalg' --- -# Conditional logic for the wrapper file based on the Python version. -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true -# I assume cc_linalg also needs numpy, if not it can be removed. - #dependencies: [numpy_dep], - , install_rpath: '$ORIGIN/..' -) - -# --- Installing Extension Modules --- -# Register each extension module so Meson knows to install them -# in the Python site-packages directory. -#python_installation.install_extmod(py_symph_ext) -#python_installation.install_extmod(py_secondorder_ext) -#python_installation.install_extmod(py_thirdorder_ext) -#python_installation.install_extmod(py_cond_ext) -#python_installation.install_extmod(py_cc_linalg_ext) - - -# --- Installing the Python package 'cellconstructor' --- -# This installs the .py files from the 'cellconstructor' directory -# into the 'cellconstructor' subdirectory within the Python site-packages. -#python_installation.install_sources( -# python_installation.find_sources('cellconstructor/*.py'), -# subdir: 'cellconstructor' -#) -install_data( - 'cellconstructor/__init__.py', - 'cellconstructor/AnharmonicForceFields.py', - 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', - 'cellconstructor/Phonons.py', - 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', - 'cellconstructor/Units.py', - 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', - 'cellconstructor/Manipulate.py', - 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', - 'cellconstructor/Structure.py', - 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - - -# Installing package data (.dat files) -# They are installed in the 'cellconstructor/SymData' directory in the site-packages. -install_data( -#'cellconstructor/SymData/gamma_symm_op.dat', - #'cellconstructor/SymData/space_groups_crystal.dat', - 'cellconstructor/SymData/15.dat', - 'cellconstructor/SymData/36_red.dat', - 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', - 'cellconstructor/SymData/64.bcs', - 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData') - -# --- Installing the executable scripts --- -# Installs the scripts directly into the Python environment's scripts directory. -#install_scripts( -# 'scripts/symmetrize_dynmat.py', -# 'scripts/cellconstructor_test.py', -# 'scripts/view_scf_atoms.py' -#) -#install_data([ -# 'scripts/symmetrize_dynmat.py', -# 'scripts/cellconstructor_test.py', -# 'scripts/view_scf_atoms.py' -#], -#install_dir: get_option('bindir') -#) -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' - ]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v', -# '-m', 'not release', -# join_paths(meson.source_root(), 'tests') -# 'tests' - ], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old10 b/meson.build.old10 deleted file mode 100644 index 2b44aada..00000000 --- a/meson.build.old10 +++ /dev/null @@ -1,196 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- -# Hemos vuelto a una estructura más simple y robusta. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, '.'), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, '.'), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, '.'), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, '.'), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old11 b/meson.build.old11 deleted file mode 100644 index 881ef67b..00000000 --- a/meson.build.old11 +++ /dev/null @@ -1,196 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- -# Hemos vuelto a una estructura más simple y robusta. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, '.'), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, '.'), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdordermodule.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, '.'), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivitymodule.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, '.'), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old12 b/meson.build.old12 deleted file mode 100644 index 33581111..00000000 --- a/meson.build.old12 +++ /dev/null @@ -1,203 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -# Obtenemos la ruta padre para incluir los headers de numpy anidados -numpy_parent_incdir = run_command( - python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', - check: true -).stdout().strip() - -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- -# Hemos vuelto a una estructura más simple y robusta. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdordermodule.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivitymodule.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, numpy_parent_incdir, '.'), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old2 b/meson.build.old2 deleted file mode 100644 index 8a1dabff..00000000 --- a/meson.build.old2 +++ /dev/null @@ -1,194 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Define el directorio de compilación para fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- PASO 1: Compilar todas las librerías de Fortran con fpm --- -# Este comando usa fpm.toml para saber qué librerías compilar y dónde colocarlas. -#fflags = '-g -fPIC -funroll-loops -fstack-arrays -Ofast -frepack-arrays -faggressive-function-elimination -fopenmp' -#cflags = '-fPIC' -run_command( - fpm_exe, - 'install', -# '--profile', 'release', - '--prefix', fpm_build_dir, - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - check : true -) - -# --- PASO 2: Definir cada extensión de Python (Fortran) --- -# Cada extensión ahora tiene su propio bloque de compilación. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - fpm_build_dir / 'lib' / 'libsymph.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - fpm_build_dir / 'lib' / 'libsecondorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - fpm_build_dir / 'lib' / 'libthirdorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - fpm_build_dir / 'lib' / 'libthermal_conductivity.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old3 b/meson.build.old3 deleted file mode 100644 index 82600c67..00000000 --- a/meson.build.old3 +++ /dev/null @@ -1,217 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Define el directorio de compilación para fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- PASO 1: Compilar todas las librerías de Fortran con fpm como custom_target --- -fpm_install_target = custom_target( - 'fpm_install', - output: [ - 'lib/libsymph.a', - 'lib/libsecondorder.a', - 'lib/libthirdorder.a', - 'lib/libthermal_conductivity.a', - ], - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--flag=-g', - '--flag=-fPIC', - '--flag=-O2', - '--flag=-fopenmp', - ], - install: false, - build_always_stale: true, -) - -# --- PASO 2: Definir cada extensión de Python (Fortran) --- -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - fpm_build_dir / 'lib' / 'libsymph.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - fpm_build_dir / 'lib' / 'libsecondorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - fpm_build_dir / 'lib' / 'libthirdorder.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true, - depends: fpm_install_target, -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - fpm_build_dir / 'lib' / 'libthermal_conductivity.a', - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', - dependencies_extra: fpm_install_target, -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) - -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) -if pytest_exe.found() - test('pytest', pytest_exe, - args: ['-v'], - workdir: meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old3.fpm_f2py_toml b/meson.build.old3.fpm_f2py_toml deleted file mode 100644 index f4b7181f..00000000 --- a/meson.build.old3.fpm_f2py_toml +++ /dev/null @@ -1,204 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Define el directorio de compilación para fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- PASO 1: Compilar e instalar todas las librerías de Fortran con fpm --- -# Usamos un custom_target para que Meson sepa que se generarán los archivos. -fpm_install_target = custom_target( - 'fpm_install', - # Las salidas se declaran sin la ruta del directorio, Meson las espera en el directorio de compilación del target. - output: [ - 'libsymph.a', - 'libsecondorder.a', - 'libthirdorder.a', - 'libthermal_conductivity.a', - ], - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - ], - # No lo instalamos, ya que las librerías generadas se moverán más tarde. - install: false, - # Asegura que el target se ejecute cada vez para regenerar las librerías. - build_always_stale: true, -) - -# --- PASO 2: Definir cada extensión de Python (Fortran) --- -# Cada extensión ahora tiene su propio bloque de compilación. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[0]), - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[1]), - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[2]), - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - fpm_install_target.full_path(fpm_install_target.outputs()[3]), - install: true, - include_directories: [include_directories(numpy_incdir), fpm_build_dir / 'include'], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old4 b/meson.build.old4 deleted file mode 100644 index 9de107e2..00000000 --- a/meson.build.old4 +++ /dev/null @@ -1,260 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -# quizás usar dependency('numpy'), por ahora funciona así porque Meson aún no ha implementado f2py desde dependency('numpy'), pero es recomendable usar dependency en general. - -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Define el directorio de compilación para fpm -fpm_build_dir = meson.project_build_root() / 'fpm_build' - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- -# Cada extensión ahora tiene su propio bloque de compilación, lo que es más robusto. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) -# Creamos las direcciones de numpy y fpm para ser usadas luego -numpy_inc = include_directories(numpy_incdir) -#fpm_inc = include_directories(fpm_build_dir / 'include') -#fpm_inc = include_directories('fpm_build/include') - -# Luego usa las variables en las extensiones -#include_dirs = [numpy_inc, fpm_inc] -# Ruta absoluta de includes generados -fpm_include_dir = meson.project_build_root() / 'fpm_build' / 'include' -# Argumentos para el compilador -cpp_inc_args = ['-I' + fpm_include_dir, '-I' + numpy_incdir] -fortran_inc_args = ['-I' + fpm_include_dir] -# Creamos un custom_target solo para la librería symph. -symph_fortran_lib = custom_target( - 'symph_fortran_lib', - output: 'libsymph.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'symph', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: symph_fortran_src, - build_by_default: true -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - link_with: symph_fortran_lib, - install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) -secondorder_fortran_lib = custom_target( - 'secondorder_fortran_lib', - output: 'libsecondorder.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'secondorder', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: secondorder_fortran_src, - build_by_default: true -) -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - link_with: secondorder_fortran_lib, - install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) -thirdorder_fortran_lib = custom_target( - 'thirdorder_fortran_lib', - output: 'libthirdorder.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'thirdorder', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: thirdorder_fortran_src, - build_by_default: true -) -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - link_with: thirdorder_fortran_lib, - install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, - dependencies: [lapack_dep, blas_dep], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thermal_conductivity' -thermal_conductivity_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) -thermal_conductivity_fortran_lib = custom_target( - 'thermal_conductivity_fortran_lib', - output: 'libthermal_conductivity.a', - command: [ - fpm_exe, - 'install', - '--prefix', fpm_build_dir, - '--name', 'thermal_conductivity', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'] - ], - input: thermal_conductivity_fortran_src, - build_by_default: true -) -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: thermal_conductivity_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - link_with: thermal_conductivity_fortran_lib, - install: true, - #include_directories: include_dirs, - cpp_args: cpp_inc_args, - fortran_args: fortran_inc_args, - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old5 b/meson.build.old5 deleted file mode 100644 index afde0f79..00000000 --- a/meson.build.old5 +++ /dev/null @@ -1,186 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir), - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir), - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir), - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir), - link_args: ['-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old6 b/meson.build.old6 deleted file mode 100644 index 2bf7000a..00000000 --- a/meson.build.old6 +++ /dev/null @@ -1,190 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -#fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir), - link_args: ['-fopenmp'], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir), - link_args: ['-fopenmp'], - fortran_args: ['-cpp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old7 b/meson.build.old7 deleted file mode 100644 index f2feac14..00000000 --- a/meson.build.old7 +++ /dev/null @@ -1,226 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -# Compila el código Fortran en una librería compartida. -symph_lib = shared_library( - 'symph_lib', - symph_fortran_src, - dependencies: [lapack_dep, blas_dep, openmp_dep], - fortran_args: ['-cpp', '-fopenmp'], - link_args: ['-fopenmp'], - install: false, # No la instalamos, solo se usa para el enlace. -) - -# Crea el wrapper de C. -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -# Crea el módulo de extensión de Python enlazando el wrapper y la librería. -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - link_with: symph_lib, - dependencies: [numpy_incdir], - install: true, - install_rpath: '$ORIGIN/..' -) - ---- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_lib = shared_library( - 'secondorder_lib', - secondorder_fortran_src, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install: false, -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - link_with: secondorder_lib, - dependencies: [numpy_incdir], - install: true, - install_rpath: '$ORIGIN/..' -) - ---- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_lib = shared_library( - 'thirdorder_lib', - thirdorder_fortran_src, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install: false, -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - link_with: thirdorder_lib, - dependencies: [numpy_incdir], - install: true, - install_rpath: '$ORIGIN/..' -) - ---- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_lib = shared_library( - 'cond_lib', - cond_fortran_src, - dependencies: [lapack_dep, blas_dep, openmp_dep], - fortran_args: ['-cpp', '-fopenmp'], - link_args: ['-fopenmp'], - install: false, -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - link_with: cond_lib, - dependencies: [numpy_incdir], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old8 b/meson.build.old8 deleted file mode 100644 index 834f0dea..00000000 --- a/meson.build.old8 +++ /dev/null @@ -1,231 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -# Compila el código Fortran en una librería compartida. -symph_lib = shared_library( - 'symph_lib', - symph_fortran_src, - dependencies: [lapack_dep, blas_dep, openmp_dep], - fortran_args: ['-cpp', '-fopenmp'], - link_args: ['-fopenmp'], - install: false, # No la instalamos, solo se usa para el enlace. -) - -# Crea el wrapper de C. -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -# Crea el módulo de extensión de Python enlazando el wrapper y la librería. -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - link_with: symph_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_lib = shared_library( - 'secondorder_lib', - secondorder_fortran_src, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install: false, -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - secondorder_wrapper, - link_with: secondorder_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_lib = shared_library( - 'thirdorder_lib', - thirdorder_fortran_src, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install: false, -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - thirdorder_wrapper, - link_with: thirdorder_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_lib = shared_library( - 'cond_lib', - cond_fortran_src, - dependencies: [lapack_dep, blas_dep, openmp_dep], - fortran_args: ['-cpp', '-fopenmp'], - link_args: ['-fopenmp'], - install: false, -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - cond_wrapper, - link_with: cond_lib, - dependencies: [], - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - dependencies: [], - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old9 b/meson.build.old9 deleted file mode 100644 index 9eb52ad2..00000000 --- a/meson.build.old9 +++ /dev/null @@ -1,196 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- -# Hemos vuelto a una estructura más simple y robusta. - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdorder-f2pywrappers.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - dependencies: [lapack_dep, blas_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivity-f2pywrappers.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - dependencies: [lapack_dep, blas_dep, openmp_dep], - include_directories: include_directories(numpy_incdir, meson.current_build_dir()), - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif From 27559c0b4e85903a90eb558109cf622bc6c48aa8 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 16 Sep 2025 11:30:52 +0200 Subject: [PATCH 113/151] Manually adding the f2py wrappers. --- f2py_wrappers/README.md | 18 + f2py_wrappers/secondorder-f2pywrappers2.f90 | 137 + f2py_wrappers/secondordermodule.c | 2252 +++ f2py_wrappers/symph-f2pywrappers.f | 27 + f2py_wrappers/symph-f2pywrappers2.f90 | 275 + f2py_wrappers/symphmodule.c | 13669 +++++++++++++++ .../thermal_conductivity-f2pywrappers2.f90 | 400 + f2py_wrappers/thermal_conductivitymodule.c | 13977 ++++++++++++++++ f2py_wrappers/thirdorder-f2pywrappers2.f90 | 585 + f2py_wrappers/thirdordermodule.c | 13066 +++++++++++++++ meson.build.old_static_test | 249 + 11 files changed, 44655 insertions(+) create mode 100644 f2py_wrappers/README.md create mode 100644 f2py_wrappers/secondorder-f2pywrappers2.f90 create mode 100644 f2py_wrappers/secondordermodule.c create mode 100644 f2py_wrappers/symph-f2pywrappers.f create mode 100644 f2py_wrappers/symph-f2pywrappers2.f90 create mode 100644 f2py_wrappers/symphmodule.c create mode 100644 f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 create mode 100644 f2py_wrappers/thermal_conductivitymodule.c create mode 100644 f2py_wrappers/thirdorder-f2pywrappers2.f90 create mode 100644 f2py_wrappers/thirdordermodule.c create mode 100644 meson.build.old_static_test diff --git a/f2py_wrappers/README.md b/f2py_wrappers/README.md new file mode 100644 index 00000000..0928b801 --- /dev/null +++ b/f2py_wrappers/README.md @@ -0,0 +1,18 @@ +# This directory contains the f2py constructed Wrappers for meson +If you change the contsnts of the FORTRAN sources take the corresponden files from the f2py runs: + +```Bash +python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c FModules/third_order_ASR.f90 FModules/third_order_centering.f90 FModules/third_order_cond_centering.f90 FModules/third_order_cond.f90 FModules/third_order_dynbubble.f90 FModules/third_order_interpol.f90 -m thirdorder +``` + +```Bash +python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c FModules/second_order_centering.f90 FModules/second_order_ASR.f90 -m secondorder +``` + +```Bash +python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c constants.f90 error_handler.f90 get_latvec.f90 io_global.f90 rotate_and_add_dyn.f90 smallgq.f90 symm_matrix.f90 contract_two_phonon_propagator.f90 fc_supercell_from_dyn.f90 get_q_grid_fast.f90 kind.f90 star_q.f90 symvector.f90 cryst_to_car.f90 flush_unit.f90 get_translations.f90 q2qstar_out.f90 set_asr.f90 symdynph_gq_new.f90 trntnsc.f90 eff_charge_interp.f90 from_matdyn.f90 interp.f90 q_gen.f90 set_tau.f90 symm_base.f90 unwrap_tensors.f90 eqvect.f90 get_equivalent_atoms.f90 invmat.f90 recips.f90 sgam_ph.f90 symmetry_high_rank.f90 -m symph +``` + +```Bash +python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c get_lf.f90 get_scattering_q_grid.f90 third_order_centering.f90 third_order_cond.f90 -m thermal_conductivity +``` diff --git a/f2py_wrappers/secondorder-f2pywrappers2.f90 b/f2py_wrappers/secondorder-f2pywrappers2.f90 new file mode 100644 index 00000000..5a3a970b --- /dev/null +++ b/f2py_wrappers/secondorder-f2pywrappers2.f90 @@ -0,0 +1,137 @@ +! -*- f90 -*- +! This file is autogenerated with f2py (version:1.26.4) +! It contains Fortran 90 wrappers to fortran functions. + + subroutine f2pywrap_second_order_centering_within_dmax (within_dma& + &xf2pywrap, v1, v2, d1, d2, tol) + use second_order_centering, only : within_dmax + real(kind=8) d1 + real(kind=8) d2 + real(kind=8) tol + real(kind=8) v1(3) + real(kind=8) v2(3) + logical within_dmaxf2pywrap + within_dmaxf2pywrap = .not.(.not.within_dmax(v1, v2, d1, d2, tol)) + end subroutine f2pywrap_second_order_centering_within_dmax + subroutine f2pywrap_second_order_centering_compute_perimeter (comp& + &ute_perimeterf2pywrap, v1, v2) + use second_order_centering, only : compute_perimeter + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) compute_perimeterf2pywrap + compute_perimeterf2pywrap = compute_perimeter(v1, v2) + end subroutine f2pywrap_second_order_centering_compute_perimeter + subroutine f2pywrap_second_order_centering_cryst_to_cart (cryst_to& + &_cartf2pywrap, v, alat) + use second_order_centering, only : cryst_to_cart + integer v(3) + real(kind=8) alat(3,3) + real(kind=8) cryst_to_cartf2pywrap(3) + cryst_to_cartf2pywrap = cryst_to_cart(v, alat) + end subroutine f2pywrap_second_order_centering_cryst_to_cart + + subroutine f2pyinitsecond_order_centering(f2pysetupfunc) + use second_order_centering, only : analysis + use second_order_centering, only : center + interface + subroutine f2pywrap_second_order_centering_within_dmax (within_dma& + &xf2pywrap, v1, v2, d1, d2, tol) + real(kind=8) d1 + real(kind=8) d2 + real(kind=8) tol + real(kind=8) v1(3) + real(kind=8) v2(3) + logical within_dmaxf2pywrap + end subroutine f2pywrap_second_order_centering_within_dmax + subroutine f2pywrap_second_order_centering_compute_perimeter (comp& + &ute_perimeterf2pywrap, v1, v2) + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) compute_perimeterf2pywrap + end subroutine f2pywrap_second_order_centering_compute_perimeter + subroutine f2pywrap_second_order_centering_cryst_to_cart (cryst_to& + &_cartf2pywrap, v, alat) + integer v(3) + real(kind=8) alat(3,3) + real(kind=8) cryst_to_cartf2pywrap(3) + end subroutine f2pywrap_second_order_centering_cryst_to_cart + end interface + external f2pysetupfunc + call f2pysetupfunc(analysis,center,f2pywrap_second_order_centering& + &_within_dmax,f2pywrap_second_order_centering_compute_perimeter,f2p& + &ywrap_second_order_centering_cryst_to_cart) + end subroutine f2pyinitsecond_order_centering + + subroutine f2py_second_order_asr_getdims_p(r,s,f2pysetdata,flag) + use second_order_asr, only: d => 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_second_order_asr_getdims_p + subroutine f2pywrap_second_order_asr_geq (geqf2pywrap, v1, v2, lat& + &, pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) + use second_order_asr, only : geq + logical pbc + integer f2py_v1_d0 + integer f2py_v2_d0 + integer f2py_lat_d0 + integer v1(f2py_v1_d0) + integer v2(f2py_v2_d0) + integer lat(f2py_lat_d0) + logical geqf2pywrap + geqf2pywrap = .not.(.not.geq(v1, v2, lat, pbc)) + end subroutine f2pywrap_second_order_asr_geq + + subroutine f2pyinitsecond_order_asr(f2pysetupfunc) + use second_order_asr, only : perm_initialized + use second_order_asr, only : p + use second_order_asr, only : initialize_perm + use second_order_asr, only : clear_all + use second_order_asr, only : impose_perm_sym + use second_order_asr, only : impose_asr_2nd + use second_order_asr, only : impose_asr + interface + subroutine f2pywrap_second_order_asr_geq (geqf2pywrap, v1, v2, lat& + &, pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) + logical pbc + integer f2py_v1_d0 + integer f2py_v2_d0 + integer f2py_lat_d0 + integer v1(f2py_v1_d0) + integer v2(f2py_v2_d0) + integer lat(f2py_lat_d0) + logical geqf2pywrap + end subroutine f2pywrap_second_order_asr_geq + end interface + external f2pysetupfunc + external f2py_second_order_asr_getdims_p + call f2pysetupfunc(perm_initialized,f2py_second_order_asr_getdims_& + &p,initialize_perm,clear_all,f2pywrap_second_order_asr_geq,impose_p& + &erm_sym,impose_asr_2nd,impose_asr) + end subroutine f2pyinitsecond_order_asr + + diff --git a/f2py_wrappers/secondordermodule.c b/f2py_wrappers/secondordermodule.c new file mode 100644 index 00000000..7420ff59 --- /dev/null +++ b/f2py_wrappers/secondordermodule.c @@ -0,0 +1,2252 @@ +/* File: secondordermodule.c + * This file is auto-generated with f2py (version:1.26.4). + * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, + * written by Pearu Peterson . + * Generation date: Fri Sep 12 12:33:34 2025 + * Do not edit this file directly unless you know what you are doing!!! + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ + +/* Unconditionally included */ +#include +#include + +/*********************** See f2py2e/cfuncs.py: includes ***********************/ +#include "fortranobject.h" +#include + +/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ +static PyObject *secondorder_error; +static PyObject *secondorder_module; + +/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ +/*need_typedefs*/ + +/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ +/*need_typedefs_generated*/ + +/********************** See f2py2e/cfuncs.py: cppmacros **********************/ + +/* See fortranobject.h for definitions. The macros here are provided for BC. */ +#define rank f2py_rank +#define shape f2py_shape +#define fshape f2py_shape +#define len f2py_len +#define flen f2py_flen +#define slen f2py_slen +#define size f2py_size + + +#define CHECKSCALAR(check,tcheck,name,show,var)\ + if (!(check)) {\ + char errstring[256];\ + sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ + PyErr_SetString(secondorder_error,errstring);\ + /*goto capi_fail;*/\ + } else + +#ifdef DEBUGCFUNCS +#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); +#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ + PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ + fprintf(stderr,"\n"); +#else +#define CFUNCSMESS(mess) +#define CFUNCSMESSPY(mess,obj) +#endif + + +#ifndef max +#define max(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) ((a < b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef MIN +#define MIN(a,b) ((a < b) ? (a) : (b)) +#endif + + +#define CHECKARRAY(check,tcheck,name) \ + if (!(check)) {\ + PyErr_SetString(secondorder_error,"("tcheck") failed for "name);\ + /*goto capi_fail;*/\ + } else + +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F +#else +#define F_FUNC(f,F) _##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F##_ +#else +#define F_FUNC(f,F) _##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F +#else +#define F_FUNC(f,F) f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F##_ +#else +#define F_FUNC(f,F) f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) +#else +#define F_FUNC_US(f,F) F_FUNC(f,F) +#endif + + +/************************ See f2py2e/cfuncs.py: cfuncs ************************/ + +static int +int_from_pyobj(int* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + + if (PyLong_Check(obj)) { + *v = Npy__PyLong_AsInt(obj); + return !(*v == -1 && PyErr_Occurred()); + } + + tmp = PyNumber_Long(obj); + if (tmp) { + *v = Npy__PyLong_AsInt(tmp); + Py_DECREF(tmp); + return !(*v == -1 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (int_from_pyobj(v, tmp, errmess)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + + { + PyObject* err = PyErr_Occurred(); + if (err == NULL) { + err = secondorder_error; + } + PyErr_SetString(err, errmess); + } + return 0; +} + + +static int +double_from_pyobj(double* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + if (PyFloat_Check(obj)) { + *v = PyFloat_AsDouble(obj); + return !(*v == -1.0 && PyErr_Occurred()); + } + + tmp = PyNumber_Float(obj); + if (tmp) { + *v = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return !(*v == -1.0 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} + Py_DECREF(tmp); + } + { + PyObject* err = PyErr_Occurred(); + if (err==NULL) err = secondorder_error; + PyErr_SetString(err,errmess); + } + return 0; +} + + +/********************* See f2py2e/cfuncs.py: userincludes *********************/ +/*need_userincludes*/ + +/********************* See f2py2e/capi_rules.py: usercode *********************/ + + +/* See f2py2e/rules.py */ +/*eof externroutines*/ + +/******************** See f2py2e/capi_rules.py: usercode1 ********************/ + + +/******************* See f2py2e/cb_rules.py: buildcallback *******************/ +/*need_callbacks*/ + +/*********************** See f2py2e/rules.py: buildapi ***********************/ + +/********************************** analysis **********************************/ +static char doc_f2py_rout_secondorder_second_order_centering_analysis[] = "\ +weight,xr2 = analysis(far,tol,dmax,sc_size,xr2_list,alat,tau,tensor,[nat,n_blocks])\n\nWrapper for ``analysis``.\ +\n\nParameters\n----------\n" +"far : input int\n" +"tol : input float\n" +"dmax : input rank-1 array('d') with bounds (nat)\n" +"sc_size : input rank-1 array('i') with bounds (3)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"tau : input rank-2 array('d') with bounds (nat,3)\n" +"tensor : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(dmax, 0)\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"\nReturns\n-------\n" +"weight : rank-3 array('i') with bounds (nat,nat,n_blocks)\n" +"xr2 : rank-5 array('i') with bounds (3,1 + 4 * far + 4 * far * far,nat,nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_centering_analysis(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,int*,int*,double*,double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int far = 0; + PyObject *far_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + double *dmax = NULL; + npy_intp dmax_Dims[1] = {-1}; + const int dmax_Rank = 1; + PyArrayObject *capi_dmax_as_array = NULL; + int capi_dmax_intent = 0; + PyObject *dmax_capi = Py_None; + int *sc_size = NULL; + npy_intp sc_size_Dims[1] = {-1}; + const int sc_size_Rank = 1; + PyArrayObject *capi_sc_size_as_array = NULL; + int capi_sc_size_intent = 0; + PyObject *sc_size_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tensor = NULL; + npy_intp tensor_Dims[3] = {-1, -1, -1}; + const int tensor_Rank = 3; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[3] = {-1, -1, -1}; + const int weight_Rank = 3; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + int *xr2 = NULL; + npy_intp xr2_Dims[5] = {-1, -1, -1, -1, -1}; + const int xr2_Rank = 5; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"far","tol","dmax","sc_size","xr2_list","alat","tau","tensor","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:secondorder.second_order_centering.analysis",\ + capi_kwlist,&far_capi,&tol_capi,&dmax_capi,&sc_size_capi,&xr2_list_capi,&alat_capi,&tau_capi,&tensor_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"secondorder.second_order_centering.analysis() 1st argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable dmax */ + ; + capi_dmax_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 3rd argument `dmax`"; + capi_dmax_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dmax_Dims,dmax_Rank, capi_dmax_intent,dmax_capi,capi_errmess); + if (capi_dmax_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dmax = (double *)(PyArray_DATA(capi_dmax_as_array)); + + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 6th argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 5th argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"secondorder.second_order_centering.analysis() 2nd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable sc_size */ + sc_size_Dims[0]=3; + capi_sc_size_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 4th argument `sc_size`"; + capi_sc_size_as_array = ndarray_from_pyobj( NPY_INT,1,sc_size_Dims,sc_size_Rank, capi_sc_size_intent,sc_size_capi,capi_errmess); + if (capi_sc_size_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sc_size = (int *)(PyArray_DATA(capi_sc_size_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(dmax, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_centering.analysis() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(dmax, 0) == nat,"shape(dmax, 0) == nat","1st keyword nat","analysis:nat=%d",nat) { + /* Processing variable tau */ + tau_Dims[0]=nat,tau_Dims[1]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 7th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_centering.analysis() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","analysis:n_blocks=%d",n_blocks) { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_blocks; + capi_weight_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the hidden `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,Py_None,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=1 + 4 * far + 4 * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_blocks; + capi_xr2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the hidden `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,Py_None,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + /* Processing variable tensor */ + tensor_Dims[0]=3 * nat,tensor_Dims[1]=3 * nat,tensor_Dims[2]=n_blocks; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 8th argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&far,&tol,dmax,sc_size,xr2_list,alat,tau,tensor,weight,xr2,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NN",capi_weight_as_array,capi_xr2_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*CHECKSCALAR(shape(dmax, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_sc_size_as_array!=sc_size_capi) { + Py_XDECREF(capi_sc_size_as_array); } + } /* if (capi_sc_size_as_array == NULL) ... else of sc_size */ + /* End of cleaning variable sc_size */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + if((PyObject *)capi_dmax_as_array!=dmax_capi) { + Py_XDECREF(capi_dmax_as_array); } + } /* if (capi_dmax_as_array == NULL) ... else of dmax */ + /* End of cleaning variable dmax */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of analysis ******************************/ + +/*********************************** center ***********************************/ +static char doc_f2py_rout_secondorder_second_order_centering_center[] = "\ +centered = center(original,weight,xr2_list,xr2,far,[nat,n_blocks,n_blocks_old])\n\nWrapper for ``center``.\ +\n\nParameters\n----------\n" +"original : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks_old)\n" +"weight : input rank-3 array('i') with bounds (nat,nat,n_blocks_old)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2 : input rank-5 array('i') with bounds (3,1 + 4 * far + 4 * far * far,nat,nat,n_blocks_old)\n" +"far : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(original, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"n_blocks_old : input int, optional\n Default: shape(original, 2)\n" +"\nReturns\n-------\n" +"centered : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_centering_center(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *original = NULL; + npy_intp original_Dims[3] = {-1, -1, -1}; + const int original_Rank = 3; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[3] = {-1, -1, -1}; + const int weight_Rank = 3; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + PyObject *weight_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[5] = {-1, -1, -1, -1, -1}; + const int xr2_Rank = 5; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[3] = {-1, -1, -1}; + const int centered_Rank = 3; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int far = 0; + PyObject *far_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int n_blocks_old = 0; + PyObject *n_blocks_old_capi = Py_None; + static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","far","nat","n_blocks","n_blocks_old",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OOO:secondorder.second_order_centering.center",\ + capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&far_capi,&nat_capi,&n_blocks_capi,&n_blocks_old_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"secondorder.second_order_centering.center() 5th argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 3rd argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable original */ + ; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 1st argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(original, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_centering.center() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_centering.center() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","center:n_blocks=%d",n_blocks) { + /* Processing variable n_blocks_old */ + if (n_blocks_old_capi == Py_None) n_blocks_old = shape(original, 2); else + f2py_success = int_from_pyobj(&n_blocks_old,n_blocks_old_capi,"secondorder.second_order_centering.center() 3rd keyword (n_blocks_old) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 2) == n_blocks_old,"shape(original, 2) == n_blocks_old","3rd keyword n_blocks_old","center:n_blocks_old=%d",n_blocks_old) { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=n_blocks; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=1 + 4 * far + 4 * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_blocks_old; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 4th argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + CHECKARRAY(shape(xr2, 1) == 1 + 4 * far + 4 * far * far,"shape(xr2, 1) == 1 + 4 * far + 4 * far * far","4th argument xr2") { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_blocks_old; + capi_weight_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 2nd argument `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(original,weight,xr2_list,xr2,&nat,centered,&far,&n_blocks,&n_blocks_old); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_centered_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_weight_as_array!=weight_capi) { + Py_XDECREF(capi_weight_as_array); } + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKARRAY(shape(xr2, 1) == 1 + 4 * far + 4 * far * far)*/ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKSCALAR(shape(original, 2) == n_blocks_old)*/ + } /*if (f2py_success) of n_blocks_old*/ + /* End of cleaning variable n_blocks_old */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of center *******************************/ + +/******************************** within_dmax ********************************/ +static char doc_f2py_rout_secondorder_second_order_centering_within_dmax[] = "\ +within_dmax = within_dmax(v1,v2,d1,d2,tol)\n\nWrapper for ``within_dmax``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"d1 : input float\n" +"d2 : input float\n" +"tol : input float\n" +"\nReturns\n-------\n" +"within_dmax : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_secondorder_second_order_centering_within_dmax(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int within_dmaxf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + double d1 = 0; + PyObject *d1_capi = Py_None; + double d2 = 0; + PyObject *d2_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2","d1","d2","tol",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:secondorder.second_order_centering.within_dmax",\ + capi_kwlist,&v1_capi,&v2_capi,&d1_capi,&d2_capi,&tol_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.within_dmax: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.within_dmax: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable d1 */ + f2py_success = double_from_pyobj(&d1,d1_capi,"secondorder.second_order_centering.within_dmax() 3rd argument (d1) can't be converted to double"); + if (f2py_success) { + /* Processing variable d2 */ + f2py_success = double_from_pyobj(&d2,d2_capi,"secondorder.second_order_centering.within_dmax() 4th argument (d2) can't be converted to double"); + if (f2py_success) { + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"secondorder.second_order_centering.within_dmax() 5th argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable within_dmaxf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&within_dmaxf2pywrap,v1,v2,&d1,&d2,&tol); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",within_dmaxf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable within_dmaxf2pywrap */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + } /*if (f2py_success) of d2*/ + /* End of cleaning variable d2 */ + } /*if (f2py_success) of d1*/ + /* End of cleaning variable d1 */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of within_dmax *****************************/ + +/***************************** compute_perimeter *****************************/ +static char doc_f2py_rout_secondorder_second_order_centering_compute_perimeter[] = "\ +compute_perimeter = compute_perimeter(v1,v2)\n\nWrapper for ``compute_perimeter``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"compute_perimeter : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_secondorder_second_order_centering_compute_perimeter(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double compute_perimeterf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:secondorder.second_order_centering.compute_perimeter",\ + capi_kwlist,&v1_capi,&v2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.compute_perimeter: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.compute_perimeter: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable compute_perimeterf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&compute_perimeterf2pywrap,v1,v2); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",compute_perimeterf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable compute_perimeterf2pywrap */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of compute_perimeter **************************/ + +/******************************* cryst_to_cart *******************************/ +static char doc_f2py_rout_secondorder_second_order_centering_cryst_to_cart[] = "\ +cryst_to_cart = cryst_to_cart(v,alat)\n\nWrapper for ``cryst_to_cart``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"cryst_to_cart : rank-1 array('d') with bounds (3) and cryst_to_cartf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_secondorder_second_order_centering_cryst_to_cart(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *cryst_to_cartf2pywrap = NULL; + npy_intp cryst_to_cartf2pywrap_Dims[1] = {-1}; + const int cryst_to_cartf2pywrap_Rank = 1; + PyArrayObject *capi_cryst_to_cartf2pywrap_as_array = NULL; + int capi_cryst_to_cartf2pywrap_intent = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + static char *capi_kwlist[] = {"v","alat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:secondorder.second_order_centering.cryst_to_cart",\ + capi_kwlist,&v_capi,&alat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.cryst_to_cart: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.cryst_to_cart: failed to create array from the 2nd argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable cryst_to_cartf2pywrap */ + cryst_to_cartf2pywrap_Dims[0]=3; + capi_cryst_to_cartf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_centering.cryst_to_cart: failed to create array from the hidden `cryst_to_cartf2pywrap`"; + capi_cryst_to_cartf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cryst_to_cartf2pywrap_Dims,cryst_to_cartf2pywrap_Rank, capi_cryst_to_cartf2pywrap_intent,Py_None,capi_errmess); + if (capi_cryst_to_cartf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + cryst_to_cartf2pywrap = (double *)(PyArray_DATA(capi_cryst_to_cartf2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(cryst_to_cartf2pywrap,v,alat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_cryst_to_cartf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_cryst_to_cartf2pywrap_as_array == NULL) ... else of cryst_to_cartf2pywrap */ + /* End of cleaning variable cryst_to_cartf2pywrap */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of cryst_to_cart ****************************/ + +/****************************** initialize_perm ******************************/ +static char doc_f2py_rout_secondorder_second_order_asr_initialize_perm[] = "\ +initialize_perm(r2,sclat,pbc,[n_blocks])\n\nWrapper for ``initialize_perm``.\ +\n\nParameters\n----------\n" +"r2 : input rank-2 array('i') with bounds (3,n_blocks)\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(r2, 1)"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_asr_initialize_perm(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + static char *capi_kwlist[] = {"r2","sclat","pbc","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:secondorder.second_order_asr.initialize_perm",\ + capi_kwlist,&r2_capi,&sclat_capi,&pbc_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable r2 */ + r2_Dims[0]=3; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.initialize_perm: failed to create array from the 1st argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_INT,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (int *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.initialize_perm: failed to create array from the 2nd argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(r2, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.initialize_perm() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(r2, 1) == n_blocks,"shape(r2, 1) == n_blocks","1st keyword n_blocks","initialize_perm:n_blocks=%d",n_blocks) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(r2,&n_blocks,sclat,&pbc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(r2, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of initialize_perm ***************************/ + +/********************************* clear_all *********************************/ +static char doc_f2py_rout_secondorder_second_order_asr_clear_all[] = "\ +clear_all()\n\nWrapper for ``clear_all``.\ +\n"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_asr_clear_all(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(void)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:secondorder.second_order_asr.clear_all",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of clear_all ******************************/ + +/************************************ geq ************************************/ +static char doc_f2py_rout_secondorder_second_order_asr_geq[] = "\ +geq = geq(v1,v2,lat,pbc)\n\nWrapper for ``geq``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('i') with bounds (f2py_v1_d0)\n" +"v2 : input rank-1 array('i') with bounds (f2py_v2_d0)\n" +"lat : input rank-1 array('i') with bounds (f2py_lat_d0)\n" +"pbc : input int\n" +"\nReturns\n-------\n" +"geq : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_secondorder_second_order_asr_geq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int geqf2pywrap = 0; + int *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + int *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + int *lat = NULL; + npy_intp lat_Dims[1] = {-1}; + const int lat_Rank = 1; + PyArrayObject *capi_lat_as_array = NULL; + int capi_lat_intent = 0; + PyObject *lat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + int f2py_v1_d0 = 0; + int f2py_v2_d0 = 0; + int f2py_lat_d0 = 0; + static char *capi_kwlist[] = {"v1","v2","lat","pbc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:secondorder.second_order_asr.geq",\ + capi_kwlist,&v1_capi,&v2_capi,&lat_capi,&pbc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + ; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.geq: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_INT,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (int *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + ; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.geq: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_INT,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (int *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable lat */ + ; + capi_lat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.geq: failed to create array from the 3rd argument `lat`"; + capi_lat_as_array = ndarray_from_pyobj( NPY_INT,1,lat_Dims,lat_Rank, capi_lat_intent,lat_capi,capi_errmess); + if (capi_lat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat = (int *)(PyArray_DATA(capi_lat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable geqf2pywrap */ + /* Processing variable f2py_v1_d0 */ + f2py_v1_d0 = shape(v1, 0); + /* Processing variable f2py_v2_d0 */ + f2py_v2_d0 = shape(v2, 0); + /* Processing variable f2py_lat_d0 */ + f2py_lat_d0 = shape(lat, 0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&geqf2pywrap,v1,v2,lat,&pbc,&f2py_v1_d0,&f2py_v2_d0,&f2py_lat_d0); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",geqf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_lat_d0 */ + /* End of cleaning variable f2py_v2_d0 */ + /* End of cleaning variable f2py_v1_d0 */ + /* End of cleaning variable geqf2pywrap */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_lat_as_array!=lat_capi) { + Py_XDECREF(capi_lat_as_array); } + } /* if (capi_lat_as_array == NULL) ... else of lat */ + /* End of cleaning variable lat */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of geq *********************************/ + +/****************************** impose_perm_sym ******************************/ +static char doc_f2py_rout_secondorder_second_order_asr_impose_perm_sym[] = "\ +fcvar,fc_sym = impose_perm_sym(fc,r2,sclat,pbc,verbose,[nat,n_blocks])\n\nWrapper for ``impose_perm_sym``.\ +\n\nParameters\n----------\n" +"fc : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" +"r2 : input rank-2 array('i') with bounds (3,n_blocks)\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"verbose : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(fc, 2)\n" +"\nReturns\n-------\n" +"fcvar : float\n" +"fc_sym : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_asr_impose_perm_sym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[3] = {-1, -1, -1}; + const int fc_Rank = 3; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + int *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + double fcvar = 0; + double *fc_sym = NULL; + npy_intp fc_sym_Dims[3] = {-1, -1, -1}; + const int fc_sym_Rank = 3; + PyArrayObject *capi_fc_sym_as_array = NULL; + int capi_fc_sym_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"fc","r2","sclat","pbc","verbose","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:secondorder.second_order_asr.impose_perm_sym",\ + capi_kwlist,&fc_capi,&r2_capi,&sclat_capi,&pbc_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the 3rd argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable verbose */ + verbose = (int)PyObject_IsTrue(verbose_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable fcvar */ + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_asr.impose_perm_sym() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_perm_sym:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 2); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.impose_perm_sym() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 2) == n_blocks,"shape(fc, 2) == n_blocks","2nd keyword n_blocks","impose_perm_sym:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the 2nd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_INT,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (int *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable fc_sym */ + fc_sym_Dims[0]=3 * nat,fc_sym_Dims[1]=3 * nat,fc_sym_Dims[2]=n_blocks; + capi_fc_sym_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the hidden `fc_sym`"; + capi_fc_sym_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_sym_Dims,fc_sym_Rank, capi_fc_sym_intent,Py_None,capi_errmess); + if (capi_fc_sym_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_sym = (double *)(PyArray_DATA(capi_fc_sym_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r2,sclat,&pbc,&verbose,&fcvar,fc_sym,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("dN",fcvar,capi_fc_sym_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_sym_as_array == NULL) ... else of fc_sym */ + /* End of cleaning variable fc_sym */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 2) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + /* End of cleaning variable fcvar */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of impose_perm_sym ***************************/ + +/******************************* impose_asr_2nd *******************************/ +static char doc_f2py_rout_secondorder_second_order_asr_impose_asr_2nd[] = "\ +fcvar,sum2nd,fc_asr = impose_asr_2nd(fc,pow,sclat,pbc,verbose,[nat,n_blocks])\n\nWrapper for ``impose_asr_2nd``.\ +\n\nParameters\n----------\n" +"fc : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" +"pow : input float\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"verbose : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(fc, 2)\n" +"\nReturns\n-------\n" +"fcvar : float\n" +"sum2nd : float\n" +"fc_asr : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_asr_impose_asr_2nd(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[3] = {-1, -1, -1}; + const int fc_Rank = 3; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + double pow = 0; + PyObject *pow_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + double fcvar = 0; + double sum2nd = 0; + double *fc_asr = NULL; + npy_intp fc_asr_Dims[3] = {-1, -1, -1}; + const int fc_asr_Rank = 3; + PyArrayObject *capi_fc_asr_as_array = NULL; + int capi_fc_asr_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"fc","pow","sclat","pbc","verbose","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:secondorder.second_order_asr.impose_asr_2nd",\ + capi_kwlist,&fc_capi,&pow_capi,&sclat_capi,&pbc_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr_2nd: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable pow */ + f2py_success = double_from_pyobj(&pow,pow_capi,"secondorder.second_order_asr.impose_asr_2nd() 2nd argument (pow) can't be converted to double"); + if (f2py_success) { + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr_2nd: failed to create array from the 3rd argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable verbose */ + verbose = (int)PyObject_IsTrue(verbose_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable fcvar */ + /* Processing variable sum2nd */ + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_asr.impose_asr_2nd() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_asr_2nd:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 2); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.impose_asr_2nd() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 2) == n_blocks,"shape(fc, 2) == n_blocks","2nd keyword n_blocks","impose_asr_2nd:n_blocks=%d",n_blocks) { + /* Processing variable fc_asr */ + fc_asr_Dims[0]=3 * nat,fc_asr_Dims[1]=3 * nat,fc_asr_Dims[2]=n_blocks; + capi_fc_asr_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr_2nd: failed to create array from the hidden `fc_asr`"; + capi_fc_asr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_asr_Dims,fc_asr_Rank, capi_fc_asr_intent,Py_None,capi_errmess); + if (capi_fc_asr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_asr = (double *)(PyArray_DATA(capi_fc_asr_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,&pow,sclat,&pbc,&verbose,&fcvar,&sum2nd,fc_asr,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("ddN",fcvar,sum2nd,capi_fc_asr_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_asr_as_array == NULL) ... else of fc_asr */ + /* End of cleaning variable fc_asr */ + } /*CHECKSCALAR(shape(fc, 2) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + /* End of cleaning variable sum2nd */ + /* End of cleaning variable fcvar */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + } /*if (f2py_success) of pow*/ + /* End of cleaning variable pow */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of impose_asr_2nd ***************************/ + +/********************************* impose_asr *********************************/ +static char doc_f2py_rout_secondorder_second_order_asr_impose_asr[] = "\ +fc_out = impose_asr(fc,r2,pow,sclat,pbc,threshold,maxite,verbose,[nat,n_blocks])\n\nWrapper for ``impose_asr``.\ +\n\nParameters\n----------\n" +"fc : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" +"r2 : input rank-2 array('i') with bounds (3,n_blocks)\n" +"pow : input float\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"threshold : input float\n" +"maxite : input int\n" +"verbose : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(fc, 2)\n" +"\nReturns\n-------\n" +"fc_out : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_secondorder_second_order_asr_impose_asr(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,int*,int*,double*,int*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[3] = {-1, -1, -1}; + const int fc_Rank = 3; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + int *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + double pow = 0; + PyObject *pow_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + double threshold = 0; + PyObject *threshold_capi = Py_None; + int maxite = 0; + PyObject *maxite_capi = Py_None; + double *fc_out = NULL; + npy_intp fc_out_Dims[3] = {-1, -1, -1}; + const int fc_out_Rank = 3; + PyArrayObject *capi_fc_out_as_array = NULL; + int capi_fc_out_intent = 0; + int verbose = 0; + PyObject *verbose_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"fc","r2","pow","sclat","pbc","threshold","maxite","verbose","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:secondorder.second_order_asr.impose_asr",\ + capi_kwlist,&fc_capi,&r2_capi,&pow_capi,&sclat_capi,&pbc_capi,&threshold_capi,&maxite_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable pow */ + f2py_success = double_from_pyobj(&pow,pow_capi,"secondorder.second_order_asr.impose_asr() 3rd argument (pow) can't be converted to double"); + if (f2py_success) { + /* Processing variable threshold */ + f2py_success = double_from_pyobj(&threshold,threshold_capi,"secondorder.second_order_asr.impose_asr() 6th argument (threshold) can't be converted to double"); + if (f2py_success) { + /* Processing variable maxite */ + f2py_success = int_from_pyobj(&maxite,maxite_capi,"secondorder.second_order_asr.impose_asr() 7th argument (maxite) can't be converted to int"); + if (f2py_success) { + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the 4th argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable verbose */ + verbose = (int)PyObject_IsTrue(verbose_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_asr.impose_asr() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_asr:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 2); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.impose_asr() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 2) == n_blocks,"shape(fc, 2) == n_blocks","2nd keyword n_blocks","impose_asr:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the 2nd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_INT,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (int *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable fc_out */ + fc_out_Dims[0]=3 * nat,fc_out_Dims[1]=3 * nat,fc_out_Dims[2]=n_blocks; + capi_fc_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the hidden `fc_out`"; + capi_fc_out_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_out_Dims,fc_out_Rank, capi_fc_out_intent,Py_None,capi_errmess); + if (capi_fc_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = secondorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_out = (double *)(PyArray_DATA(capi_fc_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r2,&pow,sclat,&pbc,&threshold,&maxite,fc_out,&verbose,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_out_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_out_as_array == NULL) ... else of fc_out */ + /* End of cleaning variable fc_out */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 2) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + } /*if (f2py_success) of maxite*/ + /* End of cleaning variable maxite */ + } /*if (f2py_success) of threshold*/ + /* End of cleaning variable threshold */ + } /*if (f2py_success) of pow*/ + /* End of cleaning variable pow */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of impose_asr *****************************/ +/*eof body*/ + +/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ + +static FortranDataDef f2py_second_order_centering_def[] = { + {"analysis",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_analysis,doc_f2py_rout_secondorder_second_order_centering_analysis}, + {"center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_center,doc_f2py_rout_secondorder_second_order_centering_center}, + {"within_dmax",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_within_dmax,doc_f2py_rout_secondorder_second_order_centering_within_dmax}, + {"compute_perimeter",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_compute_perimeter,doc_f2py_rout_secondorder_second_order_centering_compute_perimeter}, + {"cryst_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_cryst_to_cart,doc_f2py_rout_secondorder_second_order_centering_cryst_to_cart}, + {NULL} +}; + +static void f2py_setup_second_order_centering(char *analysis,char *center,char *within_dmax,char *compute_perimeter,char *cryst_to_cart) { + int i_f2py=0; + f2py_second_order_centering_def[i_f2py++].data = analysis; + f2py_second_order_centering_def[i_f2py++].data = center; + f2py_second_order_centering_def[i_f2py++].data = within_dmax; + f2py_second_order_centering_def[i_f2py++].data = compute_perimeter; + f2py_second_order_centering_def[i_f2py++].data = cryst_to_cart; +} +extern void F_FUNC_US(f2pyinitsecond_order_centering,F2PYINITSECOND_ORDER_CENTERING)(void (*)(char *,char *,char *,char *,char *)); +static void f2py_init_second_order_centering(void) { + F_FUNC_US(f2pyinitsecond_order_centering,F2PYINITSECOND_ORDER_CENTERING)(f2py_setup_second_order_centering); +} + + +static FortranDataDef f2py_second_order_asr_def[] = { + {"perm_initialized",0,{{-1}},NPY_INT, 1}, + {"p",1,{{-1}},NPY_INT, 1}, + {"initialize_perm",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_initialize_perm,doc_f2py_rout_secondorder_second_order_asr_initialize_perm}, + {"clear_all",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_clear_all,doc_f2py_rout_secondorder_second_order_asr_clear_all}, + {"geq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_geq,doc_f2py_rout_secondorder_second_order_asr_geq}, + {"impose_perm_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_impose_perm_sym,doc_f2py_rout_secondorder_second_order_asr_impose_perm_sym}, + {"impose_asr_2nd",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_impose_asr_2nd,doc_f2py_rout_secondorder_second_order_asr_impose_asr_2nd}, + {"impose_asr",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_impose_asr,doc_f2py_rout_secondorder_second_order_asr_impose_asr}, + {NULL} +}; + +static void f2py_setup_second_order_asr(char *perm_initialized,void (*p)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *initialize_perm,char *clear_all,char *geq,char *impose_perm_sym,char *impose_asr_2nd,char *impose_asr) { + int i_f2py=0; + f2py_second_order_asr_def[i_f2py++].data = perm_initialized; + f2py_second_order_asr_def[i_f2py++].func = p; + f2py_second_order_asr_def[i_f2py++].data = initialize_perm; + f2py_second_order_asr_def[i_f2py++].data = clear_all; + f2py_second_order_asr_def[i_f2py++].data = geq; + f2py_second_order_asr_def[i_f2py++].data = impose_perm_sym; + f2py_second_order_asr_def[i_f2py++].data = impose_asr_2nd; + f2py_second_order_asr_def[i_f2py++].data = impose_asr; +} +extern void F_FUNC_US(f2pyinitsecond_order_asr,F2PYINITSECOND_ORDER_ASR)(void (*)(char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *,char *,char *,char *,char *,char *)); +static void f2py_init_second_order_asr(void) { + F_FUNC_US(f2pyinitsecond_order_asr,F2PYINITSECOND_ORDER_ASR)(f2py_setup_second_order_asr); +} + +/*need_f90modhooks*/ + +/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ + +/******************* See f2py2e/common_rules.py: buildhooks *******************/ + +/*need_commonhooks*/ + +/**************************** See f2py2e/rules.py ****************************/ + +static FortranDataDef f2py_routine_defs[] = { + +/*eof routine_defs*/ + {NULL} +}; + +static PyMethodDef f2py_module_methods[] = { + + {NULL,NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "secondorder", + NULL, + -1, + f2py_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit_secondorder(void) { + int i; + PyObject *m,*d, *s, *tmp; + m = secondorder_module = PyModule_Create(&moduledef); + Py_SET_TYPE(&PyFortran_Type, &PyType_Type); + import_array(); + if (PyErr_Occurred()) + {PyErr_SetString(PyExc_ImportError, "can't initialize module secondorder (failed to import numpy)"); return m;} + d = PyModule_GetDict(m); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + s = PyUnicode_FromString( + "This module 'secondorder' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" +"Fortran 90/95 modules:\n"" second_order_centering --- analysis(),center(),within_dmax(),compute_perimeter(),cryst_to_cart()"" second_order_asr --- perm_initialized,p,initialize_perm(),clear_all(),geq(),impose_perm_sym(),impose_asr_2nd(),impose_asr()""."); + PyDict_SetItemString(d, "__doc__", s); + Py_DECREF(s); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__f2py_numpy_version__", s); + Py_DECREF(s); + secondorder_error = PyErr_NewException ("secondorder.error", NULL, NULL); + /* + * Store the error object inside the dict, so that it could get deallocated. + * (in practice, this is a module, so it likely will not and cannot.) + */ + PyDict_SetItemString(d, "_secondorder_error", secondorder_error); + Py_DECREF(secondorder_error); + for(i=0;f2py_routine_defs[i].name!=NULL;i++) { + tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); + PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); + Py_DECREF(tmp); + } + + + + + + + + + + + +/*eof initf2pywraphooks*/ + PyDict_SetItemString(d, "second_order_asr", PyFortranObject_New(f2py_second_order_asr_def,f2py_init_second_order_asr)); + PyDict_SetItemString(d, "second_order_centering", PyFortranObject_New(f2py_second_order_centering_def,f2py_init_second_order_centering)); +/*eof initf90modhooks*/ + +/*eof initcommonhooks*/ + + +#ifdef F2PY_REPORT_ATEXIT + if (! PyErr_Occurred()) + on_exit(f2py_report_on_exit,(void*)"secondorder"); +#endif + return m; +} +#ifdef __cplusplus +} +#endif diff --git a/f2py_wrappers/symph-f2pywrappers.f b/f2py_wrappers/symph-f2pywrappers.f new file mode 100644 index 00000000..46685d0b --- /dev/null +++ b/f2py_wrappers/symph-f2pywrappers.f @@ -0,0 +1,27 @@ +C -*- fortran -*- +C This file is autogenerated with f2py (version:1.26.4) +C It contains Fortran 77 wrappers to fortran functions. + + subroutine f2pywrapwsweight (wsweightf2pywrap, r, rws, nrws, + & nrwsx) + external wsweight + integer nrws + integer nrwsx + double precision r(3) + double precision rws(4,nrwsx) + double precision wsweightf2pywrap + double precision wsweight + wsweightf2pywrap = wsweight(r, rws, nrws, nrwsx) + end + + + subroutine f2pywrapeqvect (eqvectf2pywrap, x, y, f) + external eqvect + double precision x(3) + double precision y(3) + double precision f(3) + logical eqvectf2pywrap + logical eqvect + eqvectf2pywrap = .not.(.not.eqvect(x, y, f)) + end + diff --git a/f2py_wrappers/symph-f2pywrappers2.f90 b/f2py_wrappers/symph-f2pywrappers2.f90 new file mode 100644 index 00000000..1110596e --- /dev/null +++ b/f2py_wrappers/symph-f2pywrappers2.f90 @@ -0,0 +1,275 @@ +! -*- f90 -*- +! This file is autogenerated with f2py (version:1.26.4) +! It contains Fortran 90 wrappers to fortran functions. + + subroutine f2pywrapget_latvec (tau_sc, tau, itau, latvec, nat, nat& + &_sc, nr, f2py_itau_d0) + integer nat + integer nat_sc + integer nr + integer f2py_itau_d0 + double precision tau_sc(3,nat_sc) + double precision tau(3,nat) + integer itau(f2py_itau_d0) + double precision latvec(nr,3) + interface + + subroutine get_latvec(tau_sc,tau,itau,latvec,nat,nat_sc,nr) + double precision, dimension(3,nat_sc),intent(in) :: tau_& + &sc + double precision, dimension(3, nat),intent(in) :: tau + integer, dimension(:),intent(in) :: itau + double precision, dimension(nr,3),intent(out) :: latvec + integer :: nat + integer :: nat_sc + integer :: nr + end subroutine get_latvec + end interface + call get_latvec(tau_sc, tau, itau, latvec, nat, nat_sc, nr) + end + + + + subroutine f2pyinitconstants(f2pysetupfunc) + use constants, only : pi + use constants, only : tpi + use constants, only : fpi + use constants, only : sqrtpi + use constants, only : sqrtpm1 + use constants, only : sqrt2 + use constants, only : h_planck_si + use constants, only : k_boltzmann_si + use constants, only : electron_si + use constants, only : electronvolt_si + use constants, only : electronmass_si + use constants, only : hartree_si + use constants, only : rydberg_si + use constants, only : bohr_radius_si + use constants, only : amu_si + use constants, only : c_si + use constants, only : munought_si + use constants, only : epsnought_si + use constants, only : k_boltzmann_au + use constants, only : k_boltzmann_ry + use constants, only : autoev + use constants, only : rytoev + use constants, only : amu_au + use constants, only : amu_ry + use constants, only : au_sec + use constants, only : au_ps + use constants, only : au_gpa + use constants, only : ry_kbar + use constants, only : debye_si + use constants, only : au_debye + use constants, only : ev_to_kelvin + use constants, only : ry_to_kelvin + use constants, only : evtonm + use constants, only : rytonm + use constants, only : c_au + use constants, only : eps4 + use constants, only : eps6 + use constants, only : eps8 + use constants, only : eps12 + use constants, only : eps14 + use constants, only : eps16 + use constants, only : eps24 + use constants, only : eps32 + use constants, only : gsmall + use constants, only : e2 + use constants, only : degspin + use constants, only : bohr_radius_cm + use constants, only : bohr_radius_angs + use constants, only : angstrom_au + use constants, only : dip_debye + use constants, only : au_terahertz + use constants, only : au_to_ohmcmm1 + use constants, only : ry_to_thz + use constants, only : ry_to_ghz + use constants, only : ry_to_cmm1 + use constants, only : avogadro + external f2pysetupfunc + call f2pysetupfunc(pi,tpi,fpi,sqrtpi,sqrtpm1,sqrt2,h_planck_si,k_b& + &oltzmann_si,electron_si,electronvolt_si,electronmass_si,hartree_si& + &,rydberg_si,bohr_radius_si,amu_si,c_si,munought_si,epsnought_si,k_& + &boltzmann_au,k_boltzmann_ry,autoev,rytoev,amu_au,amu_ry,au_sec,au_& + &ps,au_gpa,ry_kbar,debye_si,au_debye,ev_to_kelvin,ry_to_kelvin,evto& + &nm,rytonm,c_au,eps4,eps6,eps8,eps12,eps14,eps16,eps24,eps32,gsmall& + &,e2,degspin,bohr_radius_cm,bohr_radius_angs,angstrom_au,dip_debye,& + &au_terahertz,au_to_ohmcmm1,ry_to_thz,ry_to_ghz,ry_to_cmm1,avogadro& + &) + end subroutine f2pyinitconstants + + + subroutine f2pyinitio_global(f2pysetupfunc) + use io_global, only : stdout + use io_global, only : ionode + use io_global, only : ionode_id + use io_global, only : meta_ionode + use io_global, only : meta_ionode_id + use io_global, only : xmlinputunit + use io_global, only : xmloutputunit + use io_global, only : xmltmpunit + use io_global, only : io_global_start + use io_global, only : meta_io_global_start + use io_global, only : io_global_getionode + use io_global, only : io_global_getmeta + external f2pysetupfunc + call f2pysetupfunc(stdout,ionode,ionode_id,meta_ionode,meta_ionode& + &_id,xmlinputunit,xmloutputunit,xmltmpunit,io_global_start,meta_io_& + &global_start,io_global_getionode,io_global_getmeta) + end subroutine f2pyinitio_global + + + subroutine f2pyinitkinds(f2pysetupfunc) + use kinds, only : dp + use kinds, only : sgl + use kinds, only : i4b + use kinds, only : print_kind_info + external f2pysetupfunc + call f2pysetupfunc(dp,sgl,i4b,print_kind_info) + end subroutine f2pyinitkinds + + subroutine f2py_symm_base_getdims_irt(r,s,f2pysetdata,flag) + use symm_base, only: d => irt + + 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_symm_base_getdims_irt + subroutine f2pywrap_symm_base_copy_sym (copy_symf2pywrap, nrot_, s& + &ym) + use symm_base, only : copy_sym + integer nrot_ + logical sym(48) + integer copy_symf2pywrap + copy_symf2pywrap = copy_sym(nrot_, sym) + end subroutine f2pywrap_symm_base_copy_sym + subroutine f2pywrap_symm_base_is_group (is_groupf2pywrap) + use symm_base, only : is_group + logical is_groupf2pywrap + is_groupf2pywrap = .not.(.not.is_group()) + end subroutine f2pywrap_symm_base_is_group + subroutine f2pywrap_symm_base_eqvect (eqvectf2pywrap, x, y, f) + use symm_base, only : eqvect + double precision x(3) + double precision y(3) + double precision f(3) + logical eqvectf2pywrap + eqvectf2pywrap = .not.(.not.eqvect(x, y, f)) + end subroutine f2pywrap_symm_base_eqvect + subroutine f2pywrap_symm_base_checksym (checksymf2pywrap, irot, na& + &t, ityp, xau, rau, ft_) + use symm_base, only : checksym + integer irot + integer nat + integer ityp(nat) + double precision xau(3,nat) + double precision rau(3,nat) + double precision ft_(3) + logical checksymf2pywrap + checksymf2pywrap = .not.(.not.checksym(irot, nat, ityp, xau, rau, & + &ft_)) + end subroutine f2pywrap_symm_base_checksym + + subroutine f2pyinitsymm_base(f2pysetupfunc) + use symm_base, only : eps1 + use symm_base, only : eps2 + use symm_base, only : s + use symm_base, only : sr + use symm_base, only : sname + use symm_base, only : ft + use symm_base, only : ftau + use symm_base, only : nrot + use symm_base, only : nsym + use symm_base, only : nsym_ns + use symm_base, only : nsym_na + use symm_base, only : t_rev + use symm_base, only : no_t_rev + use symm_base, only : time_reversal + use symm_base, only : irt + use symm_base, only : invs + use symm_base, only : invsym + use symm_base, only : d1 + use symm_base, only : d2 + use symm_base, only : d3 + use symm_base, only : allfrac + use symm_base, only : nofrac + use symm_base, only : nosym + use symm_base, only : nosym_evc + use symm_base, only : at + use symm_base, only : bg + use symm_base, only : set_accep_threshold + use symm_base, only : get_accep_threshold + use symm_base, only : set_at_bg + use symm_base, only : inverse_s + use symm_base, only : set_sym_bl + use symm_base, only : find_sym + use symm_base, only : sgam_at + use symm_base, only : sgam_at_mag + use symm_base, only : set_sym + use symm_base, only : checkallsym + use symm_base, only : s_axis_to_cart + use symm_base, only : smallg_q + interface + subroutine f2pywrap_symm_base_copy_sym (copy_symf2pywrap, nrot_, s& + &ym) + integer nrot_ + logical sym(48) + integer copy_symf2pywrap + end subroutine f2pywrap_symm_base_copy_sym + subroutine f2pywrap_symm_base_is_group (is_groupf2pywrap, is_group& + &) + logical is_groupf2pywrap + end subroutine f2pywrap_symm_base_is_group + subroutine f2pywrap_symm_base_eqvect (eqvectf2pywrap, x, y, f) + double precision x(3) + double precision y(3) + double precision f(3) + logical eqvectf2pywrap + end subroutine f2pywrap_symm_base_eqvect + subroutine f2pywrap_symm_base_checksym (checksymf2pywrap, irot, na& + &t, ityp, xau, rau, ft_) + integer irot + integer nat + integer ityp(nat) + double precision xau(3,nat) + double precision rau(3,nat) + double precision ft_(3) + logical checksymf2pywrap + end subroutine f2pywrap_symm_base_checksym + end interface + external f2pysetupfunc + external f2py_symm_base_getdims_irt + call f2pysetupfunc(eps1,eps2,s,sr,sname,ft,ftau,nrot,nsym,nsym_ns,& + &nsym_na,t_rev,no_t_rev,time_reversal,f2py_symm_base_getdims_irt,in& + &vs,invsym,d1,d2,d3,allfrac,nofrac,nosym,nosym_evc,at,bg,set_accep_& + &threshold,get_accep_threshold,set_at_bg,inverse_s,set_sym_bl,find_& + &sym,sgam_at,sgam_at_mag,set_sym,f2pywrap_symm_base_copy_sym,f2pywr& + &ap_symm_base_is_group,f2pywrap_symm_base_eqvect,f2pywrap_symm_base& + &_checksym,checkallsym,s_axis_to_cart,smallg_q) + end subroutine f2pyinitsymm_base + + diff --git a/f2py_wrappers/symphmodule.c b/f2py_wrappers/symphmodule.c new file mode 100644 index 00000000..e79cd690 --- /dev/null +++ b/f2py_wrappers/symphmodule.c @@ -0,0 +1,13669 @@ +/* File: symphmodule.c + * This file is auto-generated with f2py (version:1.26.4). + * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, + * written by Pearu Peterson . + * Generation date: Fri Sep 12 13:31:39 2025 + * Do not edit this file directly unless you know what you are doing!!! + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ + +/* Unconditionally included */ +#include +#include + +/*********************** See f2py2e/cfuncs.py: includes ***********************/ +#include "fortranobject.h" +#include +#include + +/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ +static PyObject *symph_error; +static PyObject *symph_module; + +/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ +typedef char * string; +typedef struct {double r,i;} complex_double; + +/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ +/*need_typedefs_generated*/ + +/********************** See f2py2e/cfuncs.py: cppmacros **********************/ +#define FAILNULL(p) do { \ + if ((p) == NULL) { \ + PyErr_SetString(PyExc_MemoryError, "NULL pointer found"); \ + goto capi_fail; \ + } \ +} while (0) + + +#define STRINGMALLOC(str,len)\ + if ((str = (string)malloc(len+1)) == NULL) {\ + PyErr_SetString(PyExc_MemoryError, "out of memory");\ + goto capi_fail;\ + } else {\ + (str)[len] = '\0';\ + } + + +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F +#else +#define F_FUNC(f,F) _##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F##_ +#else +#define F_FUNC(f,F) _##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F +#else +#define F_FUNC(f,F) f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F##_ +#else +#define F_FUNC(f,F) f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) +#else +#define F_FUNC_US(f,F) F_FUNC(f,F) +#endif + + +/* See fortranobject.h for definitions. The macros here are provided for BC. */ +#define rank f2py_rank +#define shape f2py_shape +#define fshape f2py_shape +#define len f2py_len +#define flen f2py_flen +#define slen f2py_slen +#define size f2py_size + + +#define STRINGFREE(str) do {if (!(str == NULL)) free(str);} while (0) + + +/* +STRINGPADN replaces null values with padding values from the right. + +`to` must have size of at least N bytes. + +If the `to[N-1]` has null value, then replace it and all the +preceding, nulls with the given padding. + +STRINGPADN(to, N, PADDING, NULLVALUE) is an inverse operation. +*/ +#define STRINGPADN(to, N, NULLVALUE, PADDING) \ + do { \ + int _m = (N); \ + char *_to = (to); \ + for (_m -= 1; _m >= 0 && _to[_m] == NULLVALUE; _m--) { \ + _to[_m] = PADDING; \ + } \ + } while (0) + + +#ifdef DEBUGCFUNCS +#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); +#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ + PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ + fprintf(stderr,"\n"); +#else +#define CFUNCSMESS(mess) +#define CFUNCSMESSPY(mess,obj) +#endif + + +#ifndef max +#define max(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) ((a < b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef MIN +#define MIN(a,b) ((a < b) ? (a) : (b)) +#endif + + +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F +#else +#define F_WRAPPEDFUNC(f,F) _f2pywrap##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F##_ +#else +#define F_WRAPPEDFUNC(f,F) _f2pywrap##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F +#else +#define F_WRAPPEDFUNC(f,F) f2pywrap##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F##_ +#else +#define F_WRAPPEDFUNC(f,F) f2pywrap##f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f##_,F##_) +#else +#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f,F) +#endif + + +#define CHECKSCALAR(check,tcheck,name,show,var)\ + if (!(check)) {\ + char errstring[256];\ + sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ + PyErr_SetString(symph_error,errstring);\ + /*goto capi_fail;*/\ + } else + +#define CHECKARRAY(check,tcheck,name) \ + if (!(check)) {\ + PyErr_SetString(symph_error,"("tcheck") failed for "name);\ + /*goto capi_fail;*/\ + } else + +/* +STRINGCOPYN copies N bytes. + +`to` and `from` buffers must have sizes of at least N bytes. +*/ +#define STRINGCOPYN(to,from,N) \ + do { \ + int _m = (N); \ + char *_to = (to); \ + char *_from = (from); \ + FAILNULL(_to); FAILNULL(_from); \ + (void)strncpy(_to, _from, _m); \ + } while (0) + + +/************************ See f2py2e/cfuncs.py: cfuncs ************************/ + +/* + Create a new string buffer `str` of at most length `len` from a + Python string-like object `obj`. + + The string buffer has given size (len) or the size of inistr when len==-1. + + The string buffer is padded with blanks: in Fortran, trailing blanks + are insignificant contrary to C nulls. + */ +static int +string_from_pyobj(string *str, int *len, const string inistr, PyObject *obj, + const char *errmess) +{ + PyObject *tmp = NULL; + string buf = NULL; + npy_intp n = -1; +#ifdef DEBUGCFUNCS +fprintf(stderr,"string_from_pyobj(str='%s',len=%d,inistr='%s',obj=%p)\n", + (char*)str, *len, (char *)inistr, obj); +#endif + if (obj == Py_None) { + n = strlen(inistr); + buf = inistr; + } + else if (PyArray_Check(obj)) { + PyArrayObject *arr = (PyArrayObject *)obj; + if (!ISCONTIGUOUS(arr)) { + PyErr_SetString(PyExc_ValueError, + "array object is non-contiguous."); + goto capi_fail; + } + n = PyArray_NBYTES(arr); + buf = PyArray_DATA(arr); + n = strnlen(buf, n); + } + else { + if (PyBytes_Check(obj)) { + tmp = obj; + Py_INCREF(tmp); + } + else if (PyUnicode_Check(obj)) { + tmp = PyUnicode_AsASCIIString(obj); + } + else { + PyObject *tmp2; + tmp2 = PyObject_Str(obj); + if (tmp2) { + tmp = PyUnicode_AsASCIIString(tmp2); + Py_DECREF(tmp2); + } + else { + tmp = NULL; + } + } + if (tmp == NULL) goto capi_fail; + n = PyBytes_GET_SIZE(tmp); + buf = PyBytes_AS_STRING(tmp); + } + if (*len == -1) { + /* TODO: change the type of `len` so that we can remove this */ + if (n > NPY_MAX_INT) { + PyErr_SetString(PyExc_OverflowError, + "object too large for a 32-bit int"); + goto capi_fail; + } + *len = n; + } + else if (*len < n) { + /* discard the last (len-n) bytes of input buf */ + n = *len; + } + if (n < 0 || *len < 0 || buf == NULL) { + goto capi_fail; + } + STRINGMALLOC(*str, *len); // *str is allocated with size (*len + 1) + if (n < *len) { + /* + Pad fixed-width string with nulls. The caller will replace + nulls with blanks when the corresponding argument is not + intent(c). + */ + memset(*str + n, '\0', *len - n); + } + STRINGCOPYN(*str, buf, n); + Py_XDECREF(tmp); + return 1; +capi_fail: + Py_XDECREF(tmp); + { + PyObject* err = PyErr_Occurred(); + if (err == NULL) { + err = symph_error; + } + PyErr_SetString(err, errmess); + } + return 0; +} + + +static int +int_from_pyobj(int* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + + if (PyLong_Check(obj)) { + *v = Npy__PyLong_AsInt(obj); + return !(*v == -1 && PyErr_Occurred()); + } + + tmp = PyNumber_Long(obj); + if (tmp) { + *v = Npy__PyLong_AsInt(tmp); + Py_DECREF(tmp); + return !(*v == -1 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (int_from_pyobj(v, tmp, errmess)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + + { + PyObject* err = PyErr_Occurred(); + if (err == NULL) { + err = symph_error; + } + PyErr_SetString(err, errmess); + } + return 0; +} + + +static int +double_from_pyobj(double* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + if (PyFloat_Check(obj)) { + *v = PyFloat_AsDouble(obj); + return !(*v == -1.0 && PyErr_Occurred()); + } + + tmp = PyNumber_Float(obj); + if (tmp) { + *v = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return !(*v == -1.0 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} + Py_DECREF(tmp); + } + { + PyObject* err = PyErr_Occurred(); + if (err==NULL) err = symph_error; + PyErr_SetString(err,errmess); + } + return 0; +} + + +/********************* See f2py2e/cfuncs.py: userincludes *********************/ +/*need_userincludes*/ + +/********************* See f2py2e/capi_rules.py: usercode *********************/ + + +/* See f2py2e/rules.py */ +extern void F_FUNC(errore,ERRORE)(string,string,int*,size_t,size_t); +extern void F_FUNC(infomsg,INFOMSG)(string,string,size_t,size_t); +extern void F_WRAPPEDFUNC_US(get_latvec,GET_LATVEC)(double*,double*,int*,double*,int*,int*,int*,int*); +extern void F_FUNC_US(rotate_and_add_dyn,ROTATE_AND_ADD_DYN)(complex_double*,complex_double*,int*,int*,int*,int*,int*,double*,double*); +extern void F_FUNC_US(set_irotmq,SET_IROTMQ)(double*,int*,int*,int*,int*,int*,double*,double*,int*); +extern void F_FUNC(symmatrix,SYMMATRIX)(double*,int*,int*,double*,double*); +extern void F_FUNC_US(cart_to_crys_mat,CART_TO_CRYS_MAT)(double*,double*); +extern void F_FUNC_US(crys_to_cart_mat,CRYS_TO_CART_MAT)(double*,double*); +extern void F_FUNC_US(contract_two_ph_propagator,CONTRACT_TWO_PH_PROPAGATOR)(double*,double*,double*,double*,double*,complex_double*,int*,int*); +extern void F_FUNC_US(get_two_phonon_propagator,GET_TWO_PHONON_PROPAGATOR)(double*,double*,double*,double*,complex_double*,int*); +extern void F_FUNC_US(fc_supercell_from_dyn,FC_SUPERCELL_FROM_DYN)(complex_double*,double*,double*,double*,int*,double*,int*,int*); +extern void F_FUNC_US(fast_ft_real_space_from_dynq,FAST_FT_REAL_SPACE_FROM_DYNQ)(double*,double*,int*,int*,int*,int*,double*,complex_double*,complex_double*); +extern void F_FUNC_US(impose_trans_sc,IMPOSE_TRANS_SC)(double*,double*,int*,int*); +extern void F_FUNC_US(dyn_from_fc,DYN_FROM_FC)(double*,double*,double*,double*,int*,complex_double*,int*,int*); +extern void F_FUNC_US(get_q_grid,GET_Q_GRID)(double*,int*,double*,int*); +extern void F_FUNC_US(star_q,STAR_Q)(double*,double*,double*,int*,int*,int*,int*,double*,int*,int*,int*); +extern void F_FUNC(symvector,SYMVECTOR)(int*,int*,int*,int*,double*,double*,double*); +extern void F_FUNC_US(cryst_to_cart,CRYST_TO_CART)(int*,double*,double*,int*); +extern void F_FUNC_US(flush_unit,FLUSH_UNIT)(int*); +extern void F_FUNC_US(get_translations,GET_TRANSLATIONS)(double*,double*,int*,int*,int*); +extern void F_FUNC_US(q2qstar_out,Q2QSTAR_OUT)(complex_double*,double*,double*,int*,int*,int*,int*,int*,double*,int*,double*,int*,int*,int*,complex_double*); +extern void F_FUNC_US(set_asr,SET_ASR)(string,int*,int*,double*,complex_double*,double*,size_t); +extern void F_FUNC_US(sp_zeu,SP_ZEU)(double*,double*,int*,double*); +extern void F_FUNC(sp1,SP1)(double*,double*,int*,double*); +extern void F_FUNC(sp2,SP2)(double*,double*,int*,int*,double*); +extern void F_FUNC(sp3,SP3)(double*,double*,int*,int*,int*,double*); +extern void F_FUNC_US(symdynph_gq_new,SYMDYNPH_GQ_NEW)(double*,complex_double*,int*,int*,double*,int*,int*,int*,int*,int*); +extern void F_FUNC(trntnsc,TRNTNSC)(complex_double*,double*,double*,int*); +extern void F_FUNC_US(rgd_blk,RGD_BLK)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); +extern void F_FUNC_US(rgd_blk_diff_phase_conv,RGD_BLK_DIFF_PHASE_CONV)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); +extern void F_FUNC(nonanal,NONANAL)(int*,int*,int*,double*,double*,double*,double*,complex_double*); +extern void F_FUNC(trasl,TRASL)(complex_double*,complex_double*,int*,int*,int*,int*,int*,int*,int*,int*); +extern void F_FUNC_US(frc_blk,FRC_BLK)(complex_double*,double*,double*,int*,int*,int*,int*,double*,double*,double*,int*,int*); +extern void F_FUNC(wsinit,WSINIT)(double*,int*,int*,double*); +extern void F_WRAPPEDFUNC(wsweight,WSWEIGHT)(double*,double*,double*,int*,int*); +extern void F_FUNC_US(get_frc,GET_FRC)(double*,double*,double*,double*,int*,double*,int*,int*,int*,int*,int*); +extern void F_FUNC_US(asign_supercell_index_new,ASIGN_SUPERCELL_INDEX_NEW)(double*,double*,int*,int*,int*); +extern void F_FUNC_US(q_gen,Q_GEN)(int*,double*,double*,double*,double*,double*); +extern void F_FUNC_US(set_tau,SET_TAU)(int*,int*,double*,double*,double*,double*,int*,int*,int*); +extern void F_FUNC_US(threetosix_real,THREETOSIX_REAL)(double*,double*,int*); +extern void F_FUNC_US(sixtothree_real,SIXTOTHREE_REAL)(double*,double*,int*); +extern void F_WRAPPEDFUNC(eqvect,EQVECT)(int*,double*,double*,double*); +extern void F_FUNC_US(get_equivalent_atoms,GET_EQUIVALENT_ATOMS)(double*,double*,double*,int*,int*,int*,int*); +extern void F_FUNC_US(get_closest_vector,GET_CLOSEST_VECTOR)(double*,double*,double*); +extern void F_FUNC_US(get_gr_data,GET_GR_DATA)(double*,double*,int*,int*,int*,double*,double*,int*,double*,double*,int*,int*); +extern void F_FUNC_US(fix_coords_in_unit_cell,FIX_COORDS_IN_UNIT_CELL)(double*,double*,double*,int*); +extern void F_FUNC(matinv3,MATINV3)(double*,double*); +extern void F_FUNC(invmat,INVMAT)(int*,double*,double*); +extern void F_FUNC(recips,RECIPS)(double*,double*,double*,double*,double*,double*); +extern void F_FUNC_US(sgam_ph_new,SGAM_PH_NEW)(double*,double*,int*,int*,int*,double*,double*,int*); +extern void F_FUNC_US(get_tau_sc_latvec,GET_TAU_SC_LATVEC)(double*,double*,double*,int*,int*,int*); +extern void F_FUNC_US(permute_v3,PERMUTE_V3)(double*,int*); +extern void F_FUNC_US(permute_v4,PERMUTE_V4)(double*,int*); +extern void F_FUNC_US(trans_v2,TRANS_V2)(double*,int*,int*,int*); +extern void F_FUNC_US(trans_v3,TRANS_V3)(double*,int*,int*,int*); +extern void F_FUNC_US(trans_v4,TRANS_V4)(double*,int*,int*,int*); +extern void F_FUNC_US(sym_v2,SYM_V2)(double*,double*,double*,int*,int*,int*,int*); +extern void F_FUNC_US(sym_v3,SYM_V3)(double*,double*,int*,int*,int*,int*); +extern void F_FUNC_US(sym_v4,SYM_V4)(double*,double*,int*,int*,int*,int*); +extern void F_FUNC_US(print_symm,PRINT_SYMM)(int*,int*,int*,int*,int*); +/*eof externroutines*/ + +/******************** See f2py2e/capi_rules.py: usercode1 ********************/ + + +/******************* See f2py2e/cb_rules.py: buildcallback *******************/ +/*need_callbacks*/ + +/*********************** See f2py2e/rules.py: buildapi ***********************/ + +/*********************************** errore ***********************************/ +static char doc_f2py_rout_symph_errore[] = "\ +errore(calling_routine,message,ierr)\n\nWrapper for ``errore``.\ +\n\nParameters\n----------\n" +"calling_routine : input string(len=-1)\n" +"message : input string(len=-1)\n" +"ierr : input int"; +/* extern void F_FUNC(errore,ERRORE)(string,string,int*,size_t,size_t); */ +static PyObject *f2py_rout_symph_errore(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(string,string,int*,size_t,size_t)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + string calling_routine = NULL; + int slen(calling_routine); + PyObject *calling_routine_capi = Py_None; + string message = NULL; + int slen(message); + PyObject *message_capi = Py_None; + int ierr = 0; + PyObject *ierr_capi = Py_None; + static char *capi_kwlist[] = {"calling_routine","message","ierr",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:symph.errore",\ + capi_kwlist,&calling_routine_capi,&message_capi,&ierr_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable calling_routine */ + slen(calling_routine) = -1; + f2py_success = string_from_pyobj(&calling_routine,&slen(calling_routine),"",calling_routine_capi,"string_from_pyobj failed in converting 1st argument`calling_routine' of symph.errore to C string"); + if (f2py_success) { + STRINGPADN(calling_routine, slen(calling_routine), '\0', ' '); + /* Processing variable message */ + slen(message) = -1; + f2py_success = string_from_pyobj(&message,&slen(message),"",message_capi,"string_from_pyobj failed in converting 2nd argument`message' of symph.errore to C string"); + if (f2py_success) { + STRINGPADN(message, slen(message), '\0', ' '); + /* Processing variable ierr */ + f2py_success = int_from_pyobj(&ierr,ierr_capi,"symph.errore() 3rd argument (ierr) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(calling_routine,message,&ierr,slen(calling_routine),slen(message)); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of ierr*/ + /* End of cleaning variable ierr */ + STRINGFREE(message); + } /*if (f2py_success) of message*/ + /* End of cleaning variable message */ + STRINGFREE(calling_routine); + } /*if (f2py_success) of calling_routine*/ + /* End of cleaning variable calling_routine */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of errore *******************************/ + +/********************************** infomsg **********************************/ +static char doc_f2py_rout_symph_infomsg[] = "\ +infomsg(routine,message)\n\nWrapper for ``infomsg``.\ +\n\nParameters\n----------\n" +"routine : input string(len=-1)\n" +"message : input string(len=-1)"; +/* extern void F_FUNC(infomsg,INFOMSG)(string,string,size_t,size_t); */ +static PyObject *f2py_rout_symph_infomsg(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(string,string,size_t,size_t)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + string routine = NULL; + int slen(routine); + PyObject *routine_capi = Py_None; + string message = NULL; + int slen(message); + PyObject *message_capi = Py_None; + static char *capi_kwlist[] = {"routine","message",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.infomsg",\ + capi_kwlist,&routine_capi,&message_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable routine */ + slen(routine) = -1; + f2py_success = string_from_pyobj(&routine,&slen(routine),"",routine_capi,"string_from_pyobj failed in converting 1st argument`routine' of symph.infomsg to C string"); + if (f2py_success) { + STRINGPADN(routine, slen(routine), '\0', ' '); + /* Processing variable message */ + slen(message) = -1; + f2py_success = string_from_pyobj(&message,&slen(message),"",message_capi,"string_from_pyobj failed in converting 2nd argument`message' of symph.infomsg to C string"); + if (f2py_success) { + STRINGPADN(message, slen(message), '\0', ' '); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(routine,message,slen(routine),slen(message)); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + STRINGFREE(message); + } /*if (f2py_success) of message*/ + /* End of cleaning variable message */ + STRINGFREE(routine); + } /*if (f2py_success) of routine*/ + /* End of cleaning variable routine */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of infomsg *******************************/ + +/********************************* get_latvec *********************************/ +static char doc_f2py_rout_symph_get_latvec[] = "\ +latvec = get_latvec(tau_sc,tau,itau,nr,[nat,nat_sc])\n\nWrapper for ``get_latvec``.\ +\n\nParameters\n----------\n" +"tau_sc : input rank-2 array('d') with bounds (3,nat_sc)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"itau : input rank-1 array('i') with bounds (f2py_itau_d0)\n" +"nr : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)\n" +"nat_sc : input int, optional\n Default: shape(tau_sc, 1)\n" +"\nReturns\n-------\n" +"latvec : rank-2 array('d') with bounds (nr,3)"; +/* extern void F_WRAPPEDFUNC_US(get_latvec,GET_LATVEC)(double*,double*,int*,double*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_get_latvec(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tau_sc = NULL; + npy_intp tau_sc_Dims[2] = {-1, -1}; + const int tau_sc_Rank = 2; + PyArrayObject *capi_tau_sc_as_array = NULL; + int capi_tau_sc_intent = 0; + PyObject *tau_sc_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + int *itau = NULL; + npy_intp itau_Dims[1] = {-1}; + const int itau_Rank = 1; + PyArrayObject *capi_itau_as_array = NULL; + int capi_itau_intent = 0; + PyObject *itau_capi = Py_None; + double *latvec = NULL; + npy_intp latvec_Dims[2] = {-1, -1}; + const int latvec_Rank = 2; + PyArrayObject *capi_latvec_as_array = NULL; + int capi_latvec_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + int nr = 0; + PyObject *nr_capi = Py_None; + int f2py_itau_d0 = 0; + static char *capi_kwlist[] = {"tau_sc","tau","itau","nr","nat","nat_sc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|OO:symph.get_latvec",\ + capi_kwlist,&tau_sc_capi,&tau_capi,&itau_capi,&nr_capi,&nat_capi,&nat_sc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable tau_sc */ + tau_sc_Dims[0]=3; + capi_tau_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the 1st argument `tau_sc`"; + capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); + if (capi_tau_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); + + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the 2nd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable itau */ + ; + capi_itau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the 3rd argument `itau`"; + capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); + if (capi_itau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau = (int *)(PyArray_DATA(capi_itau_as_array)); + + /* Processing variable nr */ + f2py_success = int_from_pyobj(&nr,nr_capi,"symph.get_latvec() 4th argument (nr) can't be converted to int"); + if (f2py_success) { + /* Processing variable latvec */ + latvec_Dims[0]=nr,latvec_Dims[1]=3; + capi_latvec_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the hidden `latvec`"; + capi_latvec_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,latvec_Dims,latvec_Rank, capi_latvec_intent,Py_None,capi_errmess); + if (capi_latvec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + latvec = (double *)(PyArray_DATA(capi_latvec_as_array)); + + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(tau_sc, 1); else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.get_latvec() 2nd keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau_sc, 1) == nat_sc,"shape(tau_sc, 1) == nat_sc","2nd keyword nat_sc","get_latvec:nat_sc=%d",nat_sc) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_latvec() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","get_latvec:nat=%d",nat) { + /* Processing variable f2py_itau_d0 */ + f2py_itau_d0 = shape(itau, 0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tau_sc,tau,itau,latvec,&nat,&nat_sc,&nr,&f2py_itau_d0); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_latvec_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_itau_d0 */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(tau_sc, 1) == nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + } /* if (capi_latvec_as_array == NULL) ... else of latvec */ + /* End of cleaning variable latvec */ + } /*if (f2py_success) of nr*/ + /* End of cleaning variable nr */ + if((PyObject *)capi_itau_as_array!=itau_capi) { + Py_XDECREF(capi_itau_as_array); } + } /* if (capi_itau_as_array == NULL) ... else of itau */ + /* End of cleaning variable itau */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { + Py_XDECREF(capi_tau_sc_as_array); } + } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ + /* End of cleaning variable tau_sc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of get_latvec *****************************/ + +/***************************** rotate_and_add_dyn *****************************/ +static char doc_f2py_rout_symph_rotate_and_add_dyn[] = "\ +phi2 = rotate_and_add_dyn(phi,isym,s,invs,irt,rtau,sxq,[nat])\n\nWrapper for ``rotate_and_add_dyn``.\ +\n\nParameters\n----------\n" +"phi : input rank-4 array('D') with bounds (3,3,nat,nat)\n" +"isym : input int\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"invs : input rank-1 array('i') with bounds (48)\n" +"irt : input rank-2 array('i') with bounds (48,nat)\n" +"rtau : input rank-3 array('d') with bounds (3,48,nat)\n" +"sxq : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(phi, 2)\n" +"\nReturns\n-------\n" +"phi2 : rank-4 array('D') with bounds (3,3,nat,nat)"; +/* extern void F_FUNC_US(rotate_and_add_dyn,ROTATE_AND_ADD_DYN)(complex_double*,complex_double*,int*,int*,int*,int*,int*,double*,double*); */ +static PyObject *f2py_rout_symph_rotate_and_add_dyn(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,complex_double*,int*,int*,int*,int*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *phi = NULL; + npy_intp phi_Dims[4] = {-1, -1, -1, -1}; + const int phi_Rank = 4; + PyArrayObject *capi_phi_as_array = NULL; + int capi_phi_intent = 0; + PyObject *phi_capi = Py_None; + complex_double *phi2 = NULL; + npy_intp phi2_Dims[4] = {-1, -1, -1, -1}; + const int phi2_Rank = 4; + PyArrayObject *capi_phi2_as_array = NULL; + int capi_phi2_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int isym = 0; + PyObject *isym_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *invs = NULL; + npy_intp invs_Dims[1] = {-1}; + const int invs_Rank = 1; + PyArrayObject *capi_invs_as_array = NULL; + int capi_invs_intent = 0; + PyObject *invs_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + double *rtau = NULL; + npy_intp rtau_Dims[3] = {-1, -1, -1}; + const int rtau_Rank = 3; + PyArrayObject *capi_rtau_as_array = NULL; + int capi_rtau_intent = 0; + PyObject *rtau_capi = Py_None; + double *sxq = NULL; + npy_intp sxq_Dims[1] = {-1}; + const int sxq_Rank = 1; + PyArrayObject *capi_sxq_as_array = NULL; + int capi_sxq_intent = 0; + PyObject *sxq_capi = Py_None; + static char *capi_kwlist[] = {"phi","isym","s","invs","irt","rtau","sxq","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:symph.rotate_and_add_dyn",\ + capi_kwlist,&phi_capi,&isym_capi,&s_capi,&invs_capi,&irt_capi,&rtau_capi,&sxq_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable isym */ + f2py_success = int_from_pyobj(&isym,isym_capi,"symph.rotate_and_add_dyn() 2nd argument (isym) can't be converted to int"); + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 3rd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable invs */ + invs_Dims[0]=48; + capi_invs_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 4th argument `invs`"; + capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); + if (capi_invs_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + invs = (int *)(PyArray_DATA(capi_invs_as_array)); + + /* Processing variable phi */ + phi_Dims[0]=3,phi_Dims[1]=3; + capi_phi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 1st argument `phi`"; + capi_phi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi_Dims,phi_Rank, capi_phi_intent,phi_capi,capi_errmess); + if (capi_phi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phi = (complex_double *)(PyArray_DATA(capi_phi_as_array)); + + /* Processing variable sxq */ + sxq_Dims[0]=3; + capi_sxq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 7th argument `sxq`"; + capi_sxq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sxq_Dims,sxq_Rank, capi_sxq_intent,sxq_capi,capi_errmess); + if (capi_sxq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sxq = (double *)(PyArray_DATA(capi_sxq_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(phi, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.rotate_and_add_dyn() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(phi, 2) == nat,"shape(phi, 2) == nat","1st keyword nat","rotate_and_add_dyn:nat=%d",nat) { + /* Processing variable irt */ + irt_Dims[0]=48,irt_Dims[1]=nat; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 5th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + + /* Processing variable phi2 */ + phi2_Dims[0]=3,phi2_Dims[1]=3,phi2_Dims[2]=nat,phi2_Dims[3]=nat; + capi_phi2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the hidden `phi2`"; + capi_phi2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi2_Dims,phi2_Rank, capi_phi2_intent,Py_None,capi_errmess); + if (capi_phi2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phi2 = (complex_double *)(PyArray_DATA(capi_phi2_as_array)); + + /* Processing variable rtau */ + rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; + capi_rtau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 6th argument `rtau`"; + capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,rtau_capi,capi_errmess); + if (capi_rtau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(phi,phi2,&nat,&isym,s,invs,irt,rtau,sxq); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_phi2_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_rtau_as_array!=rtau_capi) { + Py_XDECREF(capi_rtau_as_array); } + } /* if (capi_rtau_as_array == NULL) ... else of rtau */ + /* End of cleaning variable rtau */ + } /* if (capi_phi2_as_array == NULL) ... else of phi2 */ + /* End of cleaning variable phi2 */ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*CHECKSCALAR(shape(phi, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_sxq_as_array!=sxq_capi) { + Py_XDECREF(capi_sxq_as_array); } + } /* if (capi_sxq_as_array == NULL) ... else of sxq */ + /* End of cleaning variable sxq */ + if((PyObject *)capi_phi_as_array!=phi_capi) { + Py_XDECREF(capi_phi_as_array); } + } /* if (capi_phi_as_array == NULL) ... else of phi */ + /* End of cleaning variable phi */ + if((PyObject *)capi_invs_as_array!=invs_capi) { + Py_XDECREF(capi_invs_as_array); } + } /* if (capi_invs_as_array == NULL) ... else of invs */ + /* End of cleaning variable invs */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of isym*/ + /* End of cleaning variable isym */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of rotate_and_add_dyn *************************/ + +/********************************* set_irotmq *********************************/ +static char doc_f2py_rout_symph_set_irotmq[] = "\ +irotmq = set_irotmq(xq,s,nsymq,nsym,minus_q,bg,at,lgamma)\n\nWrapper for ``set_irotmq``.\ +\n\nParameters\n----------\n" +"xq : input rank-1 array('d') with bounds (3)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"nsymq : input int\n" +"nsym : input int\n" +"minus_q : input int\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"lgamma : input int\n" +"\nReturns\n-------\n" +"irotmq : int"; +/* extern void F_FUNC_US(set_irotmq,SET_IROTMQ)(double*,int*,int*,int*,int*,int*,double*,double*,int*); */ +static PyObject *f2py_rout_symph_set_irotmq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,int*,double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *xq = NULL; + npy_intp xq_Dims[1] = {-1}; + const int xq_Rank = 1; + PyArrayObject *capi_xq_as_array = NULL; + int capi_xq_intent = 0; + PyObject *xq_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int nsymq = 0; + PyObject *nsymq_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int irotmq = 0; + int minus_q = 0; + PyObject *minus_q_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + int lgamma = 0; + PyObject *lgamma_capi = Py_None; + static char *capi_kwlist[] = {"xq","s","nsymq","nsym","minus_q","bg","at","lgamma",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|:symph.set_irotmq",\ + capi_kwlist,&xq_capi,&s_capi,&nsymq_capi,&nsym_capi,&minus_q_capi,&bg_capi,&at_capi,&lgamma_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 7th argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 6th argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable xq */ + xq_Dims[0]=3; + capi_xq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 1st argument `xq`"; + capi_xq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xq_Dims,xq_Rank, capi_xq_intent,xq_capi,capi_errmess); + if (capi_xq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xq = (double *)(PyArray_DATA(capi_xq_as_array)); + + /* Processing variable minus_q */ + minus_q = (int)PyObject_IsTrue(minus_q_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 2nd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable nsymq */ + f2py_success = int_from_pyobj(&nsymq,nsymq_capi,"symph.set_irotmq() 3rd argument (nsymq) can't be converted to int"); + if (f2py_success) { + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.set_irotmq() 4th argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable lgamma */ + lgamma = (int)PyObject_IsTrue(lgamma_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable irotmq */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(xq,s,&nsymq,&nsym,&irotmq,&minus_q,bg,at,&lgamma); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",irotmq); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable irotmq */ + } /*if (f2py_success) of lgamma*/ + /* End of cleaning variable lgamma */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + } /*if (f2py_success) of nsymq*/ + /* End of cleaning variable nsymq */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of minus_q*/ + /* End of cleaning variable minus_q */ + if((PyObject *)capi_xq_as_array!=xq_capi) { + Py_XDECREF(capi_xq_as_array); } + } /* if (capi_xq_as_array == NULL) ... else of xq */ + /* End of cleaning variable xq */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of set_irotmq *****************************/ + +/********************************* symmatrix *********************************/ +static char doc_f2py_rout_symph_symmatrix[] = "\ +symmatrix(matr,s,nsym,at,bg)\n\nWrapper for ``symmatrix``.\ +\n\nParameters\n----------\n" +"matr : in/output rank-2 array('d') with bounds (3,3)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"nsym : input int\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)"; +/* extern void F_FUNC(symmatrix,SYMMATRIX)(double*,int*,int*,double*,double*); */ +static PyObject *f2py_rout_symph_symmatrix(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *matr = NULL; + npy_intp matr_Dims[2] = {-1, -1}; + const int matr_Rank = 2; + PyArrayObject *capi_matr_as_array = NULL; + int capi_matr_intent = 0; + PyObject *matr_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + static char *capi_kwlist[] = {"matr","s","nsym","at","bg",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:symph.symmatrix",\ + capi_kwlist,&matr_capi,&s_capi,&nsym_capi,&at_capi,&bg_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable matr */ + matr_Dims[0]=3,matr_Dims[1]=3; + capi_matr_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 1st argument `matr`"; + capi_matr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,matr_Dims,matr_Rank, capi_matr_intent,matr_capi,capi_errmess); + if (capi_matr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + matr = (double *)(PyArray_DATA(capi_matr_as_array)); + + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.symmatrix() 3rd argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 2nd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 4th argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 5th argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(matr,s,&nsym,at,bg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + if((PyObject *)capi_matr_as_array!=matr_capi) { + Py_XDECREF(capi_matr_as_array); } + } /* if (capi_matr_as_array == NULL) ... else of matr */ + /* End of cleaning variable matr */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of symmatrix ******************************/ + +/****************************** cart_to_crys_mat ******************************/ +static char doc_f2py_rout_symph_cart_to_crys_mat[] = "\ +cart_to_crys_mat(matr,at)\n\nWrapper for ``cart_to_crys_mat``.\ +\n\nParameters\n----------\n" +"matr : in/output rank-2 array('d') with bounds (3,3)\n" +"at : input rank-2 array('d') with bounds (3,3)"; +/* extern void F_FUNC_US(cart_to_crys_mat,CART_TO_CRYS_MAT)(double*,double*); */ +static PyObject *f2py_rout_symph_cart_to_crys_mat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *matr = NULL; + npy_intp matr_Dims[2] = {-1, -1}; + const int matr_Rank = 2; + PyArrayObject *capi_matr_as_array = NULL; + int capi_matr_intent = 0; + PyObject *matr_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + static char *capi_kwlist[] = {"matr","at",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.cart_to_crys_mat",\ + capi_kwlist,&matr_capi,&at_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable matr */ + matr_Dims[0]=3,matr_Dims[1]=3; + capi_matr_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.cart_to_crys_mat: failed to create array from the 1st argument `matr`"; + capi_matr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,matr_Dims,matr_Rank, capi_matr_intent,matr_capi,capi_errmess); + if (capi_matr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + matr = (double *)(PyArray_DATA(capi_matr_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.cart_to_crys_mat: failed to create array from the 2nd argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(matr,at); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_matr_as_array!=matr_capi) { + Py_XDECREF(capi_matr_as_array); } + } /* if (capi_matr_as_array == NULL) ... else of matr */ + /* End of cleaning variable matr */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of cart_to_crys_mat **************************/ + +/****************************** crys_to_cart_mat ******************************/ +static char doc_f2py_rout_symph_crys_to_cart_mat[] = "\ +crys_to_cart_mat(matr,bg)\n\nWrapper for ``crys_to_cart_mat``.\ +\n\nParameters\n----------\n" +"matr : in/output rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)"; +/* extern void F_FUNC_US(crys_to_cart_mat,CRYS_TO_CART_MAT)(double*,double*); */ +static PyObject *f2py_rout_symph_crys_to_cart_mat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *matr = NULL; + npy_intp matr_Dims[2] = {-1, -1}; + const int matr_Rank = 2; + PyArrayObject *capi_matr_as_array = NULL; + int capi_matr_intent = 0; + PyObject *matr_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + static char *capi_kwlist[] = {"matr","bg",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.crys_to_cart_mat",\ + capi_kwlist,&matr_capi,&bg_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable matr */ + matr_Dims[0]=3,matr_Dims[1]=3; + capi_matr_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.crys_to_cart_mat: failed to create array from the 1st argument `matr`"; + capi_matr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,matr_Dims,matr_Rank, capi_matr_intent,matr_capi,capi_errmess); + if (capi_matr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + matr = (double *)(PyArray_DATA(capi_matr_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.crys_to_cart_mat: failed to create array from the 2nd argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(matr,bg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_matr_as_array!=matr_capi) { + Py_XDECREF(capi_matr_as_array); } + } /* if (capi_matr_as_array == NULL) ... else of matr */ + /* End of cleaning variable matr */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of crys_to_cart_mat **************************/ + +/************************* contract_two_ph_propagator *************************/ +static char doc_f2py_rout_symph_contract_two_ph_propagator[] = "\ +f_output = contract_two_ph_propagator(w_array,w_mu,t,smearing,m,[n_w,n_modes])\n\nWrapper for ``contract_two_ph_propagator``.\ +\n\nParameters\n----------\n" +"w_array : input rank-1 array('d') with bounds (n_w)\n" +"w_mu : input rank-1 array('d') with bounds (n_modes)\n" +"t : input float\n" +"smearing : input float\n" +"m : input rank-2 array('d') with bounds (n_modes,n_modes)\n" +"\nOther Parameters\n----------------\n" +"n_w : input int, optional\n Default: shape(w_array, 0)\n" +"n_modes : input int, optional\n Default: shape(w_mu, 0)\n" +"\nReturns\n-------\n" +"f_output : rank-1 array('D') with bounds (n_w)"; +/* extern void F_FUNC_US(contract_two_ph_propagator,CONTRACT_TWO_PH_PROPAGATOR)(double*,double*,double*,double*,double*,complex_double*,int*,int*); */ +static PyObject *f2py_rout_symph_contract_two_ph_propagator(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *w_array = NULL; + npy_intp w_array_Dims[1] = {-1}; + const int w_array_Rank = 1; + PyArrayObject *capi_w_array_as_array = NULL; + int capi_w_array_intent = 0; + PyObject *w_array_capi = Py_None; + double *w_mu = NULL; + npy_intp w_mu_Dims[1] = {-1}; + const int w_mu_Rank = 1; + PyArrayObject *capi_w_mu_as_array = NULL; + int capi_w_mu_intent = 0; + PyObject *w_mu_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double smearing = 0; + PyObject *smearing_capi = Py_None; + double *m = NULL; + npy_intp m_Dims[2] = {-1, -1}; + const int m_Rank = 2; + PyArrayObject *capi_m_as_array = NULL; + int capi_m_intent = 0; + PyObject *m_capi = Py_None; + complex_double *f_output = NULL; + npy_intp f_output_Dims[1] = {-1}; + const int f_output_Rank = 1; + PyArrayObject *capi_f_output_as_array = NULL; + int capi_f_output_intent = 0; + int n_w = 0; + PyObject *n_w_capi = Py_None; + int n_modes = 0; + PyObject *n_modes_capi = Py_None; + static char *capi_kwlist[] = {"w_array","w_mu","t","smearing","m","n_w","n_modes",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:symph.contract_two_ph_propagator",\ + capi_kwlist,&w_array_capi,&w_mu_capi,&t_capi,&smearing_capi,&m_capi,&n_w_capi,&n_modes_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_array */ + ; + capi_w_array_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the 1st argument `w_array`"; + capi_w_array_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_array_Dims,w_array_Rank, capi_w_array_intent,w_array_capi,capi_errmess); + if (capi_w_array_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_array = (double *)(PyArray_DATA(capi_w_array_as_array)); + + /* Processing variable w_mu */ + ; + capi_w_mu_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the 2nd argument `w_mu`"; + capi_w_mu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_mu_Dims,w_mu_Rank, capi_w_mu_intent,w_mu_capi,capi_errmess); + if (capi_w_mu_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_mu = (double *)(PyArray_DATA(capi_w_mu_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"symph.contract_two_ph_propagator() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable smearing */ + f2py_success = double_from_pyobj(&smearing,smearing_capi,"symph.contract_two_ph_propagator() 4th argument (smearing) can't be converted to double"); + if (f2py_success) { + /* Processing variable n_w */ + if (n_w_capi == Py_None) n_w = shape(w_array, 0); else + f2py_success = int_from_pyobj(&n_w,n_w_capi,"symph.contract_two_ph_propagator() 1st keyword (n_w) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_array, 0) == n_w,"shape(w_array, 0) == n_w","1st keyword n_w","contract_two_ph_propagator:n_w=%d",n_w) { + /* Processing variable n_modes */ + if (n_modes_capi == Py_None) n_modes = shape(w_mu, 0); else + f2py_success = int_from_pyobj(&n_modes,n_modes_capi,"symph.contract_two_ph_propagator() 2nd keyword (n_modes) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_mu, 0) == n_modes,"shape(w_mu, 0) == n_modes","2nd keyword n_modes","contract_two_ph_propagator:n_modes=%d",n_modes) { + /* Processing variable m */ + m_Dims[0]=n_modes,m_Dims[1]=n_modes; + capi_m_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the 5th argument `m`"; + capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); + if (capi_m_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m = (double *)(PyArray_DATA(capi_m_as_array)); + + /* Processing variable f_output */ + f_output_Dims[0]=n_w; + capi_f_output_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the hidden `f_output`"; + capi_f_output_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,f_output_Dims,f_output_Rank, capi_f_output_intent,Py_None,capi_errmess); + if (capi_f_output_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f_output = (complex_double *)(PyArray_DATA(capi_f_output_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(w_array,w_mu,&t,&smearing,m,f_output,&n_w,&n_modes); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_f_output_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_f_output_as_array == NULL) ... else of f_output */ + /* End of cleaning variable f_output */ + if((PyObject *)capi_m_as_array!=m_capi) { + Py_XDECREF(capi_m_as_array); } + } /* if (capi_m_as_array == NULL) ... else of m */ + /* End of cleaning variable m */ + } /*CHECKSCALAR(shape(w_mu, 0) == n_modes)*/ + } /*if (f2py_success) of n_modes*/ + /* End of cleaning variable n_modes */ + } /*CHECKSCALAR(shape(w_array, 0) == n_w)*/ + } /*if (f2py_success) of n_w*/ + /* End of cleaning variable n_w */ + } /*if (f2py_success) of smearing*/ + /* End of cleaning variable smearing */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_w_mu_as_array!=w_mu_capi) { + Py_XDECREF(capi_w_mu_as_array); } + } /* if (capi_w_mu_as_array == NULL) ... else of w_mu */ + /* End of cleaning variable w_mu */ + if((PyObject *)capi_w_array_as_array!=w_array_capi) { + Py_XDECREF(capi_w_array_as_array); } + } /* if (capi_w_array_as_array == NULL) ... else of w_array */ + /* End of cleaning variable w_array */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of contract_two_ph_propagator *********************/ + +/************************* get_two_phonon_propagator *************************/ +static char doc_f2py_rout_symph_get_two_phonon_propagator[] = "\ +chi = get_two_phonon_propagator(w_value,ws,t,smearing,[n_w])\n\nWrapper for ``get_two_phonon_propagator``.\ +\n\nParameters\n----------\n" +"w_value : input float\n" +"ws : input rank-1 array('d') with bounds (n_w)\n" +"t : input float\n" +"smearing : input float\n" +"\nOther Parameters\n----------------\n" +"n_w : input int, optional\n Default: shape(ws, 0)\n" +"\nReturns\n-------\n" +"chi : rank-2 array('D') with bounds (n_w,n_w)"; +/* extern void F_FUNC_US(get_two_phonon_propagator,GET_TWO_PHONON_PROPAGATOR)(double*,double*,double*,double*,complex_double*,int*); */ +static PyObject *f2py_rout_symph_get_two_phonon_propagator(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,complex_double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double w_value = 0; + PyObject *w_value_capi = Py_None; + double *ws = NULL; + npy_intp ws_Dims[1] = {-1}; + const int ws_Rank = 1; + PyArrayObject *capi_ws_as_array = NULL; + int capi_ws_intent = 0; + PyObject *ws_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double smearing = 0; + PyObject *smearing_capi = Py_None; + complex_double *chi = NULL; + npy_intp chi_Dims[2] = {-1, -1}; + const int chi_Rank = 2; + PyArrayObject *capi_chi_as_array = NULL; + int capi_chi_intent = 0; + int n_w = 0; + PyObject *n_w_capi = Py_None; + static char *capi_kwlist[] = {"w_value","ws","t","smearing","n_w",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|O:symph.get_two_phonon_propagator",\ + capi_kwlist,&w_value_capi,&ws_capi,&t_capi,&smearing_capi,&n_w_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_value */ + f2py_success = double_from_pyobj(&w_value,w_value_capi,"symph.get_two_phonon_propagator() 1st argument (w_value) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"symph.get_two_phonon_propagator() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable smearing */ + f2py_success = double_from_pyobj(&smearing,smearing_capi,"symph.get_two_phonon_propagator() 4th argument (smearing) can't be converted to double"); + if (f2py_success) { + /* Processing variable ws */ + ; + capi_ws_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_two_phonon_propagator: failed to create array from the 2nd argument `ws`"; + capi_ws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ws_Dims,ws_Rank, capi_ws_intent,ws_capi,capi_errmess); + if (capi_ws_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ws = (double *)(PyArray_DATA(capi_ws_as_array)); + + /* Processing variable n_w */ + if (n_w_capi == Py_None) n_w = shape(ws, 0); else + f2py_success = int_from_pyobj(&n_w,n_w_capi,"symph.get_two_phonon_propagator() 1st keyword (n_w) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ws, 0) == n_w,"shape(ws, 0) == n_w","1st keyword n_w","get_two_phonon_propagator:n_w=%d",n_w) { + /* Processing variable chi */ + chi_Dims[0]=n_w,chi_Dims[1]=n_w; + capi_chi_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_two_phonon_propagator: failed to create array from the hidden `chi`"; + capi_chi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,chi_Dims,chi_Rank, capi_chi_intent,Py_None,capi_errmess); + if (capi_chi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + chi = (complex_double *)(PyArray_DATA(capi_chi_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&w_value,ws,&t,&smearing,chi,&n_w); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_chi_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_chi_as_array == NULL) ... else of chi */ + /* End of cleaning variable chi */ + } /*CHECKSCALAR(shape(ws, 0) == n_w)*/ + } /*if (f2py_success) of n_w*/ + /* End of cleaning variable n_w */ + if((PyObject *)capi_ws_as_array!=ws_capi) { + Py_XDECREF(capi_ws_as_array); } + } /* if (capi_ws_as_array == NULL) ... else of ws */ + /* End of cleaning variable ws */ + } /*if (f2py_success) of smearing*/ + /* End of cleaning variable smearing */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of w_value*/ + /* End of cleaning variable w_value */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************** end of get_two_phonon_propagator **********************/ + +/*************************** fc_supercell_from_dyn ***************************/ +static char doc_f2py_rout_symph_fc_supercell_from_dyn[] = "\ +phitot_sc = fc_supercell_from_dyn(phitot,q,tau,tau_sc,itau,[nat,nq])\n\nWrapper for ``fc_supercell_from_dyn``.\ +\n\nParameters\n----------\n" +"phitot : input rank-5 array('D') with bounds (nq,3,3,nat,nat)\n" +"q : input rank-2 array('d') with bounds (3,nq)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"tau_sc : input rank-2 array('d') with bounds (3,nat * nq)\n" +"itau : input rank-1 array('i') with bounds (nat * nq)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(phitot, 3)\n" +"nq : input int, optional\n Default: shape(phitot, 0)\n" +"\nReturns\n-------\n" +"phitot_sc : rank-4 array('d') with bounds (3,3,nat * nq,nat * nq)"; +/* extern void F_FUNC_US(fc_supercell_from_dyn,FC_SUPERCELL_FROM_DYN)(complex_double*,double*,double*,double*,int*,double*,int*,int*); */ +static PyObject *f2py_rout_symph_fc_supercell_from_dyn(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,double*,double*,int*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *phitot = NULL; + npy_intp phitot_Dims[5] = {-1, -1, -1, -1, -1}; + const int phitot_Rank = 5; + PyArrayObject *capi_phitot_as_array = NULL; + int capi_phitot_intent = 0; + PyObject *phitot_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[2] = {-1, -1}; + const int q_Rank = 2; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tau_sc = NULL; + npy_intp tau_sc_Dims[2] = {-1, -1}; + const int tau_sc_Rank = 2; + PyArrayObject *capi_tau_sc_as_array = NULL; + int capi_tau_sc_intent = 0; + PyObject *tau_sc_capi = Py_None; + int *itau = NULL; + npy_intp itau_Dims[1] = {-1}; + const int itau_Rank = 1; + PyArrayObject *capi_itau_as_array = NULL; + int capi_itau_intent = 0; + PyObject *itau_capi = Py_None; + double *phitot_sc = NULL; + npy_intp phitot_sc_Dims[4] = {-1, -1, -1, -1}; + const int phitot_sc_Rank = 4; + PyArrayObject *capi_phitot_sc_as_array = NULL; + int capi_phitot_sc_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int nq = 0; + PyObject *nq_capi = Py_None; + static char *capi_kwlist[] = {"phitot","q","tau","tau_sc","itau","nat","nq",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:symph.fc_supercell_from_dyn",\ + capi_kwlist,&phitot_capi,&q_capi,&tau_capi,&tau_sc_capi,&itau_capi,&nat_capi,&nq_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable phitot */ + phitot_Dims[1]=3,phitot_Dims[2]=3; + capi_phitot_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 1st argument `phitot`"; + capi_phitot_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phitot_Dims,phitot_Rank, capi_phitot_intent,phitot_capi,capi_errmess); + if (capi_phitot_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phitot = (complex_double *)(PyArray_DATA(capi_phitot_as_array)); + + /* Processing variable nq */ + if (nq_capi == Py_None) nq = shape(phitot, 0); else + f2py_success = int_from_pyobj(&nq,nq_capi,"symph.fc_supercell_from_dyn() 2nd keyword (nq) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(phitot, 0) == nq,"shape(phitot, 0) == nq","2nd keyword nq","fc_supercell_from_dyn:nq=%d",nq) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(phitot, 3); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.fc_supercell_from_dyn() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(phitot, 3) == nat,"shape(phitot, 3) == nat","1st keyword nat","fc_supercell_from_dyn:nat=%d",nat) { + /* Processing variable q */ + q_Dims[0]=3,q_Dims[1]=nq; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 2nd argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable tau */ + tau_Dims[0]=3,tau_Dims[1]=nat; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 3rd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable tau_sc */ + tau_sc_Dims[0]=3,tau_sc_Dims[1]=nat * nq; + capi_tau_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 4th argument `tau_sc`"; + capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); + if (capi_tau_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); + + /* Processing variable itau */ + itau_Dims[0]=nat * nq; + capi_itau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 5th argument `itau`"; + capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); + if (capi_itau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau = (int *)(PyArray_DATA(capi_itau_as_array)); + + /* Processing variable phitot_sc */ + phitot_sc_Dims[0]=3,phitot_sc_Dims[1]=3,phitot_sc_Dims[2]=nat * nq,phitot_sc_Dims[3]=nat * nq; + capi_phitot_sc_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the hidden `phitot_sc`"; + capi_phitot_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,phitot_sc_Dims,phitot_sc_Rank, capi_phitot_sc_intent,Py_None,capi_errmess); + if (capi_phitot_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phitot_sc = (double *)(PyArray_DATA(capi_phitot_sc_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(phitot,q,tau,tau_sc,itau,phitot_sc,&nat,&nq); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_phitot_sc_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_phitot_sc_as_array == NULL) ... else of phitot_sc */ + /* End of cleaning variable phitot_sc */ + if((PyObject *)capi_itau_as_array!=itau_capi) { + Py_XDECREF(capi_itau_as_array); } + } /* if (capi_itau_as_array == NULL) ... else of itau */ + /* End of cleaning variable itau */ + if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { + Py_XDECREF(capi_tau_sc_as_array); } + } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ + /* End of cleaning variable tau_sc */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ + } /*CHECKSCALAR(shape(phitot, 3) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(phitot, 0) == nq)*/ + } /*if (f2py_success) of nq*/ + /* End of cleaning variable nq */ + if((PyObject *)capi_phitot_as_array!=phitot_capi) { + Py_XDECREF(capi_phitot_as_array); } + } /* if (capi_phitot_as_array == NULL) ... else of phitot */ + /* End of cleaning variable phitot */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of fc_supercell_from_dyn ************************/ + +/************************ fast_ft_real_space_from_dynq ************************/ +static char doc_f2py_rout_symph_fast_ft_real_space_from_dynq[] = "\ +fc_supercell = fast_ft_real_space_from_dynq(unit_cell_coords,super_cell_coords,itau,q_tot,dynq,[nat,nat_sc,nq])\n\nWrapper for ``fast_ft_real_space_from_dynq``.\ +\n\nParameters\n----------\n" +"unit_cell_coords : input rank-2 array('d') with bounds (nat,3)\n" +"super_cell_coords : input rank-2 array('d') with bounds (nat_sc,3)\n" +"itau : input rank-1 array('i') with bounds (nat_sc)\n" +"q_tot : input rank-2 array('d') with bounds (nq,3)\n" +"dynq : input rank-3 array('D') with bounds (nq,3 * nat,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(unit_cell_coords, 0)\n" +"nat_sc : input int, optional\n Default: shape(super_cell_coords, 0)\n" +"nq : input int, optional\n Default: shape(q_tot, 0)\n" +"\nReturns\n-------\n" +"fc_supercell : rank-2 array('D') with bounds (3 * nat_sc,3 * nat_sc)"; +/* extern void F_FUNC_US(fast_ft_real_space_from_dynq,FAST_FT_REAL_SPACE_FROM_DYNQ)(double*,double*,int*,int*,int*,int*,double*,complex_double*,complex_double*); */ +static PyObject *f2py_rout_symph_fast_ft_real_space_from_dynq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,int*,double*,complex_double*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *unit_cell_coords = NULL; + npy_intp unit_cell_coords_Dims[2] = {-1, -1}; + const int unit_cell_coords_Rank = 2; + PyArrayObject *capi_unit_cell_coords_as_array = NULL; + int capi_unit_cell_coords_intent = 0; + PyObject *unit_cell_coords_capi = Py_None; + double *super_cell_coords = NULL; + npy_intp super_cell_coords_Dims[2] = {-1, -1}; + const int super_cell_coords_Rank = 2; + PyArrayObject *capi_super_cell_coords_as_array = NULL; + int capi_super_cell_coords_intent = 0; + PyObject *super_cell_coords_capi = Py_None; + int *itau = NULL; + npy_intp itau_Dims[1] = {-1}; + const int itau_Rank = 1; + PyArrayObject *capi_itau_as_array = NULL; + int capi_itau_intent = 0; + PyObject *itau_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + int nq = 0; + PyObject *nq_capi = Py_None; + double *q_tot = NULL; + npy_intp q_tot_Dims[2] = {-1, -1}; + const int q_tot_Rank = 2; + PyArrayObject *capi_q_tot_as_array = NULL; + int capi_q_tot_intent = 0; + PyObject *q_tot_capi = Py_None; + complex_double *dynq = NULL; + npy_intp dynq_Dims[3] = {-1, -1, -1}; + const int dynq_Rank = 3; + PyArrayObject *capi_dynq_as_array = NULL; + int capi_dynq_intent = 0; + PyObject *dynq_capi = Py_None; + complex_double *fc_supercell = NULL; + npy_intp fc_supercell_Dims[2] = {-1, -1}; + const int fc_supercell_Rank = 2; + PyArrayObject *capi_fc_supercell_as_array = NULL; + int capi_fc_supercell_intent = 0; + static char *capi_kwlist[] = {"unit_cell_coords","super_cell_coords","itau","q_tot","dynq","nat","nat_sc","nq",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OOO:symph.fast_ft_real_space_from_dynq",\ + capi_kwlist,&unit_cell_coords_capi,&super_cell_coords_capi,&itau_capi,&q_tot_capi,&dynq_capi,&nat_capi,&nat_sc_capi,&nq_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable unit_cell_coords */ + unit_cell_coords_Dims[1]=3; + capi_unit_cell_coords_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 1st argument `unit_cell_coords`"; + capi_unit_cell_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_coords_Dims,unit_cell_coords_Rank, capi_unit_cell_coords_intent,unit_cell_coords_capi,capi_errmess); + if (capi_unit_cell_coords_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + unit_cell_coords = (double *)(PyArray_DATA(capi_unit_cell_coords_as_array)); + + /* Processing variable super_cell_coords */ + super_cell_coords_Dims[1]=3; + capi_super_cell_coords_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 2nd argument `super_cell_coords`"; + capi_super_cell_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,super_cell_coords_Dims,super_cell_coords_Rank, capi_super_cell_coords_intent,super_cell_coords_capi,capi_errmess); + if (capi_super_cell_coords_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + super_cell_coords = (double *)(PyArray_DATA(capi_super_cell_coords_as_array)); + + /* Processing variable q_tot */ + q_tot_Dims[1]=3; + capi_q_tot_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 4th argument `q_tot`"; + capi_q_tot_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_tot_Dims,q_tot_Rank, capi_q_tot_intent,q_tot_capi,capi_errmess); + if (capi_q_tot_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q_tot = (double *)(PyArray_DATA(capi_q_tot_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(unit_cell_coords, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.fast_ft_real_space_from_dynq() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(unit_cell_coords, 0) == nat,"shape(unit_cell_coords, 0) == nat","1st keyword nat","fast_ft_real_space_from_dynq:nat=%d",nat) { + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(super_cell_coords, 0); else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.fast_ft_real_space_from_dynq() 2nd keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(super_cell_coords, 0) == nat_sc,"shape(super_cell_coords, 0) == nat_sc","2nd keyword nat_sc","fast_ft_real_space_from_dynq:nat_sc=%d",nat_sc) { + /* Processing variable nq */ + if (nq_capi == Py_None) nq = shape(q_tot, 0); else + f2py_success = int_from_pyobj(&nq,nq_capi,"symph.fast_ft_real_space_from_dynq() 3rd keyword (nq) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(q_tot, 0) == nq,"shape(q_tot, 0) == nq","3rd keyword nq","fast_ft_real_space_from_dynq:nq=%d",nq) { + /* Processing variable itau */ + itau_Dims[0]=nat_sc; + capi_itau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 3rd argument `itau`"; + capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); + if (capi_itau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau = (int *)(PyArray_DATA(capi_itau_as_array)); + + /* Processing variable dynq */ + dynq_Dims[0]=nq,dynq_Dims[1]=3 * nat,dynq_Dims[2]=3 * nat; + capi_dynq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 5th argument `dynq`"; + capi_dynq_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dynq_Dims,dynq_Rank, capi_dynq_intent,dynq_capi,capi_errmess); + if (capi_dynq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dynq = (complex_double *)(PyArray_DATA(capi_dynq_as_array)); + + /* Processing variable fc_supercell */ + fc_supercell_Dims[0]=3 * nat_sc,fc_supercell_Dims[1]=3 * nat_sc; + capi_fc_supercell_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the hidden `fc_supercell`"; + capi_fc_supercell_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_supercell_Dims,fc_supercell_Rank, capi_fc_supercell_intent,Py_None,capi_errmess); + if (capi_fc_supercell_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_supercell = (complex_double *)(PyArray_DATA(capi_fc_supercell_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(unit_cell_coords,super_cell_coords,itau,&nat,&nat_sc,&nq,q_tot,dynq,fc_supercell); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_supercell_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_supercell_as_array == NULL) ... else of fc_supercell */ + /* End of cleaning variable fc_supercell */ + if((PyObject *)capi_dynq_as_array!=dynq_capi) { + Py_XDECREF(capi_dynq_as_array); } + } /* if (capi_dynq_as_array == NULL) ... else of dynq */ + /* End of cleaning variable dynq */ + if((PyObject *)capi_itau_as_array!=itau_capi) { + Py_XDECREF(capi_itau_as_array); } + } /* if (capi_itau_as_array == NULL) ... else of itau */ + /* End of cleaning variable itau */ + } /*CHECKSCALAR(shape(q_tot, 0) == nq)*/ + } /*if (f2py_success) of nq*/ + /* End of cleaning variable nq */ + } /*CHECKSCALAR(shape(super_cell_coords, 0) == nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + } /*CHECKSCALAR(shape(unit_cell_coords, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_q_tot_as_array!=q_tot_capi) { + Py_XDECREF(capi_q_tot_as_array); } + } /* if (capi_q_tot_as_array == NULL) ... else of q_tot */ + /* End of cleaning variable q_tot */ + if((PyObject *)capi_super_cell_coords_as_array!=super_cell_coords_capi) { + Py_XDECREF(capi_super_cell_coords_as_array); } + } /* if (capi_super_cell_coords_as_array == NULL) ... else of super_cell_coords */ + /* End of cleaning variable super_cell_coords */ + if((PyObject *)capi_unit_cell_coords_as_array!=unit_cell_coords_capi) { + Py_XDECREF(capi_unit_cell_coords_as_array); } + } /* if (capi_unit_cell_coords_as_array == NULL) ... else of unit_cell_coords */ + /* End of cleaning variable unit_cell_coords */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of fast_ft_real_space_from_dynq ********************/ + +/****************************** impose_trans_sc ******************************/ +static char doc_f2py_rout_symph_impose_trans_sc[] = "\ +impose_trans_sc(fc_sc,tau_sc_cryst,itau,[nat_sc])\n\nWrapper for ``impose_trans_sc``.\ +\n\nParameters\n----------\n" +"fc_sc : in/output rank-4 array('d') with bounds (3,3,nat_sc,nat_sc)\n" +"tau_sc_cryst : input rank-2 array('d') with bounds (3,nat_sc)\n" +"itau : input rank-1 array('i') with bounds (nat_sc)\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(fc_sc, 2)"; +/* extern void F_FUNC_US(impose_trans_sc,IMPOSE_TRANS_SC)(double*,double*,int*,int*); */ +static PyObject *f2py_rout_symph_impose_trans_sc(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc_sc = NULL; + npy_intp fc_sc_Dims[4] = {-1, -1, -1, -1}; + const int fc_sc_Rank = 4; + PyArrayObject *capi_fc_sc_as_array = NULL; + int capi_fc_sc_intent = 0; + PyObject *fc_sc_capi = Py_None; + double *tau_sc_cryst = NULL; + npy_intp tau_sc_cryst_Dims[2] = {-1, -1}; + const int tau_sc_cryst_Rank = 2; + PyArrayObject *capi_tau_sc_cryst_as_array = NULL; + int capi_tau_sc_cryst_intent = 0; + PyObject *tau_sc_cryst_capi = Py_None; + int *itau = NULL; + npy_intp itau_Dims[1] = {-1}; + const int itau_Rank = 1; + PyArrayObject *capi_itau_as_array = NULL; + int capi_itau_intent = 0; + PyObject *itau_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + static char *capi_kwlist[] = {"fc_sc","tau_sc_cryst","itau","nat_sc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:symph.impose_trans_sc",\ + capi_kwlist,&fc_sc_capi,&tau_sc_cryst_capi,&itau_capi,&nat_sc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc_sc */ + fc_sc_Dims[0]=3,fc_sc_Dims[1]=3; + capi_fc_sc_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.impose_trans_sc: failed to create array from the 1st argument `fc_sc`"; + capi_fc_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_sc_Dims,fc_sc_Rank, capi_fc_sc_intent,fc_sc_capi,capi_errmess); + if (capi_fc_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_sc = (double *)(PyArray_DATA(capi_fc_sc_as_array)); + + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(fc_sc, 2); else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.impose_trans_sc() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc_sc, 2) == nat_sc,"shape(fc_sc, 2) == nat_sc","1st keyword nat_sc","impose_trans_sc:nat_sc=%d",nat_sc) { + /* Processing variable tau_sc_cryst */ + tau_sc_cryst_Dims[0]=3,tau_sc_cryst_Dims[1]=nat_sc; + capi_tau_sc_cryst_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.impose_trans_sc: failed to create array from the 2nd argument `tau_sc_cryst`"; + capi_tau_sc_cryst_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_cryst_Dims,tau_sc_cryst_Rank, capi_tau_sc_cryst_intent,tau_sc_cryst_capi,capi_errmess); + if (capi_tau_sc_cryst_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc_cryst = (double *)(PyArray_DATA(capi_tau_sc_cryst_as_array)); + + /* Processing variable itau */ + itau_Dims[0]=nat_sc; + capi_itau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.impose_trans_sc: failed to create array from the 3rd argument `itau`"; + capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); + if (capi_itau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau = (int *)(PyArray_DATA(capi_itau_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc_sc,tau_sc_cryst,itau,&nat_sc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_itau_as_array!=itau_capi) { + Py_XDECREF(capi_itau_as_array); } + } /* if (capi_itau_as_array == NULL) ... else of itau */ + /* End of cleaning variable itau */ + if((PyObject *)capi_tau_sc_cryst_as_array!=tau_sc_cryst_capi) { + Py_XDECREF(capi_tau_sc_cryst_as_array); } + } /* if (capi_tau_sc_cryst_as_array == NULL) ... else of tau_sc_cryst */ + /* End of cleaning variable tau_sc_cryst */ + } /*CHECKSCALAR(shape(fc_sc, 2) == nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + if((PyObject *)capi_fc_sc_as_array!=fc_sc_capi) { + Py_XDECREF(capi_fc_sc_as_array); } + } /* if (capi_fc_sc_as_array == NULL) ... else of fc_sc */ + /* End of cleaning variable fc_sc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of impose_trans_sc ***************************/ + +/******************************** dyn_from_fc ********************************/ +static char doc_f2py_rout_symph_dyn_from_fc[] = "\ +dyn = dyn_from_fc(phitot_sc,q,tau,tau_sc,itau,nq,nat)\n\nWrapper for ``dyn_from_fc``.\ +\n\nParameters\n----------\n" +"phitot_sc : input rank-4 array('d') with bounds (3,3,nat * nq,nat * nq)\n" +"q : input rank-2 array('d') with bounds (3,nq)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"tau_sc : input rank-2 array('d') with bounds (3,nat * nq)\n" +"itau : input rank-1 array('i') with bounds (nat * nq)\n" +"nq : input int, optional\n Default: shape(q, 1)\n" +"nat : input int, optional\n Default: shape(tau, 1)\n" +"\nReturns\n-------\n" +"dyn : rank-5 array('D') with bounds (nq,3,3,nat,nat)"; +/* extern void F_FUNC_US(dyn_from_fc,DYN_FROM_FC)(double*,double*,double*,double*,int*,complex_double*,int*,int*); */ +static PyObject *f2py_rout_symph_dyn_from_fc(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *phitot_sc = NULL; + npy_intp phitot_sc_Dims[4] = {-1, -1, -1, -1}; + const int phitot_sc_Rank = 4; + PyArrayObject *capi_phitot_sc_as_array = NULL; + int capi_phitot_sc_intent = 0; + PyObject *phitot_sc_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[2] = {-1, -1}; + const int q_Rank = 2; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tau_sc = NULL; + npy_intp tau_sc_Dims[2] = {-1, -1}; + const int tau_sc_Rank = 2; + PyArrayObject *capi_tau_sc_as_array = NULL; + int capi_tau_sc_intent = 0; + PyObject *tau_sc_capi = Py_None; + int *itau = NULL; + npy_intp itau_Dims[1] = {-1}; + const int itau_Rank = 1; + PyArrayObject *capi_itau_as_array = NULL; + int capi_itau_intent = 0; + PyObject *itau_capi = Py_None; + complex_double *dyn = NULL; + npy_intp dyn_Dims[5] = {-1, -1, -1, -1, -1}; + const int dyn_Rank = 5; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + int nq = 0; + PyObject *nq_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"phitot_sc","q","tau","tau_sc","itau","nq","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|:symph.dyn_from_fc",\ + capi_kwlist,&phitot_sc_capi,&q_capi,&tau_capi,&tau_sc_capi,&itau_capi,&nq_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 2nd argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 3rd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable nq */ + if (nq_capi == Py_None) nq = shape(q, 1); else + f2py_success = int_from_pyobj(&nq,nq_capi,"symph.dyn_from_fc() 6th argument (nq) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(q, 1) == nq,"shape(q, 1) == nq","6th argument nq","dyn_from_fc:nq=%d",nq) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.dyn_from_fc() 7th argument (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","7th argument nat","dyn_from_fc:nat=%d",nat) { + /* Processing variable phitot_sc */ + phitot_sc_Dims[0]=3,phitot_sc_Dims[1]=3,phitot_sc_Dims[2]=nat * nq,phitot_sc_Dims[3]=nat * nq; + capi_phitot_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 1st argument `phitot_sc`"; + capi_phitot_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,phitot_sc_Dims,phitot_sc_Rank, capi_phitot_sc_intent,phitot_sc_capi,capi_errmess); + if (capi_phitot_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phitot_sc = (double *)(PyArray_DATA(capi_phitot_sc_as_array)); + + CHECKARRAY(shape(phitot_sc, 2) == nat * nq,"shape(phitot_sc, 2) == nat * nq","1st argument phitot_sc") { + CHECKARRAY(shape(phitot_sc, 2) == nat * nq,"shape(phitot_sc, 2) == nat * nq","1st argument phitot_sc") { + /* Processing variable tau_sc */ + tau_sc_Dims[0]=3,tau_sc_Dims[1]=nat * nq; + capi_tau_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 4th argument `tau_sc`"; + capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); + if (capi_tau_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); + + /* Processing variable itau */ + itau_Dims[0]=nat * nq; + capi_itau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 5th argument `itau`"; + capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); + if (capi_itau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau = (int *)(PyArray_DATA(capi_itau_as_array)); + + /* Processing variable dyn */ + dyn_Dims[0]=nq,dyn_Dims[1]=3,dyn_Dims[2]=3,dyn_Dims[3]=nat,dyn_Dims[4]=nat; + capi_dyn_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the hidden `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,Py_None,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(phitot_sc,q,tau,tau_sc,itau,dyn,&nq,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_dyn_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + if((PyObject *)capi_itau_as_array!=itau_capi) { + Py_XDECREF(capi_itau_as_array); } + } /* if (capi_itau_as_array == NULL) ... else of itau */ + /* End of cleaning variable itau */ + if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { + Py_XDECREF(capi_tau_sc_as_array); } + } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ + /* End of cleaning variable tau_sc */ + } /*CHECKARRAY(shape(phitot_sc, 2) == nat * nq)*/ + } /*CHECKARRAY(shape(phitot_sc, 2) == nat * nq)*/ + if((PyObject *)capi_phitot_sc_as_array!=phitot_sc_capi) { + Py_XDECREF(capi_phitot_sc_as_array); } + } /* if (capi_phitot_sc_as_array == NULL) ... else of phitot_sc */ + /* End of cleaning variable phitot_sc */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(q, 1) == nq)*/ + } /*if (f2py_success) of nq*/ + /* End of cleaning variable nq */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of dyn_from_fc *****************************/ + +/********************************* get_q_grid *********************************/ +static char doc_f2py_rout_symph_get_q_grid[] = "\ +q_list = get_q_grid(bg,supercell_size,n_size)\n\nWrapper for ``get_q_grid``.\ +\n\nParameters\n----------\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"supercell_size : input rank-1 array('i') with bounds (3)\n" +"n_size : input int\n" +"\nReturns\n-------\n" +"q_list : rank-2 array('d') with bounds (3,n_size)"; +/* extern void F_FUNC_US(get_q_grid,GET_Q_GRID)(double*,int*,double*,int*); */ +static PyObject *f2py_rout_symph_get_q_grid(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + int *supercell_size = NULL; + npy_intp supercell_size_Dims[1] = {-1}; + const int supercell_size_Rank = 1; + PyArrayObject *capi_supercell_size_as_array = NULL; + int capi_supercell_size_intent = 0; + PyObject *supercell_size_capi = Py_None; + double *q_list = NULL; + npy_intp q_list_Dims[2] = {-1, -1}; + const int q_list_Rank = 2; + PyArrayObject *capi_q_list_as_array = NULL; + int capi_q_list_intent = 0; + int n_size = 0; + PyObject *n_size_capi = Py_None; + static char *capi_kwlist[] = {"bg","supercell_size","n_size",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:symph.get_q_grid",\ + capi_kwlist,&bg_capi,&supercell_size_capi,&n_size_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_q_grid: failed to create array from the 1st argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable supercell_size */ + supercell_size_Dims[0]=3; + capi_supercell_size_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_q_grid: failed to create array from the 2nd argument `supercell_size`"; + capi_supercell_size_as_array = ndarray_from_pyobj( NPY_INT,1,supercell_size_Dims,supercell_size_Rank, capi_supercell_size_intent,supercell_size_capi,capi_errmess); + if (capi_supercell_size_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + supercell_size = (int *)(PyArray_DATA(capi_supercell_size_as_array)); + + /* Processing variable n_size */ + f2py_success = int_from_pyobj(&n_size,n_size_capi,"symph.get_q_grid() 3rd argument (n_size) can't be converted to int"); + if (f2py_success) { + /* Processing variable q_list */ + q_list_Dims[0]=3,q_list_Dims[1]=n_size; + capi_q_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_q_grid: failed to create array from the hidden `q_list`"; + capi_q_list_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_list_Dims,q_list_Rank, capi_q_list_intent,Py_None,capi_errmess); + if (capi_q_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q_list = (double *)(PyArray_DATA(capi_q_list_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(bg,supercell_size,q_list,&n_size); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_q_list_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_q_list_as_array == NULL) ... else of q_list */ + /* End of cleaning variable q_list */ + } /*if (f2py_success) of n_size*/ + /* End of cleaning variable n_size */ + if((PyObject *)capi_supercell_size_as_array!=supercell_size_capi) { + Py_XDECREF(capi_supercell_size_as_array); } + } /* if (capi_supercell_size_as_array == NULL) ... else of supercell_size */ + /* End of cleaning variable supercell_size */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of get_q_grid *****************************/ + +/*********************************** star_q ***********************************/ +static char doc_f2py_rout_symph_star_q[] = "\ +nq,sxq,isq,imq = star_q(xq,at,bg,nsym,s,invs,verbosity)\n\nWrapper for ``star_q``.\ +\n\nParameters\n----------\n" +"xq : input rank-1 array('d') with bounds (3)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"nsym : input int\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"invs : input rank-1 array('i') with bounds (48)\n" +"verbosity : input int\n" +"\nReturns\n-------\n" +"nq : int\n" +"sxq : rank-2 array('d') with bounds (3,48)\n" +"isq : rank-1 array('i') with bounds (48)\n" +"imq : int"; +/* extern void F_FUNC_US(star_q,STAR_Q)(double*,double*,double*,int*,int*,int*,int*,double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_star_q(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *xq = NULL; + npy_intp xq_Dims[1] = {-1}; + const int xq_Rank = 1; + PyArrayObject *capi_xq_as_array = NULL; + int capi_xq_intent = 0; + PyObject *xq_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *invs = NULL; + npy_intp invs_Dims[1] = {-1}; + const int invs_Rank = 1; + PyArrayObject *capi_invs_as_array = NULL; + int capi_invs_intent = 0; + PyObject *invs_capi = Py_None; + int nq = 0; + double *sxq = NULL; + npy_intp sxq_Dims[2] = {-1, -1}; + const int sxq_Rank = 2; + PyArrayObject *capi_sxq_as_array = NULL; + int capi_sxq_intent = 0; + int *isq = NULL; + npy_intp isq_Dims[1] = {-1}; + const int isq_Rank = 1; + PyArrayObject *capi_isq_as_array = NULL; + int capi_isq_intent = 0; + int imq = 0; + int verbosity = 0; + PyObject *verbosity_capi = Py_None; + static char *capi_kwlist[] = {"xq","at","bg","nsym","s","invs","verbosity",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|:symph.star_q",\ + capi_kwlist,&xq_capi,&at_capi,&bg_capi,&nsym_capi,&s_capi,&invs_capi,&verbosity_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.star_q() 4th argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the 5th argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable invs */ + invs_Dims[0]=48; + capi_invs_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the 6th argument `invs`"; + capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); + if (capi_invs_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + invs = (int *)(PyArray_DATA(capi_invs_as_array)); + + /* Processing variable xq */ + xq_Dims[0]=3; + capi_xq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the 1st argument `xq`"; + capi_xq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xq_Dims,xq_Rank, capi_xq_intent,xq_capi,capi_errmess); + if (capi_xq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xq = (double *)(PyArray_DATA(capi_xq_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the 2nd argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the 3rd argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable nq */ + /* Processing variable isq */ + isq_Dims[0]=48; + capi_isq_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the hidden `isq`"; + capi_isq_as_array = ndarray_from_pyobj( NPY_INT,1,isq_Dims,isq_Rank, capi_isq_intent,Py_None,capi_errmess); + if (capi_isq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + isq = (int *)(PyArray_DATA(capi_isq_as_array)); + + /* Processing variable imq */ + /* Processing variable sxq */ + sxq_Dims[0]=3,sxq_Dims[1]=48; + capi_sxq_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.star_q: failed to create array from the hidden `sxq`"; + capi_sxq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sxq_Dims,sxq_Rank, capi_sxq_intent,Py_None,capi_errmess); + if (capi_sxq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sxq = (double *)(PyArray_DATA(capi_sxq_as_array)); + + /* Processing variable verbosity */ + verbosity = (int)PyObject_IsTrue(verbosity_capi); + f2py_success = 1; + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(xq,at,bg,&nsym,s,invs,&nq,sxq,isq,&imq,&verbosity); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("iNNi",nq,capi_sxq_as_array,capi_isq_as_array,imq); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of verbosity*/ + /* End of cleaning variable verbosity */ + } /* if (capi_sxq_as_array == NULL) ... else of sxq */ + /* End of cleaning variable sxq */ + /* End of cleaning variable imq */ + } /* if (capi_isq_as_array == NULL) ... else of isq */ + /* End of cleaning variable isq */ + /* End of cleaning variable nq */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_xq_as_array!=xq_capi) { + Py_XDECREF(capi_xq_as_array); } + } /* if (capi_xq_as_array == NULL) ... else of xq */ + /* End of cleaning variable xq */ + if((PyObject *)capi_invs_as_array!=invs_capi) { + Py_XDECREF(capi_invs_as_array); } + } /* if (capi_invs_as_array == NULL) ... else of invs */ + /* End of cleaning variable invs */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of star_q *******************************/ + +/********************************* symvector *********************************/ +static char doc_f2py_rout_symph_symvector[] = "\ +symvector(nsym,irt,s,at,bg,vect,[nat])\n\nWrapper for ``symvector``.\ +\n\nParameters\n----------\n" +"nsym : input int\n" +"irt : input rank-2 array('i') with bounds (48,nat)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"vect : in/output rank-2 array('d') with bounds (3,nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(irt, 1)"; +/* extern void F_FUNC(symvector,SYMVECTOR)(int*,int*,int*,int*,double*,double*,double*); */ +static PyObject *f2py_rout_symph_symvector(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + double *vect = NULL; + npy_intp vect_Dims[2] = {-1, -1}; + const int vect_Rank = 2; + PyArrayObject *capi_vect_as_array = NULL; + int capi_vect_intent = 0; + PyObject *vect_capi = Py_None; + static char *capi_kwlist[] = {"nsym","irt","s","at","bg","vect","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|O:symph.symvector",\ + capi_kwlist,&nsym_capi,&irt_capi,&s_capi,&at_capi,&bg_capi,&vect_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.symvector() 1st argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable irt */ + irt_Dims[0]=48; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symvector: failed to create array from the 2nd argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symvector: failed to create array from the 3rd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symvector: failed to create array from the 4th argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symvector: failed to create array from the 5th argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(irt, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symvector() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irt, 1) == nat,"shape(irt, 1) == nat","1st keyword nat","symvector:nat=%d",nat) { + /* Processing variable vect */ + vect_Dims[0]=3,vect_Dims[1]=nat; + capi_vect_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.symvector: failed to create array from the 6th argument `vect`"; + capi_vect_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vect_Dims,vect_Rank, capi_vect_intent,vect_capi,capi_errmess); + if (capi_vect_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + vect = (double *)(PyArray_DATA(capi_vect_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,&nsym,irt,s,at,bg,vect); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_vect_as_array!=vect_capi) { + Py_XDECREF(capi_vect_as_array); } + } /* if (capi_vect_as_array == NULL) ... else of vect */ + /* End of cleaning variable vect */ + } /*CHECKSCALAR(shape(irt, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of symvector ******************************/ + +/******************************* cryst_to_cart *******************************/ +static char doc_f2py_rout_symph_cryst_to_cart[] = "\ +cryst_to_cart(vec,trmat,iflag,[nvec])\n\nWrapper for ``cryst_to_cart``.\ +\n\nParameters\n----------\n" +"vec : in/output rank-2 array('d') with bounds (3,nvec)\n" +"trmat : input rank-2 array('d') with bounds (3,3)\n" +"iflag : input int\n" +"\nOther Parameters\n----------------\n" +"nvec : input int, optional\n Default: shape(vec, 1)"; +/* extern void F_FUNC_US(cryst_to_cart,CRYST_TO_CART)(int*,double*,double*,int*); */ +static PyObject *f2py_rout_symph_cryst_to_cart(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nvec = 0; + PyObject *nvec_capi = Py_None; + double *vec = NULL; + npy_intp vec_Dims[2] = {-1, -1}; + const int vec_Rank = 2; + PyArrayObject *capi_vec_as_array = NULL; + int capi_vec_intent = 0; + PyObject *vec_capi = Py_None; + double *trmat = NULL; + npy_intp trmat_Dims[2] = {-1, -1}; + const int trmat_Rank = 2; + PyArrayObject *capi_trmat_as_array = NULL; + int capi_trmat_intent = 0; + PyObject *trmat_capi = Py_None; + int iflag = 0; + PyObject *iflag_capi = Py_None; + static char *capi_kwlist[] = {"vec","trmat","iflag","nvec",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:symph.cryst_to_cart",\ + capi_kwlist,&vec_capi,&trmat_capi,&iflag_capi,&nvec_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable iflag */ + f2py_success = int_from_pyobj(&iflag,iflag_capi,"symph.cryst_to_cart() 3rd argument (iflag) can't be converted to int"); + if (f2py_success) { + /* Processing variable trmat */ + trmat_Dims[0]=3,trmat_Dims[1]=3; + capi_trmat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.cryst_to_cart: failed to create array from the 2nd argument `trmat`"; + capi_trmat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,trmat_Dims,trmat_Rank, capi_trmat_intent,trmat_capi,capi_errmess); + if (capi_trmat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + trmat = (double *)(PyArray_DATA(capi_trmat_as_array)); + + /* Processing variable vec */ + vec_Dims[0]=3; + capi_vec_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.cryst_to_cart: failed to create array from the 1st argument `vec`"; + capi_vec_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vec_Dims,vec_Rank, capi_vec_intent,vec_capi,capi_errmess); + if (capi_vec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + vec = (double *)(PyArray_DATA(capi_vec_as_array)); + + /* Processing variable nvec */ + if (nvec_capi == Py_None) nvec = shape(vec, 1); else + f2py_success = int_from_pyobj(&nvec,nvec_capi,"symph.cryst_to_cart() 1st keyword (nvec) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(vec, 1) == nvec,"shape(vec, 1) == nvec","1st keyword nvec","cryst_to_cart:nvec=%d",nvec) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nvec,vec,trmat,&iflag); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(vec, 1) == nvec)*/ + } /*if (f2py_success) of nvec*/ + /* End of cleaning variable nvec */ + if((PyObject *)capi_vec_as_array!=vec_capi) { + Py_XDECREF(capi_vec_as_array); } + } /* if (capi_vec_as_array == NULL) ... else of vec */ + /* End of cleaning variable vec */ + if((PyObject *)capi_trmat_as_array!=trmat_capi) { + Py_XDECREF(capi_trmat_as_array); } + } /* if (capi_trmat_as_array == NULL) ... else of trmat */ + /* End of cleaning variable trmat */ + } /*if (f2py_success) of iflag*/ + /* End of cleaning variable iflag */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of cryst_to_cart ****************************/ + +/********************************* flush_unit *********************************/ +static char doc_f2py_rout_symph_flush_unit[] = "\ +flush_unit(unit_tobeflushed)\n\nWrapper for ``flush_unit``.\ +\n\nParameters\n----------\n" +"unit_tobeflushed : input int"; +/* extern void F_FUNC_US(flush_unit,FLUSH_UNIT)(int*); */ +static PyObject *f2py_rout_symph_flush_unit(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int unit_tobeflushed = 0; + PyObject *unit_tobeflushed_capi = Py_None; + static char *capi_kwlist[] = {"unit_tobeflushed",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:symph.flush_unit",\ + capi_kwlist,&unit_tobeflushed_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable unit_tobeflushed */ + f2py_success = int_from_pyobj(&unit_tobeflushed,unit_tobeflushed_capi,"symph.flush_unit() 1st argument (unit_tobeflushed) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&unit_tobeflushed); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of unit_tobeflushed*/ + /* End of cleaning variable unit_tobeflushed */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of flush_unit *****************************/ + +/****************************** get_translations ******************************/ +static char doc_f2py_rout_symph_get_translations[] = "\ +trans = get_translations(pols,masses,[nmod,nat])\n\nWrapper for ``get_translations``.\ +\n\nParameters\n----------\n" +"pols : input rank-2 array('d') with bounds (3 * nat,nmod)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nmod : input int, optional\n Default: shape(pols, 1)\n" +"nat : input int, optional\n Default: shape(pols, 0) / 3\n" +"\nReturns\n-------\n" +"trans : rank-1 array('i') with bounds (nmod)"; +/* extern void F_FUNC_US(get_translations,GET_TRANSLATIONS)(double*,double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_get_translations(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *pols = NULL; + npy_intp pols_Dims[2] = {-1, -1}; + const int pols_Rank = 2; + PyArrayObject *capi_pols_as_array = NULL; + int capi_pols_intent = 0; + PyObject *pols_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + int nmod = 0; + PyObject *nmod_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int *trans = NULL; + npy_intp trans_Dims[1] = {-1}; + const int trans_Rank = 1; + PyArrayObject *capi_trans_as_array = NULL; + int capi_trans_intent = 0; + static char *capi_kwlist[] = {"pols","masses","nmod","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|OO:symph.get_translations",\ + capi_kwlist,&pols_capi,&masses_capi,&nmod_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable pols */ + ; + capi_pols_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_translations: failed to create array from the 1st argument `pols`"; + capi_pols_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pols_Dims,pols_Rank, capi_pols_intent,pols_capi,capi_errmess); + if (capi_pols_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pols = (double *)(PyArray_DATA(capi_pols_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(pols, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_translations() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(pols, 0) == 3 * nat,"shape(pols, 0) == 3 * nat","2nd keyword nat","get_translations:nat=%d",nat) { + /* Processing variable nmod */ + if (nmod_capi == Py_None) nmod = shape(pols, 1); else + f2py_success = int_from_pyobj(&nmod,nmod_capi,"symph.get_translations() 1st keyword (nmod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(pols, 1) == nmod,"shape(pols, 1) == nmod","1st keyword nmod","get_translations:nmod=%d",nmod) { + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_translations: failed to create array from the 2nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable trans */ + trans_Dims[0]=nmod; + capi_trans_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_translations: failed to create array from the hidden `trans`"; + capi_trans_as_array = ndarray_from_pyobj( NPY_INT,1,trans_Dims,trans_Rank, capi_trans_intent,Py_None,capi_errmess); + if (capi_trans_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + trans = (int *)(PyArray_DATA(capi_trans_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(pols,masses,&nmod,&nat,trans); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_trans_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_trans_as_array == NULL) ... else of trans */ + /* End of cleaning variable trans */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + } /*CHECKSCALAR(shape(pols, 1) == nmod)*/ + } /*if (f2py_success) of nmod*/ + /* End of cleaning variable nmod */ + } /*CHECKSCALAR(shape(pols, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_pols_as_array!=pols_capi) { + Py_XDECREF(capi_pols_as_array); } + } /* if (capi_pols_as_array == NULL) ... else of pols */ + /* End of cleaning variable pols */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of get_translations **************************/ + +/******************************** q2qstar_out ********************************/ +static char doc_f2py_rout_symph_q2qstar_out[] = "\ +dynqstar = q2qstar_out(dyn,at,bg,nsym,s,invs,irt,rtau,nq,sxq,isq,imq,nqtot,[nat])\n\nWrapper for ``q2qstar_out``.\ +\n\nParameters\n----------\n" +"dyn : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"nsym : input int\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"invs : input rank-1 array('i') with bounds (48)\n" +"irt : input rank-2 array('i') with bounds (48,nat)\n" +"rtau : input rank-3 array('d') with bounds (3,48,nat)\n" +"nq : input int\n" +"sxq : input rank-2 array('d') with bounds (3,48)\n" +"isq : input rank-1 array('i') with bounds (48)\n" +"imq : input int\n" +"nqtot : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(dyn, 0) / 3\n" +"\nReturns\n-------\n" +"dynqstar : rank-5 array('D') with bounds (nqtot,3,3,nat,nat)"; +/* extern void F_FUNC_US(q2qstar_out,Q2QSTAR_OUT)(complex_double*,double*,double*,int*,int*,int*,int*,int*,double*,int*,double*,int*,int*,int*,complex_double*); */ +static PyObject *f2py_rout_symph_q2qstar_out(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,double*,int*,int*,int*,int*,int*,double*,int*,double*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *dyn = NULL; + npy_intp dyn_Dims[2] = {-1, -1}; + const int dyn_Rank = 2; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + PyObject *dyn_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *invs = NULL; + npy_intp invs_Dims[1] = {-1}; + const int invs_Rank = 1; + PyArrayObject *capi_invs_as_array = NULL; + int capi_invs_intent = 0; + PyObject *invs_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + double *rtau = NULL; + npy_intp rtau_Dims[3] = {-1, -1, -1}; + const int rtau_Rank = 3; + PyArrayObject *capi_rtau_as_array = NULL; + int capi_rtau_intent = 0; + PyObject *rtau_capi = Py_None; + int nq = 0; + PyObject *nq_capi = Py_None; + double *sxq = NULL; + npy_intp sxq_Dims[2] = {-1, -1}; + const int sxq_Rank = 2; + PyArrayObject *capi_sxq_as_array = NULL; + int capi_sxq_intent = 0; + PyObject *sxq_capi = Py_None; + int *isq = NULL; + npy_intp isq_Dims[1] = {-1}; + const int isq_Rank = 1; + PyArrayObject *capi_isq_as_array = NULL; + int capi_isq_intent = 0; + PyObject *isq_capi = Py_None; + int imq = 0; + PyObject *imq_capi = Py_None; + int nqtot = 0; + PyObject *nqtot_capi = Py_None; + complex_double *dynqstar = NULL; + npy_intp dynqstar_Dims[5] = {-1, -1, -1, -1, -1}; + const int dynqstar_Rank = 5; + PyArrayObject *capi_dynqstar_as_array = NULL; + int capi_dynqstar_intent = 0; + static char *capi_kwlist[] = {"dyn","at","bg","nsym","s","invs","irt","rtau","nq","sxq","isq","imq","nqtot","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOO|O:symph.q2qstar_out",\ + capi_kwlist,&dyn_capi,&at_capi,&bg_capi,&nsym_capi,&s_capi,&invs_capi,&irt_capi,&rtau_capi,&nq_capi,&sxq_capi,&isq_capi,&imq_capi,&nqtot_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.q2qstar_out() 4th argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 5th argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable invs */ + invs_Dims[0]=48; + capi_invs_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 6th argument `invs`"; + capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); + if (capi_invs_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + invs = (int *)(PyArray_DATA(capi_invs_as_array)); + + /* Processing variable nq */ + f2py_success = int_from_pyobj(&nq,nq_capi,"symph.q2qstar_out() 9th argument (nq) can't be converted to int"); + if (f2py_success) { + /* Processing variable isq */ + isq_Dims[0]=48; + capi_isq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 11st argument `isq`"; + capi_isq_as_array = ndarray_from_pyobj( NPY_INT,1,isq_Dims,isq_Rank, capi_isq_intent,isq_capi,capi_errmess); + if (capi_isq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + isq = (int *)(PyArray_DATA(capi_isq_as_array)); + + /* Processing variable imq */ + f2py_success = int_from_pyobj(&imq,imq_capi,"symph.q2qstar_out() 12nd argument (imq) can't be converted to int"); + if (f2py_success) { + /* Processing variable nqtot */ + f2py_success = int_from_pyobj(&nqtot,nqtot_capi,"symph.q2qstar_out() 13rd argument (nqtot) can't be converted to int"); + if (f2py_success) { + /* Processing variable dyn */ + ; + capi_dyn_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 1st argument `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 2nd argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 3rd argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable sxq */ + sxq_Dims[0]=3,sxq_Dims[1]=48; + capi_sxq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 10th argument `sxq`"; + capi_sxq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sxq_Dims,sxq_Rank, capi_sxq_intent,sxq_capi,capi_errmess); + if (capi_sxq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sxq = (double *)(PyArray_DATA(capi_sxq_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(dyn, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.q2qstar_out() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(dyn, 0) == 3 * nat,"shape(dyn, 0) == 3 * nat","1st keyword nat","q2qstar_out:nat=%d",nat) { + /* Processing variable irt */ + irt_Dims[0]=48,irt_Dims[1]=nat; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 7th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + + /* Processing variable rtau */ + rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; + capi_rtau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 8th argument `rtau`"; + capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,rtau_capi,capi_errmess); + if (capi_rtau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); + + /* Processing variable dynqstar */ + dynqstar_Dims[0]=nqtot,dynqstar_Dims[1]=3,dynqstar_Dims[2]=3,dynqstar_Dims[3]=nat,dynqstar_Dims[4]=nat; + capi_dynqstar_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the hidden `dynqstar`"; + capi_dynqstar_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dynqstar_Dims,dynqstar_Rank, capi_dynqstar_intent,Py_None,capi_errmess); + if (capi_dynqstar_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dynqstar = (complex_double *)(PyArray_DATA(capi_dynqstar_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(dyn,at,bg,&nat,&nsym,s,invs,irt,rtau,&nq,sxq,isq,&imq,&nqtot,dynqstar); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_dynqstar_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_dynqstar_as_array == NULL) ... else of dynqstar */ + /* End of cleaning variable dynqstar */ + if((PyObject *)capi_rtau_as_array!=rtau_capi) { + Py_XDECREF(capi_rtau_as_array); } + } /* if (capi_rtau_as_array == NULL) ... else of rtau */ + /* End of cleaning variable rtau */ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*CHECKSCALAR(shape(dyn, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_sxq_as_array!=sxq_capi) { + Py_XDECREF(capi_sxq_as_array); } + } /* if (capi_sxq_as_array == NULL) ... else of sxq */ + /* End of cleaning variable sxq */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_dyn_as_array!=dyn_capi) { + Py_XDECREF(capi_dyn_as_array); } + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + } /*if (f2py_success) of nqtot*/ + /* End of cleaning variable nqtot */ + } /*if (f2py_success) of imq*/ + /* End of cleaning variable imq */ + if((PyObject *)capi_isq_as_array!=isq_capi) { + Py_XDECREF(capi_isq_as_array); } + } /* if (capi_isq_as_array == NULL) ... else of isq */ + /* End of cleaning variable isq */ + } /*if (f2py_success) of nq*/ + /* End of cleaning variable nq */ + if((PyObject *)capi_invs_as_array!=invs_capi) { + Py_XDECREF(capi_invs_as_array); } + } /* if (capi_invs_as_array == NULL) ... else of invs */ + /* End of cleaning variable invs */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of q2qstar_out *****************************/ + +/********************************** set_asr **********************************/ +static char doc_f2py_rout_symph_set_asr[] = "\ +set_asr(asr,axis,tau,dyn,zeu,[nat])\n\nWrapper for ``set_asr``.\ +\n\nParameters\n----------\n" +"asr : input string(len=10)\n" +"axis : input int\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"dyn : in/output rank-4 array('D') with bounds (3,3,nat,nat)\n" +"zeu : in/output rank-3 array('d') with bounds (3,3,nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)"; +/* extern void F_FUNC_US(set_asr,SET_ASR)(string,int*,int*,double*,complex_double*,double*,size_t); */ +static PyObject *f2py_rout_symph_set_asr(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(string,int*,int*,double*,complex_double*,double*,size_t)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + string asr = NULL; + int slen(asr); + PyObject *asr_capi = Py_None; + int axis = 0; + PyObject *axis_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + complex_double *dyn = NULL; + npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; + const int dyn_Rank = 4; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + PyObject *dyn_capi = Py_None; + double *zeu = NULL; + npy_intp zeu_Dims[3] = {-1, -1, -1}; + const int zeu_Rank = 3; + PyArrayObject *capi_zeu_as_array = NULL; + int capi_zeu_intent = 0; + PyObject *zeu_capi = Py_None; + static char *capi_kwlist[] = {"asr","axis","tau","dyn","zeu","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.set_asr",\ + capi_kwlist,&asr_capi,&axis_capi,&tau_capi,&dyn_capi,&zeu_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable asr */ + slen(asr) = 10; + f2py_success = string_from_pyobj(&asr,&slen(asr),"",asr_capi,"string_from_pyobj failed in converting 1st argument`asr' of symph.set_asr to C string"); + if (f2py_success) { + STRINGPADN(asr, slen(asr), '\0', ' '); + /* Processing variable axis */ + f2py_success = int_from_pyobj(&axis,axis_capi,"symph.set_asr() 2nd argument (axis) can't be converted to int"); + if (f2py_success) { + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_asr: failed to create array from the 3rd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.set_asr() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","set_asr:nat=%d",nat) { + /* Processing variable zeu */ + zeu_Dims[0]=3,zeu_Dims[1]=3,zeu_Dims[2]=nat; + capi_zeu_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.set_asr: failed to create array from the 5th argument `zeu`"; + capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); + if (capi_zeu_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); + + /* Processing variable dyn */ + dyn_Dims[0]=3,dyn_Dims[1]=3,dyn_Dims[2]=nat,dyn_Dims[3]=nat; + capi_dyn_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.set_asr: failed to create array from the 4th argument `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(asr,&axis,&nat,tau,dyn,zeu,slen(asr)); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_dyn_as_array!=dyn_capi) { + Py_XDECREF(capi_dyn_as_array); } + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + if((PyObject *)capi_zeu_as_array!=zeu_capi) { + Py_XDECREF(capi_zeu_as_array); } + } /* if (capi_zeu_as_array == NULL) ... else of zeu */ + /* End of cleaning variable zeu */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*if (f2py_success) of axis*/ + /* End of cleaning variable axis */ + STRINGFREE(asr); + } /*if (f2py_success) of asr*/ + /* End of cleaning variable asr */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of set_asr *******************************/ + +/*********************************** sp_zeu ***********************************/ +static char doc_f2py_rout_symph_sp_zeu[] = "\ +sp_zeu(zeu_u,zeu_v,scal,[nat])\n\nWrapper for ``sp_zeu``.\ +\n\nParameters\n----------\n" +"zeu_u : input rank-3 array('d') with bounds (3,3,nat)\n" +"zeu_v : input rank-3 array('d') with bounds (3,3,nat)\n" +"scal : input float\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(zeu_u, 2)"; +/* extern void F_FUNC_US(sp_zeu,SP_ZEU)(double*,double*,int*,double*); */ +static PyObject *f2py_rout_symph_sp_zeu(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *zeu_u = NULL; + npy_intp zeu_u_Dims[3] = {-1, -1, -1}; + const int zeu_u_Rank = 3; + PyArrayObject *capi_zeu_u_as_array = NULL; + int capi_zeu_u_intent = 0; + PyObject *zeu_u_capi = Py_None; + double *zeu_v = NULL; + npy_intp zeu_v_Dims[3] = {-1, -1, -1}; + const int zeu_v_Rank = 3; + PyArrayObject *capi_zeu_v_as_array = NULL; + int capi_zeu_v_intent = 0; + PyObject *zeu_v_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double scal = 0; + PyObject *scal_capi = Py_None; + static char *capi_kwlist[] = {"zeu_u","zeu_v","scal","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:symph.sp_zeu",\ + capi_kwlist,&zeu_u_capi,&zeu_v_capi,&scal_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable zeu_u */ + zeu_u_Dims[0]=3,zeu_u_Dims[1]=3; + capi_zeu_u_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp_zeu: failed to create array from the 1st argument `zeu_u`"; + capi_zeu_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_u_Dims,zeu_u_Rank, capi_zeu_u_intent,zeu_u_capi,capi_errmess); + if (capi_zeu_u_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + zeu_u = (double *)(PyArray_DATA(capi_zeu_u_as_array)); + + /* Processing variable scal */ + f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp_zeu() 3rd argument (scal) can't be converted to double"); + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(zeu_u, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp_zeu() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(zeu_u, 2) == nat,"shape(zeu_u, 2) == nat","1st keyword nat","sp_zeu:nat=%d",nat) { + /* Processing variable zeu_v */ + zeu_v_Dims[0]=3,zeu_v_Dims[1]=3,zeu_v_Dims[2]=nat; + capi_zeu_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp_zeu: failed to create array from the 2nd argument `zeu_v`"; + capi_zeu_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_v_Dims,zeu_v_Rank, capi_zeu_v_intent,zeu_v_capi,capi_errmess); + if (capi_zeu_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + zeu_v = (double *)(PyArray_DATA(capi_zeu_v_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(zeu_u,zeu_v,&nat,&scal); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_zeu_v_as_array!=zeu_v_capi) { + Py_XDECREF(capi_zeu_v_as_array); } + } /* if (capi_zeu_v_as_array == NULL) ... else of zeu_v */ + /* End of cleaning variable zeu_v */ + } /*CHECKSCALAR(shape(zeu_u, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of scal*/ + /* End of cleaning variable scal */ + if((PyObject *)capi_zeu_u_as_array!=zeu_u_capi) { + Py_XDECREF(capi_zeu_u_as_array); } + } /* if (capi_zeu_u_as_array == NULL) ... else of zeu_u */ + /* End of cleaning variable zeu_u */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of sp_zeu *******************************/ + +/************************************ sp1 ************************************/ +static char doc_f2py_rout_symph_sp1[] = "\ +sp1(u,v,scal,[nat])\n\nWrapper for ``sp1``.\ +\n\nParameters\n----------\n" +"u : input rank-4 array('d') with bounds (3,3,nat,nat)\n" +"v : input rank-4 array('d') with bounds (3,3,nat,nat)\n" +"scal : input float\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(u, 2)"; +/* extern void F_FUNC(sp1,SP1)(double*,double*,int*,double*); */ +static PyObject *f2py_rout_symph_sp1(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *u = NULL; + npy_intp u_Dims[4] = {-1, -1, -1, -1}; + const int u_Rank = 4; + PyArrayObject *capi_u_as_array = NULL; + int capi_u_intent = 0; + PyObject *u_capi = Py_None; + double *v = NULL; + npy_intp v_Dims[4] = {-1, -1, -1, -1}; + const int v_Rank = 4; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double scal = 0; + PyObject *scal_capi = Py_None; + static char *capi_kwlist[] = {"u","v","scal","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:symph.sp1",\ + capi_kwlist,&u_capi,&v_capi,&scal_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u */ + u_Dims[0]=3,u_Dims[1]=3; + capi_u_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp1: failed to create array from the 1st argument `u`"; + capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); + if (capi_u_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u = (double *)(PyArray_DATA(capi_u_as_array)); + + /* Processing variable scal */ + f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp1() 3rd argument (scal) can't be converted to double"); + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(u, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp1() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(u, 2) == nat,"shape(u, 2) == nat","1st keyword nat","sp1:nat=%d",nat) { + /* Processing variable v */ + v_Dims[0]=3,v_Dims[1]=3,v_Dims[2]=nat,v_Dims[3]=nat; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp1: failed to create array from the 2nd argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (double *)(PyArray_DATA(capi_v_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(u,v,&nat,&scal); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ + } /*CHECKSCALAR(shape(u, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of scal*/ + /* End of cleaning variable scal */ + if((PyObject *)capi_u_as_array!=u_capi) { + Py_XDECREF(capi_u_as_array); } + } /* if (capi_u_as_array == NULL) ... else of u */ + /* End of cleaning variable u */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of sp1 *********************************/ + +/************************************ sp2 ************************************/ +static char doc_f2py_rout_symph_sp2[] = "\ +sp2(u,v,ind_v,scal,[nat])\n\nWrapper for ``sp2``.\ +\n\nParameters\n----------\n" +"u : input rank-4 array('d') with bounds (3,3,nat,nat)\n" +"v : input rank-1 array('d') with bounds (2)\n" +"ind_v : input rank-2 array('i') with bounds (2,4)\n" +"scal : input float\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(u, 2)"; +/* extern void F_FUNC(sp2,SP2)(double*,double*,int*,int*,double*); */ +static PyObject *f2py_rout_symph_sp2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *u = NULL; + npy_intp u_Dims[4] = {-1, -1, -1, -1}; + const int u_Rank = 4; + PyArrayObject *capi_u_as_array = NULL; + int capi_u_intent = 0; + PyObject *u_capi = Py_None; + double *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int *ind_v = NULL; + npy_intp ind_v_Dims[2] = {-1, -1}; + const int ind_v_Rank = 2; + PyArrayObject *capi_ind_v_as_array = NULL; + int capi_ind_v_intent = 0; + PyObject *ind_v_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double scal = 0; + PyObject *scal_capi = Py_None; + static char *capi_kwlist[] = {"u","v","ind_v","scal","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|O:symph.sp2",\ + capi_kwlist,&u_capi,&v_capi,&ind_v_capi,&scal_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u */ + u_Dims[0]=3,u_Dims[1]=3; + capi_u_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp2: failed to create array from the 1st argument `u`"; + capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); + if (capi_u_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u = (double *)(PyArray_DATA(capi_u_as_array)); + + /* Processing variable ind_v */ + ind_v_Dims[0]=2,ind_v_Dims[1]=4; + capi_ind_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp2: failed to create array from the 3rd argument `ind_v`"; + capi_ind_v_as_array = ndarray_from_pyobj( NPY_INT,1,ind_v_Dims,ind_v_Rank, capi_ind_v_intent,ind_v_capi,capi_errmess); + if (capi_ind_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ind_v = (int *)(PyArray_DATA(capi_ind_v_as_array)); + + /* Processing variable v */ + v_Dims[0]=2; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp2: failed to create array from the 2nd argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (double *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable scal */ + f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp2() 4th argument (scal) can't be converted to double"); + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(u, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp2() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(u, 2) == nat,"shape(u, 2) == nat","1st keyword nat","sp2:nat=%d",nat) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(u,v,ind_v,&nat,&scal); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(u, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of scal*/ + /* End of cleaning variable scal */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ + if((PyObject *)capi_ind_v_as_array!=ind_v_capi) { + Py_XDECREF(capi_ind_v_as_array); } + } /* if (capi_ind_v_as_array == NULL) ... else of ind_v */ + /* End of cleaning variable ind_v */ + if((PyObject *)capi_u_as_array!=u_capi) { + Py_XDECREF(capi_u_as_array); } + } /* if (capi_u_as_array == NULL) ... else of u */ + /* End of cleaning variable u */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of sp2 *********************************/ + +/************************************ sp3 ************************************/ +static char doc_f2py_rout_symph_sp3[] = "\ +sp3(u,v,i,na,scal,[nat])\n\nWrapper for ``sp3``.\ +\n\nParameters\n----------\n" +"u : input rank-4 array('d') with bounds (3,3,nat,nat)\n" +"v : input rank-4 array('d') with bounds (3,3,nat,nat)\n" +"i : input int\n" +"na : input int\n" +"scal : input float\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(u, 2)"; +/* extern void F_FUNC(sp3,SP3)(double*,double*,int*,int*,int*,double*); */ +static PyObject *f2py_rout_symph_sp3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *u = NULL; + npy_intp u_Dims[4] = {-1, -1, -1, -1}; + const int u_Rank = 4; + PyArrayObject *capi_u_as_array = NULL; + int capi_u_intent = 0; + PyObject *u_capi = Py_None; + double *v = NULL; + npy_intp v_Dims[4] = {-1, -1, -1, -1}; + const int v_Rank = 4; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int i = 0; + PyObject *i_capi = Py_None; + int na = 0; + PyObject *na_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double scal = 0; + PyObject *scal_capi = Py_None; + static char *capi_kwlist[] = {"u","v","i","na","scal","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.sp3",\ + capi_kwlist,&u_capi,&v_capi,&i_capi,&na_capi,&scal_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable i */ + f2py_success = int_from_pyobj(&i,i_capi,"symph.sp3() 3rd argument (i) can't be converted to int"); + if (f2py_success) { + /* Processing variable na */ + f2py_success = int_from_pyobj(&na,na_capi,"symph.sp3() 4th argument (na) can't be converted to int"); + if (f2py_success) { + /* Processing variable u */ + u_Dims[0]=3,u_Dims[1]=3; + capi_u_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp3: failed to create array from the 1st argument `u`"; + capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); + if (capi_u_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u = (double *)(PyArray_DATA(capi_u_as_array)); + + /* Processing variable scal */ + f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp3() 5th argument (scal) can't be converted to double"); + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(u, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp3() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(u, 2) == nat,"shape(u, 2) == nat","1st keyword nat","sp3:nat=%d",nat) { + /* Processing variable v */ + v_Dims[0]=3,v_Dims[1]=3,v_Dims[2]=nat,v_Dims[3]=nat; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sp3: failed to create array from the 2nd argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (double *)(PyArray_DATA(capi_v_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(u,v,&i,&na,&nat,&scal); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ + } /*CHECKSCALAR(shape(u, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of scal*/ + /* End of cleaning variable scal */ + if((PyObject *)capi_u_as_array!=u_capi) { + Py_XDECREF(capi_u_as_array); } + } /* if (capi_u_as_array == NULL) ... else of u */ + /* End of cleaning variable u */ + } /*if (f2py_success) of na*/ + /* End of cleaning variable na */ + } /*if (f2py_success) of i*/ + /* End of cleaning variable i */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of sp3 *********************************/ + +/****************************** symdynph_gq_new ******************************/ +static char doc_f2py_rout_symph_symdynph_gq_new[] = "\ +symdynph_gq_new(xq,phi,s,invs,rtau,irt,irotmq,minus_q,nsymq,[nat])\n\nWrapper for ``symdynph_gq_new``.\ +\n\nParameters\n----------\n" +"xq : input rank-1 array('d') with bounds (3)\n" +"phi : in/output rank-4 array('D') with bounds (3,3,nat,nat)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"invs : input rank-1 array('i') with bounds (48)\n" +"rtau : input rank-3 array('d') with bounds (3,48,nat)\n" +"irt : input rank-2 array('i') with bounds (48,nat)\n" +"irotmq : input int\n" +"minus_q : input int\n" +"nsymq : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(phi, 2)"; +/* extern void F_FUNC_US(symdynph_gq_new,SYMDYNPH_GQ_NEW)(double*,complex_double*,int*,int*,double*,int*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_symdynph_gq_new(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,complex_double*,int*,int*,double*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *xq = NULL; + npy_intp xq_Dims[1] = {-1}; + const int xq_Rank = 1; + PyArrayObject *capi_xq_as_array = NULL; + int capi_xq_intent = 0; + PyObject *xq_capi = Py_None; + complex_double *phi = NULL; + npy_intp phi_Dims[4] = {-1, -1, -1, -1}; + const int phi_Rank = 4; + PyArrayObject *capi_phi_as_array = NULL; + int capi_phi_intent = 0; + PyObject *phi_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *invs = NULL; + npy_intp invs_Dims[1] = {-1}; + const int invs_Rank = 1; + PyArrayObject *capi_invs_as_array = NULL; + int capi_invs_intent = 0; + PyObject *invs_capi = Py_None; + double *rtau = NULL; + npy_intp rtau_Dims[3] = {-1, -1, -1}; + const int rtau_Rank = 3; + PyArrayObject *capi_rtau_as_array = NULL; + int capi_rtau_intent = 0; + PyObject *rtau_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + int irotmq = 0; + PyObject *irotmq_capi = Py_None; + int minus_q = 0; + PyObject *minus_q_capi = Py_None; + int nsymq = 0; + PyObject *nsymq_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"xq","phi","s","invs","rtau","irt","irotmq","minus_q","nsymq","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOO|O:symph.symdynph_gq_new",\ + capi_kwlist,&xq_capi,&phi_capi,&s_capi,&invs_capi,&rtau_capi,&irt_capi,&irotmq_capi,&minus_q_capi,&nsymq_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nsymq */ + f2py_success = int_from_pyobj(&nsymq,nsymq_capi,"symph.symdynph_gq_new() 9th argument (nsymq) can't be converted to int"); + if (f2py_success) { + /* Processing variable irotmq */ + f2py_success = int_from_pyobj(&irotmq,irotmq_capi,"symph.symdynph_gq_new() 7th argument (irotmq) can't be converted to int"); + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 3rd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable invs */ + invs_Dims[0]=48; + capi_invs_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 4th argument `invs`"; + capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); + if (capi_invs_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + invs = (int *)(PyArray_DATA(capi_invs_as_array)); + + /* Processing variable xq */ + xq_Dims[0]=3; + capi_xq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 1st argument `xq`"; + capi_xq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xq_Dims,xq_Rank, capi_xq_intent,xq_capi,capi_errmess); + if (capi_xq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xq = (double *)(PyArray_DATA(capi_xq_as_array)); + + /* Processing variable minus_q */ + minus_q = (int)PyObject_IsTrue(minus_q_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable phi */ + phi_Dims[0]=3,phi_Dims[1]=3; + capi_phi_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 2nd argument `phi`"; + capi_phi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi_Dims,phi_Rank, capi_phi_intent,phi_capi,capi_errmess); + if (capi_phi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phi = (complex_double *)(PyArray_DATA(capi_phi_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(phi, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symdynph_gq_new() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(phi, 2) == nat,"shape(phi, 2) == nat","1st keyword nat","symdynph_gq_new:nat=%d",nat) { + /* Processing variable irt */ + irt_Dims[0]=48,irt_Dims[1]=nat; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 6th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + + /* Processing variable rtau */ + rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; + capi_rtau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 5th argument `rtau`"; + capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,rtau_capi,capi_errmess); + if (capi_rtau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(xq,phi,s,invs,rtau,irt,&irotmq,&minus_q,&nsymq,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_rtau_as_array!=rtau_capi) { + Py_XDECREF(capi_rtau_as_array); } + } /* if (capi_rtau_as_array == NULL) ... else of rtau */ + /* End of cleaning variable rtau */ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*CHECKSCALAR(shape(phi, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_phi_as_array!=phi_capi) { + Py_XDECREF(capi_phi_as_array); } + } /* if (capi_phi_as_array == NULL) ... else of phi */ + /* End of cleaning variable phi */ + } /*if (f2py_success) of minus_q*/ + /* End of cleaning variable minus_q */ + if((PyObject *)capi_xq_as_array!=xq_capi) { + Py_XDECREF(capi_xq_as_array); } + } /* if (capi_xq_as_array == NULL) ... else of xq */ + /* End of cleaning variable xq */ + if((PyObject *)capi_invs_as_array!=invs_capi) { + Py_XDECREF(capi_invs_as_array); } + } /* if (capi_invs_as_array == NULL) ... else of invs */ + /* End of cleaning variable invs */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of irotmq*/ + /* End of cleaning variable irotmq */ + } /*if (f2py_success) of nsymq*/ + /* End of cleaning variable nsymq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of symdynph_gq_new ***************************/ + +/********************************** trntnsc **********************************/ +static char doc_f2py_rout_symph_trntnsc[] = "\ +trntnsc(phi,at,bg,iflg)\n\nWrapper for ``trntnsc``.\ +\n\nParameters\n----------\n" +"phi : input rank-2 array('D') with bounds (3,3)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"iflg : input int"; +/* extern void F_FUNC(trntnsc,TRNTNSC)(complex_double*,double*,double*,int*); */ +static PyObject *f2py_rout_symph_trntnsc(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *phi = NULL; + npy_intp phi_Dims[2] = {-1, -1}; + const int phi_Rank = 2; + PyArrayObject *capi_phi_as_array = NULL; + int capi_phi_intent = 0; + PyObject *phi_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + int iflg = 0; + PyObject *iflg_capi = Py_None; + static char *capi_kwlist[] = {"phi","at","bg","iflg",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:symph.trntnsc",\ + capi_kwlist,&phi_capi,&at_capi,&bg_capi,&iflg_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable iflg */ + f2py_success = int_from_pyobj(&iflg,iflg_capi,"symph.trntnsc() 4th argument (iflg) can't be converted to int"); + if (f2py_success) { + /* Processing variable phi */ + phi_Dims[0]=3,phi_Dims[1]=3; + capi_phi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trntnsc: failed to create array from the 1st argument `phi`"; + capi_phi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi_Dims,phi_Rank, capi_phi_intent,phi_capi,capi_errmess); + if (capi_phi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phi = (complex_double *)(PyArray_DATA(capi_phi_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trntnsc: failed to create array from the 2nd argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trntnsc: failed to create array from the 3rd argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(phi,at,bg,&iflg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_phi_as_array!=phi_capi) { + Py_XDECREF(capi_phi_as_array); } + } /* if (capi_phi_as_array == NULL) ... else of phi */ + /* End of cleaning variable phi */ + } /*if (f2py_success) of iflg*/ + /* End of cleaning variable iflg */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of trntnsc *******************************/ + +/********************************** rgd_blk **********************************/ +static char doc_f2py_rout_symph_rgd_blk[] = "\ +rgd_blk(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,[nat])\n\nWrapper for ``rgd_blk``.\ +\n\nParameters\n----------\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"dyn : input rank-4 array('D') with bounds (3,3,nat,nat)\n" +"q : input rank-1 array('d') with bounds (3)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"epsil : input rank-2 array('d') with bounds (3,3)\n" +"zeu : input rank-3 array('d') with bounds (3,3,nat)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"omega : input float\n" +"alat : input float\n" +"loto_2d : input int\n" +"sign : input float\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(dyn, 2)"; +/* extern void F_FUNC_US(rgd_blk,RGD_BLK)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); */ +static PyObject *f2py_rout_symph_rgd_blk(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + complex_double *dyn = NULL; + npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; + const int dyn_Rank = 4; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + PyObject *dyn_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[1] = {-1}; + const int q_Rank = 1; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *epsil = NULL; + npy_intp epsil_Dims[2] = {-1, -1}; + const int epsil_Rank = 2; + PyArrayObject *capi_epsil_as_array = NULL; + int capi_epsil_intent = 0; + PyObject *epsil_capi = Py_None; + double *zeu = NULL; + npy_intp zeu_Dims[3] = {-1, -1, -1}; + const int zeu_Rank = 3; + PyArrayObject *capi_zeu_as_array = NULL; + int capi_zeu_intent = 0; + PyObject *zeu_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + double omega = 0; + PyObject *omega_capi = Py_None; + double alat = 0; + PyObject *alat_capi = Py_None; + int loto_2d = 0; + PyObject *loto_2d_capi = Py_None; + double sign = 0; + PyObject *sign_capi = Py_None; + static char *capi_kwlist[] = {"nr1","nr2","nr3","dyn","q","tau","epsil","zeu","bg","omega","alat","loto_2d","sign","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOO|O:symph.rgd_blk",\ + capi_kwlist,&nr1_capi,&nr2_capi,&nr3_capi,&dyn_capi,&q_capi,&tau_capi,&epsil_capi,&zeu_capi,&bg_capi,&omega_capi,&alat_capi,&loto_2d_capi,&sign_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.rgd_blk() 1st argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.rgd_blk() 2nd argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.rgd_blk() 3rd argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable dyn */ + dyn_Dims[0]=3,dyn_Dims[1]=3; + capi_dyn_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 4th argument `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 5th argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable epsil */ + epsil_Dims[0]=3,epsil_Dims[1]=3; + capi_epsil_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 7th argument `epsil`"; + capi_epsil_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,epsil_Dims,epsil_Rank, capi_epsil_intent,epsil_capi,capi_errmess); + if (capi_epsil_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + epsil = (double *)(PyArray_DATA(capi_epsil_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 9th argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable omega */ + f2py_success = double_from_pyobj(&omega,omega_capi,"symph.rgd_blk() 10th argument (omega) can't be converted to double"); + if (f2py_success) { + /* Processing variable alat */ + f2py_success = double_from_pyobj(&alat,alat_capi,"symph.rgd_blk() 11st argument (alat) can't be converted to double"); + if (f2py_success) { + /* Processing variable sign */ + f2py_success = double_from_pyobj(&sign,sign_capi,"symph.rgd_blk() 13rd argument (sign) can't be converted to double"); + if (f2py_success) { + /* Processing variable loto_2d */ + loto_2d = (int)PyObject_IsTrue(loto_2d_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(dyn, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.rgd_blk() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(dyn, 2) == nat,"shape(dyn, 2) == nat","1st keyword nat","rgd_blk:nat=%d",nat) { + /* Processing variable tau */ + tau_Dims[0]=3,tau_Dims[1]=nat; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 6th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable zeu */ + zeu_Dims[0]=3,zeu_Dims[1]=3,zeu_Dims[2]=nat; + capi_zeu_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 8th argument `zeu`"; + capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); + if (capi_zeu_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nr1,&nr2,&nr3,&nat,dyn,q,tau,epsil,zeu,bg,&omega,&alat,&loto_2d,&sign); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_zeu_as_array!=zeu_capi) { + Py_XDECREF(capi_zeu_as_array); } + } /* if (capi_zeu_as_array == NULL) ... else of zeu */ + /* End of cleaning variable zeu */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*CHECKSCALAR(shape(dyn, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of loto_2d*/ + /* End of cleaning variable loto_2d */ + } /*if (f2py_success) of sign*/ + /* End of cleaning variable sign */ + } /*if (f2py_success) of alat*/ + /* End of cleaning variable alat */ + } /*if (f2py_success) of omega*/ + /* End of cleaning variable omega */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_epsil_as_array!=epsil_capi) { + Py_XDECREF(capi_epsil_as_array); } + } /* if (capi_epsil_as_array == NULL) ... else of epsil */ + /* End of cleaning variable epsil */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ + if((PyObject *)capi_dyn_as_array!=dyn_capi) { + Py_XDECREF(capi_dyn_as_array); } + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of rgd_blk *******************************/ + +/************************** rgd_blk_diff_phase_conv **************************/ +static char doc_f2py_rout_symph_rgd_blk_diff_phase_conv[] = "\ +rgd_blk_diff_phase_conv(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,[nat])\n\nWrapper for ``rgd_blk_diff_phase_conv``.\ +\n\nParameters\n----------\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"dyn : input rank-4 array('D') with bounds (3,3,nat,nat)\n" +"q : input rank-1 array('d') with bounds (3)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"epsil : input rank-2 array('d') with bounds (3,3)\n" +"zeu : input rank-3 array('d') with bounds (3,3,nat)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"omega : input float\n" +"alat : input float\n" +"loto_2d : input int\n" +"sign : input float\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(dyn, 2)"; +/* extern void F_FUNC_US(rgd_blk_diff_phase_conv,RGD_BLK_DIFF_PHASE_CONV)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); */ +static PyObject *f2py_rout_symph_rgd_blk_diff_phase_conv(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + complex_double *dyn = NULL; + npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; + const int dyn_Rank = 4; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + PyObject *dyn_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[1] = {-1}; + const int q_Rank = 1; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *epsil = NULL; + npy_intp epsil_Dims[2] = {-1, -1}; + const int epsil_Rank = 2; + PyArrayObject *capi_epsil_as_array = NULL; + int capi_epsil_intent = 0; + PyObject *epsil_capi = Py_None; + double *zeu = NULL; + npy_intp zeu_Dims[3] = {-1, -1, -1}; + const int zeu_Rank = 3; + PyArrayObject *capi_zeu_as_array = NULL; + int capi_zeu_intent = 0; + PyObject *zeu_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + double omega = 0; + PyObject *omega_capi = Py_None; + double alat = 0; + PyObject *alat_capi = Py_None; + int loto_2d = 0; + PyObject *loto_2d_capi = Py_None; + double sign = 0; + PyObject *sign_capi = Py_None; + static char *capi_kwlist[] = {"nr1","nr2","nr3","dyn","q","tau","epsil","zeu","bg","omega","alat","loto_2d","sign","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOO|O:symph.rgd_blk_diff_phase_conv",\ + capi_kwlist,&nr1_capi,&nr2_capi,&nr3_capi,&dyn_capi,&q_capi,&tau_capi,&epsil_capi,&zeu_capi,&bg_capi,&omega_capi,&alat_capi,&loto_2d_capi,&sign_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.rgd_blk_diff_phase_conv() 1st argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.rgd_blk_diff_phase_conv() 2nd argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.rgd_blk_diff_phase_conv() 3rd argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable dyn */ + dyn_Dims[0]=3,dyn_Dims[1]=3; + capi_dyn_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 4th argument `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 5th argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable epsil */ + epsil_Dims[0]=3,epsil_Dims[1]=3; + capi_epsil_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 7th argument `epsil`"; + capi_epsil_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,epsil_Dims,epsil_Rank, capi_epsil_intent,epsil_capi,capi_errmess); + if (capi_epsil_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + epsil = (double *)(PyArray_DATA(capi_epsil_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 9th argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable omega */ + f2py_success = double_from_pyobj(&omega,omega_capi,"symph.rgd_blk_diff_phase_conv() 10th argument (omega) can't be converted to double"); + if (f2py_success) { + /* Processing variable alat */ + f2py_success = double_from_pyobj(&alat,alat_capi,"symph.rgd_blk_diff_phase_conv() 11st argument (alat) can't be converted to double"); + if (f2py_success) { + /* Processing variable sign */ + f2py_success = double_from_pyobj(&sign,sign_capi,"symph.rgd_blk_diff_phase_conv() 13rd argument (sign) can't be converted to double"); + if (f2py_success) { + /* Processing variable loto_2d */ + loto_2d = (int)PyObject_IsTrue(loto_2d_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(dyn, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.rgd_blk_diff_phase_conv() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(dyn, 2) == nat,"shape(dyn, 2) == nat","1st keyword nat","rgd_blk_diff_phase_conv:nat=%d",nat) { + /* Processing variable tau */ + tau_Dims[0]=3,tau_Dims[1]=nat; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 6th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable zeu */ + zeu_Dims[0]=3,zeu_Dims[1]=3,zeu_Dims[2]=nat; + capi_zeu_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 8th argument `zeu`"; + capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); + if (capi_zeu_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nr1,&nr2,&nr3,&nat,dyn,q,tau,epsil,zeu,bg,&omega,&alat,&loto_2d,&sign); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_zeu_as_array!=zeu_capi) { + Py_XDECREF(capi_zeu_as_array); } + } /* if (capi_zeu_as_array == NULL) ... else of zeu */ + /* End of cleaning variable zeu */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*CHECKSCALAR(shape(dyn, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of loto_2d*/ + /* End of cleaning variable loto_2d */ + } /*if (f2py_success) of sign*/ + /* End of cleaning variable sign */ + } /*if (f2py_success) of alat*/ + /* End of cleaning variable alat */ + } /*if (f2py_success) of omega*/ + /* End of cleaning variable omega */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_epsil_as_array!=epsil_capi) { + Py_XDECREF(capi_epsil_as_array); } + } /* if (capi_epsil_as_array == NULL) ... else of epsil */ + /* End of cleaning variable epsil */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ + if((PyObject *)capi_dyn_as_array!=dyn_capi) { + Py_XDECREF(capi_dyn_as_array); } + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of rgd_blk_diff_phase_conv ***********************/ + +/********************************** nonanal **********************************/ +static char doc_f2py_rout_symph_nonanal[] = "\ +nonanal(itau_blk,epsil,q,zeu,omega,dyn,[nat,nat_blk])\n\nWrapper for ``nonanal``.\ +\n\nParameters\n----------\n" +"itau_blk : input rank-1 array('i') with bounds (nat)\n" +"epsil : input rank-2 array('d') with bounds (3,3)\n" +"q : input rank-1 array('d') with bounds (3)\n" +"zeu : input rank-3 array('d') with bounds (3,3,nat_blk)\n" +"omega : input float\n" +"dyn : in/output rank-4 array('D') with bounds (3,3,nat,nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(itau_blk, 0)\n" +"nat_blk : input int, optional\n Default: shape(zeu, 2)"; +/* extern void F_FUNC(nonanal,NONANAL)(int*,int*,int*,double*,double*,double*,double*,complex_double*); */ +static PyObject *f2py_rout_symph_nonanal(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,double*,double*,double*,double*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + int nat_blk = 0; + PyObject *nat_blk_capi = Py_None; + int *itau_blk = NULL; + npy_intp itau_blk_Dims[1] = {-1}; + const int itau_blk_Rank = 1; + PyArrayObject *capi_itau_blk_as_array = NULL; + int capi_itau_blk_intent = 0; + PyObject *itau_blk_capi = Py_None; + double *epsil = NULL; + npy_intp epsil_Dims[2] = {-1, -1}; + const int epsil_Rank = 2; + PyArrayObject *capi_epsil_as_array = NULL; + int capi_epsil_intent = 0; + PyObject *epsil_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[1] = {-1}; + const int q_Rank = 1; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *zeu = NULL; + npy_intp zeu_Dims[3] = {-1, -1, -1}; + const int zeu_Rank = 3; + PyArrayObject *capi_zeu_as_array = NULL; + int capi_zeu_intent = 0; + PyObject *zeu_capi = Py_None; + double omega = 0; + PyObject *omega_capi = Py_None; + complex_double *dyn = NULL; + npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; + const int dyn_Rank = 4; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + PyObject *dyn_capi = Py_None; + static char *capi_kwlist[] = {"itau_blk","epsil","q","zeu","omega","dyn","nat","nat_blk",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:symph.nonanal",\ + capi_kwlist,&itau_blk_capi,&epsil_capi,&q_capi,&zeu_capi,&omega_capi,&dyn_capi,&nat_capi,&nat_blk_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable itau_blk */ + ; + capi_itau_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 1st argument `itau_blk`"; + capi_itau_blk_as_array = ndarray_from_pyobj( NPY_INT,1,itau_blk_Dims,itau_blk_Rank, capi_itau_blk_intent,itau_blk_capi,capi_errmess); + if (capi_itau_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau_blk = (int *)(PyArray_DATA(capi_itau_blk_as_array)); + + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 3rd argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable epsil */ + epsil_Dims[0]=3,epsil_Dims[1]=3; + capi_epsil_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 2nd argument `epsil`"; + capi_epsil_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,epsil_Dims,epsil_Rank, capi_epsil_intent,epsil_capi,capi_errmess); + if (capi_epsil_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + epsil = (double *)(PyArray_DATA(capi_epsil_as_array)); + + /* Processing variable zeu */ + zeu_Dims[0]=3,zeu_Dims[1]=3; + capi_zeu_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 4th argument `zeu`"; + capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); + if (capi_zeu_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); + + /* Processing variable omega */ + f2py_success = double_from_pyobj(&omega,omega_capi,"symph.nonanal() 5th argument (omega) can't be converted to double"); + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(itau_blk, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.nonanal() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(itau_blk, 0) == nat,"shape(itau_blk, 0) == nat","1st keyword nat","nonanal:nat=%d",nat) { + /* Processing variable nat_blk */ + if (nat_blk_capi == Py_None) nat_blk = shape(zeu, 2); else + f2py_success = int_from_pyobj(&nat_blk,nat_blk_capi,"symph.nonanal() 2nd keyword (nat_blk) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(zeu, 2) == nat_blk,"shape(zeu, 2) == nat_blk","2nd keyword nat_blk","nonanal:nat_blk=%d",nat_blk) { + /* Processing variable dyn */ + dyn_Dims[0]=3,dyn_Dims[1]=3,dyn_Dims[2]=nat,dyn_Dims[3]=nat; + capi_dyn_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 6th argument `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,&nat_blk,itau_blk,epsil,q,zeu,&omega,dyn); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_dyn_as_array!=dyn_capi) { + Py_XDECREF(capi_dyn_as_array); } + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + } /*CHECKSCALAR(shape(zeu, 2) == nat_blk)*/ + } /*if (f2py_success) of nat_blk*/ + /* End of cleaning variable nat_blk */ + } /*CHECKSCALAR(shape(itau_blk, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of omega*/ + /* End of cleaning variable omega */ + if((PyObject *)capi_zeu_as_array!=zeu_capi) { + Py_XDECREF(capi_zeu_as_array); } + } /* if (capi_zeu_as_array == NULL) ... else of zeu */ + /* End of cleaning variable zeu */ + if((PyObject *)capi_epsil_as_array!=epsil_capi) { + Py_XDECREF(capi_epsil_as_array); } + } /* if (capi_epsil_as_array == NULL) ... else of epsil */ + /* End of cleaning variable epsil */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ + if((PyObject *)capi_itau_blk_as_array!=itau_blk_capi) { + Py_XDECREF(capi_itau_blk_as_array); } + } /* if (capi_itau_blk_as_array == NULL) ... else of itau_blk */ + /* End of cleaning variable itau_blk */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of nonanal *******************************/ + +/*********************************** trasl ***********************************/ +static char doc_f2py_rout_symph_trasl[] = "\ +phid = trasl(phiq,nq,nr1,nr2,nr3,m1,m2,m3,[nat])\n\nWrapper for ``trasl``.\ +\n\nParameters\n----------\n" +"phiq : input rank-5 array('D') with bounds (3,3,nat,nat,48)\n" +"nq : input int\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"m1 : input int\n" +"m2 : input int\n" +"m3 : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(phiq, 2)\n" +"\nReturns\n-------\n" +"phid : rank-7 array('D') with bounds (nr1,nr2,nr3,3,3,nat,nat)"; +/* extern void F_FUNC(trasl,TRASL)(complex_double*,complex_double*,int*,int*,int*,int*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_trasl(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,complex_double*,int*,int*,int*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *phid = NULL; + npy_intp phid_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int phid_Rank = 7; + PyArrayObject *capi_phid_as_array = NULL; + int capi_phid_intent = 0; + complex_double *phiq = NULL; + npy_intp phiq_Dims[5] = {-1, -1, -1, -1, -1}; + const int phiq_Rank = 5; + PyArrayObject *capi_phiq_as_array = NULL; + int capi_phiq_intent = 0; + PyObject *phiq_capi = Py_None; + int nq = 0; + PyObject *nq_capi = Py_None; + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int m1 = 0; + PyObject *m1_capi = Py_None; + int m2 = 0; + PyObject *m2_capi = Py_None; + int m3 = 0; + PyObject *m3_capi = Py_None; + static char *capi_kwlist[] = {"phiq","nq","nr1","nr2","nr3","m1","m2","m3","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|O:symph.trasl",\ + capi_kwlist,&phiq_capi,&nq_capi,&nr1_capi,&nr2_capi,&nr3_capi,&m1_capi,&m2_capi,&m3_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.trasl() 3rd argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.trasl() 4th argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.trasl() 5th argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable m1 */ + f2py_success = int_from_pyobj(&m1,m1_capi,"symph.trasl() 6th argument (m1) can't be converted to int"); + if (f2py_success) { + /* Processing variable m2 */ + f2py_success = int_from_pyobj(&m2,m2_capi,"symph.trasl() 7th argument (m2) can't be converted to int"); + if (f2py_success) { + /* Processing variable m3 */ + f2py_success = int_from_pyobj(&m3,m3_capi,"symph.trasl() 8th argument (m3) can't be converted to int"); + if (f2py_success) { + /* Processing variable nq */ + f2py_success = int_from_pyobj(&nq,nq_capi,"symph.trasl() 2nd argument (nq) can't be converted to int"); + if (f2py_success) { + /* Processing variable phiq */ + phiq_Dims[0]=3,phiq_Dims[1]=3,phiq_Dims[4]=48; + capi_phiq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trasl: failed to create array from the 1st argument `phiq`"; + capi_phiq_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phiq_Dims,phiq_Rank, capi_phiq_intent,phiq_capi,capi_errmess); + if (capi_phiq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phiq = (complex_double *)(PyArray_DATA(capi_phiq_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(phiq, 2); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.trasl() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(phiq, 2) == nat,"shape(phiq, 2) == nat","1st keyword nat","trasl:nat=%d",nat) { + /* Processing variable phid */ + phid_Dims[0]=nr1,phid_Dims[1]=nr2,phid_Dims[2]=nr3,phid_Dims[3]=3,phid_Dims[4]=3,phid_Dims[5]=nat,phid_Dims[6]=nat; + capi_phid_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.trasl: failed to create array from the hidden `phid`"; + capi_phid_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phid_Dims,phid_Rank, capi_phid_intent,Py_None,capi_errmess); + if (capi_phid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phid = (complex_double *)(PyArray_DATA(capi_phid_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(phid,phiq,&nq,&nr1,&nr2,&nr3,&nat,&m1,&m2,&m3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_phid_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_phid_as_array == NULL) ... else of phid */ + /* End of cleaning variable phid */ + } /*CHECKSCALAR(shape(phiq, 2) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_phiq_as_array!=phiq_capi) { + Py_XDECREF(capi_phiq_as_array); } + } /* if (capi_phiq_as_array == NULL) ... else of phiq */ + /* End of cleaning variable phiq */ + } /*if (f2py_success) of nq*/ + /* End of cleaning variable nq */ + } /*if (f2py_success) of m3*/ + /* End of cleaning variable m3 */ + } /*if (f2py_success) of m2*/ + /* End of cleaning variable m2 */ + } /*if (f2py_success) of m1*/ + /* End of cleaning variable m1 */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of trasl ********************************/ + +/********************************** frc_blk **********************************/ +static char doc_f2py_rout_symph_frc_blk[] = "\ +dyn = frc_blk(q,tau,frc,at,rws,nrws,[nat,nr1,nr2,nr3,nrwsx])\n\nWrapper for ``frc_blk``.\ +\n\nParameters\n----------\n" +"q : input rank-1 array('d') with bounds (3)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"frc : input rank-7 array('d') with bounds (nr1,nr2,nr3,3,3,nat,nat)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"rws : input rank-2 array('d') with bounds (4,nrwsx)\n" +"nrws : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)\n" +"nr1 : input int, optional\n Default: shape(frc, 0)\n" +"nr2 : input int, optional\n Default: shape(frc, 1)\n" +"nr3 : input int, optional\n Default: shape(frc, 2)\n" +"nrwsx : input int, optional\n Default: shape(rws, 1)\n" +"\nReturns\n-------\n" +"dyn : rank-4 array('D') with bounds (3,3,nat,nat)"; +/* extern void F_FUNC_US(frc_blk,FRC_BLK)(complex_double*,double*,double*,int*,int*,int*,int*,double*,double*,double*,int*,int*); */ +static PyObject *f2py_rout_symph_frc_blk(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,double*,int*,int*,int*,int*,double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *dyn = NULL; + npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; + const int dyn_Rank = 4; + PyArrayObject *capi_dyn_as_array = NULL; + int capi_dyn_intent = 0; + double *q = NULL; + npy_intp q_Dims[1] = {-1}; + const int q_Rank = 1; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + double *frc = NULL; + npy_intp frc_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int frc_Rank = 7; + PyArrayObject *capi_frc_as_array = NULL; + int capi_frc_intent = 0; + PyObject *frc_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *rws = NULL; + npy_intp rws_Dims[2] = {-1, -1}; + const int rws_Rank = 2; + PyArrayObject *capi_rws_as_array = NULL; + int capi_rws_intent = 0; + PyObject *rws_capi = Py_None; + int nrws = 0; + PyObject *nrws_capi = Py_None; + int nrwsx = 0; + PyObject *nrwsx_capi = Py_None; + static char *capi_kwlist[] = {"q","tau","frc","at","rws","nrws","nat","nr1","nr2","nr3","nrwsx",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OOOOO:symph.frc_blk",\ + capi_kwlist,&q_capi,&tau_capi,&frc_capi,&at_capi,&rws_capi,&nrws_capi,&nat_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nrwsx_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nrws */ + f2py_success = int_from_pyobj(&nrws,nrws_capi,"symph.frc_blk() 6th argument (nrws) can't be converted to int"); + if (f2py_success) { + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 2nd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 1st argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 4th argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable rws */ + rws_Dims[0]=4; + capi_rws_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 5th argument `rws`"; + capi_rws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rws_Dims,rws_Rank, capi_rws_intent,rws_capi,capi_errmess); + if (capi_rws_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rws = (double *)(PyArray_DATA(capi_rws_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.frc_blk() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","frc_blk:nat=%d",nat) { + /* Processing variable nrwsx */ + if (nrwsx_capi == Py_None) nrwsx = shape(rws, 1); else + f2py_success = int_from_pyobj(&nrwsx,nrwsx_capi,"symph.frc_blk() 5th keyword (nrwsx) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(rws, 1) == nrwsx,"shape(rws, 1) == nrwsx","5th keyword nrwsx","frc_blk:nrwsx=%d",nrwsx) { + /* Processing variable dyn */ + dyn_Dims[0]=3,dyn_Dims[1]=3,dyn_Dims[2]=nat,dyn_Dims[3]=nat; + capi_dyn_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the hidden `dyn`"; + capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,Py_None,capi_errmess); + if (capi_dyn_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); + + /* Processing variable frc */ + frc_Dims[3]=3,frc_Dims[4]=3,frc_Dims[5]=nat,frc_Dims[6]=nat; + capi_frc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 3rd argument `frc`"; + capi_frc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,frc_Dims,frc_Rank, capi_frc_intent,frc_capi,capi_errmess); + if (capi_frc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + frc = (double *)(PyArray_DATA(capi_frc_as_array)); + + /* Processing variable nr1 */ + if (nr1_capi == Py_None) nr1 = shape(frc, 0); else + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.frc_blk() 2nd keyword (nr1) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(frc, 0) == nr1,"shape(frc, 0) == nr1","2nd keyword nr1","frc_blk:nr1=%d",nr1) { + /* Processing variable nr2 */ + if (nr2_capi == Py_None) nr2 = shape(frc, 1); else + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.frc_blk() 3rd keyword (nr2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(frc, 1) == nr2,"shape(frc, 1) == nr2","3rd keyword nr2","frc_blk:nr2=%d",nr2) { + /* Processing variable nr3 */ + if (nr3_capi == Py_None) nr3 = shape(frc, 2); else + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.frc_blk() 4th keyword (nr3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(frc, 2) == nr3,"shape(frc, 2) == nr3","4th keyword nr3","frc_blk:nr3=%d",nr3) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(dyn,q,tau,&nat,&nr1,&nr2,&nr3,frc,at,rws,&nrws,&nrwsx); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_dyn_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(frc, 2) == nr3)*/ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*CHECKSCALAR(shape(frc, 1) == nr2)*/ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*CHECKSCALAR(shape(frc, 0) == nr1)*/ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ + if((PyObject *)capi_frc_as_array!=frc_capi) { + Py_XDECREF(capi_frc_as_array); } + } /* if (capi_frc_as_array == NULL) ... else of frc */ + /* End of cleaning variable frc */ + } /* if (capi_dyn_as_array == NULL) ... else of dyn */ + /* End of cleaning variable dyn */ + } /*CHECKSCALAR(shape(rws, 1) == nrwsx)*/ + } /*if (f2py_success) of nrwsx*/ + /* End of cleaning variable nrwsx */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_rws_as_array!=rws_capi) { + Py_XDECREF(capi_rws_as_array); } + } /* if (capi_rws_as_array == NULL) ... else of rws */ + /* End of cleaning variable rws */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*if (f2py_success) of nrws*/ + /* End of cleaning variable nrws */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of frc_blk *******************************/ + +/*********************************** wsinit ***********************************/ +static char doc_f2py_rout_symph_wsinit[] = "\ +nrws = wsinit(rws,atw,[nrwsx])\n\nWrapper for ``wsinit``.\ +\n\nParameters\n----------\n" +"rws : in/output rank-2 array('d') with bounds (4,nrwsx)\n" +"atw : input rank-2 array('d') with bounds (3,3)\n" +"\nOther Parameters\n----------------\n" +"nrwsx : input int, optional\n Default: shape(rws, 1)\n" +"\nReturns\n-------\n" +"nrws : int"; +/* extern void F_FUNC(wsinit,WSINIT)(double*,int*,int*,double*); */ +static PyObject *f2py_rout_symph_wsinit(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *rws = NULL; + npy_intp rws_Dims[2] = {-1, -1}; + const int rws_Rank = 2; + PyArrayObject *capi_rws_as_array = NULL; + int capi_rws_intent = 0; + PyObject *rws_capi = Py_None; + int nrwsx = 0; + PyObject *nrwsx_capi = Py_None; + int nrws = 0; + double *atw = NULL; + npy_intp atw_Dims[2] = {-1, -1}; + const int atw_Rank = 2; + PyArrayObject *capi_atw_as_array = NULL; + int capi_atw_intent = 0; + PyObject *atw_capi = Py_None; + static char *capi_kwlist[] = {"rws","atw","nrwsx",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:symph.wsinit",\ + capi_kwlist,&rws_capi,&atw_capi,&nrwsx_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable rws */ + rws_Dims[0]=4; + capi_rws_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.wsinit: failed to create array from the 1st argument `rws`"; + capi_rws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rws_Dims,rws_Rank, capi_rws_intent,rws_capi,capi_errmess); + if (capi_rws_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rws = (double *)(PyArray_DATA(capi_rws_as_array)); + + /* Processing variable atw */ + atw_Dims[0]=3,atw_Dims[1]=3; + capi_atw_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.wsinit: failed to create array from the 2nd argument `atw`"; + capi_atw_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,atw_Dims,atw_Rank, capi_atw_intent,atw_capi,capi_errmess); + if (capi_atw_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + atw = (double *)(PyArray_DATA(capi_atw_as_array)); + + /* Processing variable nrws */ + /* Processing variable nrwsx */ + if (nrwsx_capi == Py_None) nrwsx = shape(rws, 1); else + f2py_success = int_from_pyobj(&nrwsx,nrwsx_capi,"symph.wsinit() 1st keyword (nrwsx) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(rws, 1) == nrwsx,"shape(rws, 1) == nrwsx","1st keyword nrwsx","wsinit:nrwsx=%d",nrwsx) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(rws,&nrwsx,&nrws,atw); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",nrws); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(rws, 1) == nrwsx)*/ + } /*if (f2py_success) of nrwsx*/ + /* End of cleaning variable nrwsx */ + /* End of cleaning variable nrws */ + if((PyObject *)capi_atw_as_array!=atw_capi) { + Py_XDECREF(capi_atw_as_array); } + } /* if (capi_atw_as_array == NULL) ... else of atw */ + /* End of cleaning variable atw */ + if((PyObject *)capi_rws_as_array!=rws_capi) { + Py_XDECREF(capi_rws_as_array); } + } /* if (capi_rws_as_array == NULL) ... else of rws */ + /* End of cleaning variable rws */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of wsinit *******************************/ + +/********************************** wsweight **********************************/ +static char doc_f2py_rout_symph_wsweight[] = "\ +wsweight = wsweight(r,rws,nrws,[nrwsx])\n\nWrapper for ``wsweight``.\ +\n\nParameters\n----------\n" +"r : input rank-1 array('d') with bounds (3)\n" +"rws : input rank-2 array('d') with bounds (4,nrwsx)\n" +"nrws : input int\n" +"\nOther Parameters\n----------------\n" +"nrwsx : input int, optional\n Default: shape(rws, 1)\n" +"\nReturns\n-------\n" +"wsweight : float"; +/* extern void F_WRAPPEDFUNC(wsweight,WSWEIGHT)(double*,double*,double*,int*,int*); */ +static PyObject *f2py_rout_symph_wsweight(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double wsweight = 0; + double *r = NULL; + npy_intp r_Dims[1] = {-1}; + const int r_Rank = 1; + PyArrayObject *capi_r_as_array = NULL; + int capi_r_intent = 0; + PyObject *r_capi = Py_None; + double *rws = NULL; + npy_intp rws_Dims[2] = {-1, -1}; + const int rws_Rank = 2; + PyArrayObject *capi_rws_as_array = NULL; + int capi_rws_intent = 0; + PyObject *rws_capi = Py_None; + int nrws = 0; + PyObject *nrws_capi = Py_None; + int nrwsx = 0; + PyObject *nrwsx_capi = Py_None; + static char *capi_kwlist[] = {"r","rws","nrws","nrwsx",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:symph.wsweight",\ + capi_kwlist,&r_capi,&rws_capi,&nrws_capi,&nrwsx_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nrws */ + f2py_success = int_from_pyobj(&nrws,nrws_capi,"symph.wsweight() 3rd argument (nrws) can't be converted to int"); + if (f2py_success) { + /* Processing variable rws */ + rws_Dims[0]=4; + capi_rws_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.wsweight: failed to create array from the 2nd argument `rws`"; + capi_rws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rws_Dims,rws_Rank, capi_rws_intent,rws_capi,capi_errmess); + if (capi_rws_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rws = (double *)(PyArray_DATA(capi_rws_as_array)); + + /* Processing variable r */ + r_Dims[0]=3; + capi_r_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.wsweight: failed to create array from the 1st argument `r`"; + capi_r_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_Dims,r_Rank, capi_r_intent,r_capi,capi_errmess); + if (capi_r_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r = (double *)(PyArray_DATA(capi_r_as_array)); + + /* Processing variable wsweight */ + /* Processing variable nrwsx */ + if (nrwsx_capi == Py_None) nrwsx = shape(rws, 1); else + f2py_success = int_from_pyobj(&nrwsx,nrwsx_capi,"symph.wsweight() 1st keyword (nrwsx) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(rws, 1) == nrwsx,"shape(rws, 1) == nrwsx","1st keyword nrwsx","wsweight:nrwsx=%d",nrwsx) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&wsweight,r,rws,&nrws,&nrwsx); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",wsweight); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(rws, 1) == nrwsx)*/ + } /*if (f2py_success) of nrwsx*/ + /* End of cleaning variable nrwsx */ + /* End of cleaning variable wsweight */ + if((PyObject *)capi_r_as_array!=r_capi) { + Py_XDECREF(capi_r_as_array); } + } /* if (capi_r_as_array == NULL) ... else of r */ + /* End of cleaning variable r */ + if((PyObject *)capi_rws_as_array!=rws_capi) { + Py_XDECREF(capi_rws_as_array); } + } /* if (capi_rws_as_array == NULL) ... else of rws */ + /* End of cleaning variable rws */ + } /*if (f2py_success) of nrws*/ + /* End of cleaning variable nrws */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of wsweight ******************************/ + +/********************************** get_frc **********************************/ +static char doc_f2py_rout_symph_get_frc[] = "\ +frc = get_frc(phi_sc,tau,tau_sc,at,itau,size1,size2,size3,[nat,natsc])\n\nWrapper for ``get_frc``.\ +\n\nParameters\n----------\n" +"phi_sc : input rank-4 array('d') with bounds (3,3,natsc,natsc)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"tau_sc : input rank-2 array('d') with bounds (3,natsc)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"itau : input rank-1 array('i') with bounds (natsc)\n" +"size1 : input int\n" +"size2 : input int\n" +"size3 : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)\n" +"natsc : input int, optional\n Default: shape(phi_sc, 2)\n" +"\nReturns\n-------\n" +"frc : rank-7 array('d') with bounds (size1,size2,size3,3,3,nat,nat)"; +/* extern void F_FUNC_US(get_frc,GET_FRC)(double*,double*,double*,double*,int*,double*,int*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_get_frc(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,double*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *phi_sc = NULL; + npy_intp phi_sc_Dims[4] = {-1, -1, -1, -1}; + const int phi_sc_Rank = 4; + PyArrayObject *capi_phi_sc_as_array = NULL; + int capi_phi_sc_intent = 0; + PyObject *phi_sc_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tau_sc = NULL; + npy_intp tau_sc_Dims[2] = {-1, -1}; + const int tau_sc_Rank = 2; + PyArrayObject *capi_tau_sc_as_array = NULL; + int capi_tau_sc_intent = 0; + PyObject *tau_sc_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + int *itau = NULL; + npy_intp itau_Dims[1] = {-1}; + const int itau_Rank = 1; + PyArrayObject *capi_itau_as_array = NULL; + int capi_itau_intent = 0; + PyObject *itau_capi = Py_None; + double *frc = NULL; + npy_intp frc_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int frc_Rank = 7; + PyArrayObject *capi_frc_as_array = NULL; + int capi_frc_intent = 0; + int size1 = 0; + PyObject *size1_capi = Py_None; + int size2 = 0; + PyObject *size2_capi = Py_None; + int size3 = 0; + PyObject *size3_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int natsc = 0; + PyObject *natsc_capi = Py_None; + static char *capi_kwlist[] = {"phi_sc","tau","tau_sc","at","itau","size1","size2","size3","nat","natsc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:symph.get_frc",\ + capi_kwlist,&phi_sc_capi,&tau_capi,&tau_sc_capi,&at_capi,&itau_capi,&size1_capi,&size2_capi,&size3_capi,&nat_capi,&natsc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable size1 */ + f2py_success = int_from_pyobj(&size1,size1_capi,"symph.get_frc() 6th argument (size1) can't be converted to int"); + if (f2py_success) { + /* Processing variable size2 */ + f2py_success = int_from_pyobj(&size2,size2_capi,"symph.get_frc() 7th argument (size2) can't be converted to int"); + if (f2py_success) { + /* Processing variable size3 */ + f2py_success = int_from_pyobj(&size3,size3_capi,"symph.get_frc() 8th argument (size3) can't be converted to int"); + if (f2py_success) { + /* Processing variable phi_sc */ + phi_sc_Dims[0]=3,phi_sc_Dims[1]=3; + capi_phi_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 1st argument `phi_sc`"; + capi_phi_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,phi_sc_Dims,phi_sc_Rank, capi_phi_sc_intent,phi_sc_capi,capi_errmess); + if (capi_phi_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + phi_sc = (double *)(PyArray_DATA(capi_phi_sc_as_array)); + + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 2nd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 4th argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_frc() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","get_frc:nat=%d",nat) { + /* Processing variable natsc */ + if (natsc_capi == Py_None) natsc = shape(phi_sc, 2); else + f2py_success = int_from_pyobj(&natsc,natsc_capi,"symph.get_frc() 2nd keyword (natsc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(phi_sc, 2) == natsc,"shape(phi_sc, 2) == natsc","2nd keyword natsc","get_frc:natsc=%d",natsc) { + /* Processing variable tau_sc */ + tau_sc_Dims[0]=3,tau_sc_Dims[1]=natsc; + capi_tau_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 3rd argument `tau_sc`"; + capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); + if (capi_tau_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); + + /* Processing variable itau */ + itau_Dims[0]=natsc; + capi_itau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 5th argument `itau`"; + capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); + if (capi_itau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau = (int *)(PyArray_DATA(capi_itau_as_array)); + + /* Processing variable frc */ + frc_Dims[0]=size1,frc_Dims[1]=size2,frc_Dims[2]=size3,frc_Dims[3]=3,frc_Dims[4]=3,frc_Dims[5]=nat,frc_Dims[6]=nat; + capi_frc_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_frc: failed to create array from the hidden `frc`"; + capi_frc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,frc_Dims,frc_Rank, capi_frc_intent,Py_None,capi_errmess); + if (capi_frc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + frc = (double *)(PyArray_DATA(capi_frc_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(phi_sc,tau,tau_sc,at,itau,frc,&size1,&size2,&size3,&nat,&natsc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_frc_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_frc_as_array == NULL) ... else of frc */ + /* End of cleaning variable frc */ + if((PyObject *)capi_itau_as_array!=itau_capi) { + Py_XDECREF(capi_itau_as_array); } + } /* if (capi_itau_as_array == NULL) ... else of itau */ + /* End of cleaning variable itau */ + if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { + Py_XDECREF(capi_tau_sc_as_array); } + } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ + /* End of cleaning variable tau_sc */ + } /*CHECKSCALAR(shape(phi_sc, 2) == natsc)*/ + } /*if (f2py_success) of natsc*/ + /* End of cleaning variable natsc */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_phi_sc_as_array!=phi_sc_capi) { + Py_XDECREF(capi_phi_sc_as_array); } + } /* if (capi_phi_sc_as_array == NULL) ... else of phi_sc */ + /* End of cleaning variable phi_sc */ + } /*if (f2py_success) of size3*/ + /* End of cleaning variable size3 */ + } /*if (f2py_success) of size2*/ + /* End of cleaning variable size2 */ + } /*if (f2py_success) of size1*/ + /* End of cleaning variable size1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of get_frc *******************************/ + +/************************* asign_supercell_index_new *************************/ +static char doc_f2py_rout_symph_asign_supercell_index_new[] = "\ +l,m,n = asign_supercell_index_new(vect,at)\n\nWrapper for ``asign_supercell_index_new``.\ +\n\nParameters\n----------\n" +"vect : input rank-1 array('d') with bounds (3)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"l : int\n" +"m : int\n" +"n : int"; +/* extern void F_FUNC_US(asign_supercell_index_new,ASIGN_SUPERCELL_INDEX_NEW)(double*,double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_asign_supercell_index_new(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *vect = NULL; + npy_intp vect_Dims[1] = {-1}; + const int vect_Rank = 1; + PyArrayObject *capi_vect_as_array = NULL; + int capi_vect_intent = 0; + PyObject *vect_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + int l = 0; + int m = 0; + int n = 0; + static char *capi_kwlist[] = {"vect","at",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.asign_supercell_index_new",\ + capi_kwlist,&vect_capi,&at_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable vect */ + vect_Dims[0]=3; + capi_vect_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.asign_supercell_index_new: failed to create array from the 1st argument `vect`"; + capi_vect_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vect_Dims,vect_Rank, capi_vect_intent,vect_capi,capi_errmess); + if (capi_vect_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + vect = (double *)(PyArray_DATA(capi_vect_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.asign_supercell_index_new: failed to create array from the 2nd argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable l */ + /* Processing variable m */ + /* Processing variable n */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(vect,at,&l,&m,&n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("iii",l,m,n); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable n */ + /* End of cleaning variable m */ + /* End of cleaning variable l */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_vect_as_array!=vect_capi) { + Py_XDECREF(capi_vect_as_array); } + } /* if (capi_vect_as_array == NULL) ... else of vect */ + /* End of cleaning variable vect */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************** end of asign_supercell_index_new **********************/ + +/*********************************** q_gen ***********************************/ +static char doc_f2py_rout_symph_q_gen[] = "\ +qbid = q_gen(nsc,at_blk,bg_blk,at,bg)\n\nWrapper for ``q_gen``.\ +\n\nParameters\n----------\n" +"nsc : input int\n" +"at_blk : input rank-2 array('d') with bounds (3,3)\n" +"bg_blk : input rank-2 array('d') with bounds (3,3)\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"qbid : rank-2 array('d') with bounds (3,nsc)"; +/* extern void F_FUNC_US(q_gen,Q_GEN)(int*,double*,double*,double*,double*,double*); */ +static PyObject *f2py_rout_symph_q_gen(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nsc = 0; + PyObject *nsc_capi = Py_None; + double *qbid = NULL; + npy_intp qbid_Dims[2] = {-1, -1}; + const int qbid_Rank = 2; + PyArrayObject *capi_qbid_as_array = NULL; + int capi_qbid_intent = 0; + double *at_blk = NULL; + npy_intp at_blk_Dims[2] = {-1, -1}; + const int at_blk_Rank = 2; + PyArrayObject *capi_at_blk_as_array = NULL; + int capi_at_blk_intent = 0; + PyObject *at_blk_capi = Py_None; + double *bg_blk = NULL; + npy_intp bg_blk_Dims[2] = {-1, -1}; + const int bg_blk_Rank = 2; + PyArrayObject *capi_bg_blk_as_array = NULL; + int capi_bg_blk_intent = 0; + PyObject *bg_blk_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + static char *capi_kwlist[] = {"nsc","at_blk","bg_blk","at","bg",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:symph.q_gen",\ + capi_kwlist,&nsc_capi,&at_blk_capi,&bg_blk_capi,&at_capi,&bg_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nsc */ + f2py_success = int_from_pyobj(&nsc,nsc_capi,"symph.q_gen() 1st argument (nsc) can't be converted to int"); + if (f2py_success) { + /* Processing variable at_blk */ + at_blk_Dims[0]=3,at_blk_Dims[1]=3; + capi_at_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 2nd argument `at_blk`"; + capi_at_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_blk_Dims,at_blk_Rank, capi_at_blk_intent,at_blk_capi,capi_errmess); + if (capi_at_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at_blk = (double *)(PyArray_DATA(capi_at_blk_as_array)); + + /* Processing variable bg_blk */ + bg_blk_Dims[0]=3,bg_blk_Dims[1]=3; + capi_bg_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 3rd argument `bg_blk`"; + capi_bg_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_blk_Dims,bg_blk_Rank, capi_bg_blk_intent,bg_blk_capi,capi_errmess); + if (capi_bg_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg_blk = (double *)(PyArray_DATA(capi_bg_blk_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 4th argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 5th argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable qbid */ + qbid_Dims[0]=3,qbid_Dims[1]=nsc; + capi_qbid_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.q_gen: failed to create array from the hidden `qbid`"; + capi_qbid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qbid_Dims,qbid_Rank, capi_qbid_intent,Py_None,capi_errmess); + if (capi_qbid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qbid = (double *)(PyArray_DATA(capi_qbid_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nsc,qbid,at_blk,bg_blk,at,bg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_qbid_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_qbid_as_array == NULL) ... else of qbid */ + /* End of cleaning variable qbid */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_bg_blk_as_array!=bg_blk_capi) { + Py_XDECREF(capi_bg_blk_as_array); } + } /* if (capi_bg_blk_as_array == NULL) ... else of bg_blk */ + /* End of cleaning variable bg_blk */ + if((PyObject *)capi_at_blk_as_array!=at_blk_capi) { + Py_XDECREF(capi_at_blk_as_array); } + } /* if (capi_at_blk_as_array == NULL) ... else of at_blk */ + /* End of cleaning variable at_blk */ + } /*if (f2py_success) of nsc*/ + /* End of cleaning variable nsc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of q_gen ********************************/ + +/********************************** set_tau **********************************/ +static char doc_f2py_rout_symph_set_tau[] = "\ +set_tau(at,at_blk,tau,tau_blk,ityp,ityp_blk,itau_blk,[nat,nat_blk])\n\nWrapper for ``set_tau``.\ +\n\nParameters\n----------\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"at_blk : input rank-2 array('d') with bounds (3,3)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"tau_blk : input rank-2 array('d') with bounds (3,nat_blk)\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"ityp_blk : input rank-1 array('i') with bounds (nat_blk)\n" +"itau_blk : input rank-1 array('i') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)\n" +"nat_blk : input int, optional\n Default: shape(tau_blk, 1)"; +/* extern void F_FUNC_US(set_tau,SET_TAU)(int*,int*,double*,double*,double*,double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_set_tau(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,double*,double*,double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + int nat_blk = 0; + PyObject *nat_blk_capi = Py_None; + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *at_blk = NULL; + npy_intp at_blk_Dims[2] = {-1, -1}; + const int at_blk_Rank = 2; + PyArrayObject *capi_at_blk_as_array = NULL; + int capi_at_blk_intent = 0; + PyObject *at_blk_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tau_blk = NULL; + npy_intp tau_blk_Dims[2] = {-1, -1}; + const int tau_blk_Rank = 2; + PyArrayObject *capi_tau_blk_as_array = NULL; + int capi_tau_blk_intent = 0; + PyObject *tau_blk_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + int *ityp_blk = NULL; + npy_intp ityp_blk_Dims[1] = {-1}; + const int ityp_blk_Rank = 1; + PyArrayObject *capi_ityp_blk_as_array = NULL; + int capi_ityp_blk_intent = 0; + PyObject *ityp_blk_capi = Py_None; + int *itau_blk = NULL; + npy_intp itau_blk_Dims[1] = {-1}; + const int itau_blk_Rank = 1; + PyArrayObject *capi_itau_blk_as_array = NULL; + int capi_itau_blk_intent = 0; + PyObject *itau_blk_capi = Py_None; + static char *capi_kwlist[] = {"at","at_blk","tau","tau_blk","ityp","ityp_blk","itau_blk","nat","nat_blk",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OO:symph.set_tau",\ + capi_kwlist,&at_capi,&at_blk_capi,&tau_capi,&tau_blk_capi,&ityp_capi,&ityp_blk_capi,&itau_blk_capi,&nat_capi,&nat_blk_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 1st argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable at_blk */ + at_blk_Dims[0]=3,at_blk_Dims[1]=3; + capi_at_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 2nd argument `at_blk`"; + capi_at_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_blk_Dims,at_blk_Rank, capi_at_blk_intent,at_blk_capi,capi_errmess); + if (capi_at_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at_blk = (double *)(PyArray_DATA(capi_at_blk_as_array)); + + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 3rd argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable tau_blk */ + tau_blk_Dims[0]=3; + capi_tau_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 4th argument `tau_blk`"; + capi_tau_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_blk_Dims,tau_blk_Rank, capi_tau_blk_intent,tau_blk_capi,capi_errmess); + if (capi_tau_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_blk = (double *)(PyArray_DATA(capi_tau_blk_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.set_tau() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","set_tau:nat=%d",nat) { + /* Processing variable nat_blk */ + if (nat_blk_capi == Py_None) nat_blk = shape(tau_blk, 1); else + f2py_success = int_from_pyobj(&nat_blk,nat_blk_capi,"symph.set_tau() 2nd keyword (nat_blk) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau_blk, 1) == nat_blk,"shape(tau_blk, 1) == nat_blk","2nd keyword nat_blk","set_tau:nat_blk=%d",nat_blk) { + /* Processing variable ityp */ + ityp_Dims[0]=nat; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 5th argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + + /* Processing variable ityp_blk */ + ityp_blk_Dims[0]=nat_blk; + capi_ityp_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 6th argument `ityp_blk`"; + capi_ityp_blk_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_blk_Dims,ityp_blk_Rank, capi_ityp_blk_intent,ityp_blk_capi,capi_errmess); + if (capi_ityp_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp_blk = (int *)(PyArray_DATA(capi_ityp_blk_as_array)); + + /* Processing variable itau_blk */ + itau_blk_Dims[0]=nat; + capi_itau_blk_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 7th argument `itau_blk`"; + capi_itau_blk_as_array = ndarray_from_pyobj( NPY_INT,1,itau_blk_Dims,itau_blk_Rank, capi_itau_blk_intent,itau_blk_capi,capi_errmess); + if (capi_itau_blk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + itau_blk = (int *)(PyArray_DATA(capi_itau_blk_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,&nat_blk,at,at_blk,tau,tau_blk,ityp,ityp_blk,itau_blk); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_itau_blk_as_array!=itau_blk_capi) { + Py_XDECREF(capi_itau_blk_as_array); } + } /* if (capi_itau_blk_as_array == NULL) ... else of itau_blk */ + /* End of cleaning variable itau_blk */ + if((PyObject *)capi_ityp_blk_as_array!=ityp_blk_capi) { + Py_XDECREF(capi_ityp_blk_as_array); } + } /* if (capi_ityp_blk_as_array == NULL) ... else of ityp_blk */ + /* End of cleaning variable ityp_blk */ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ + } /*CHECKSCALAR(shape(tau_blk, 1) == nat_blk)*/ + } /*if (f2py_success) of nat_blk*/ + /* End of cleaning variable nat_blk */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_tau_blk_as_array!=tau_blk_capi) { + Py_XDECREF(capi_tau_blk_as_array); } + } /* if (capi_tau_blk_as_array == NULL) ... else of tau_blk */ + /* End of cleaning variable tau_blk */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_at_blk_as_array!=at_blk_capi) { + Py_XDECREF(capi_at_blk_as_array); } + } /* if (capi_at_blk_as_array == NULL) ... else of at_blk */ + /* End of cleaning variable at_blk */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of set_tau *******************************/ + +/****************************** threetosix_real ******************************/ +static char doc_f2py_rout_symph_threetosix_real[] = "\ +mat6 = threetosix_real(mat3,[nat])\n\nWrapper for ``threetosix_real``.\ +\n\nParameters\n----------\n" +"mat3 : input rank-3 array('d') with bounds (3 * nat,3 * nat,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(mat3, 0) / 3\n" +"\nReturns\n-------\n" +"mat6 : rank-6 array('d') with bounds (nat,nat,nat,3,3,3)"; +/* extern void F_FUNC_US(threetosix_real,THREETOSIX_REAL)(double*,double*,int*); */ +static PyObject *f2py_rout_symph_threetosix_real(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *mat3 = NULL; + npy_intp mat3_Dims[3] = {-1, -1, -1}; + const int mat3_Rank = 3; + PyArrayObject *capi_mat3_as_array = NULL; + int capi_mat3_intent = 0; + PyObject *mat3_capi = Py_None; + double *mat6 = NULL; + npy_intp mat6_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int mat6_Rank = 6; + PyArrayObject *capi_mat6_as_array = NULL; + int capi_mat6_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"mat3","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:symph.threetosix_real",\ + capi_kwlist,&mat3_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable mat3 */ + ; + capi_mat3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.threetosix_real: failed to create array from the 1st argument `mat3`"; + capi_mat3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat3_Dims,mat3_Rank, capi_mat3_intent,mat3_capi,capi_errmess); + if (capi_mat3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mat3 = (double *)(PyArray_DATA(capi_mat3_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(mat3, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.threetosix_real() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(mat3, 0) == 3 * nat,"shape(mat3, 0) == 3 * nat","1st keyword nat","threetosix_real:nat=%d",nat) { + /* Processing variable mat6 */ + mat6_Dims[0]=nat,mat6_Dims[1]=nat,mat6_Dims[2]=nat,mat6_Dims[3]=3,mat6_Dims[4]=3,mat6_Dims[5]=3; + capi_mat6_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.threetosix_real: failed to create array from the hidden `mat6`"; + capi_mat6_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat6_Dims,mat6_Rank, capi_mat6_intent,Py_None,capi_errmess); + if (capi_mat6_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mat6 = (double *)(PyArray_DATA(capi_mat6_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(mat3,mat6,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_mat6_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_mat6_as_array == NULL) ... else of mat6 */ + /* End of cleaning variable mat6 */ + } /*CHECKSCALAR(shape(mat3, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_mat3_as_array!=mat3_capi) { + Py_XDECREF(capi_mat3_as_array); } + } /* if (capi_mat3_as_array == NULL) ... else of mat3 */ + /* End of cleaning variable mat3 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of threetosix_real ***************************/ + +/****************************** sixtothree_real ******************************/ +static char doc_f2py_rout_symph_sixtothree_real[] = "\ +mat3 = sixtothree_real(mat6,[nat])\n\nWrapper for ``sixtothree_real``.\ +\n\nParameters\n----------\n" +"mat6 : input rank-6 array('d') with bounds (nat,nat,nat,3,3,3)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(mat6, 0)\n" +"\nReturns\n-------\n" +"mat3 : rank-3 array('d') with bounds (3 * nat,3 * nat,3 * nat)"; +/* extern void F_FUNC_US(sixtothree_real,SIXTOTHREE_REAL)(double*,double*,int*); */ +static PyObject *f2py_rout_symph_sixtothree_real(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *mat6 = NULL; + npy_intp mat6_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int mat6_Rank = 6; + PyArrayObject *capi_mat6_as_array = NULL; + int capi_mat6_intent = 0; + PyObject *mat6_capi = Py_None; + double *mat3 = NULL; + npy_intp mat3_Dims[3] = {-1, -1, -1}; + const int mat3_Rank = 3; + PyArrayObject *capi_mat3_as_array = NULL; + int capi_mat3_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"mat6","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:symph.sixtothree_real",\ + capi_kwlist,&mat6_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable mat6 */ + mat6_Dims[3]=3,mat6_Dims[4]=3,mat6_Dims[5]=3; + capi_mat6_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sixtothree_real: failed to create array from the 1st argument `mat6`"; + capi_mat6_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat6_Dims,mat6_Rank, capi_mat6_intent,mat6_capi,capi_errmess); + if (capi_mat6_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mat6 = (double *)(PyArray_DATA(capi_mat6_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(mat6, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sixtothree_real() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(mat6, 0) == nat,"shape(mat6, 0) == nat","1st keyword nat","sixtothree_real:nat=%d",nat) { + /* Processing variable mat3 */ + mat3_Dims[0]=3 * nat,mat3_Dims[1]=3 * nat,mat3_Dims[2]=3 * nat; + capi_mat3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.sixtothree_real: failed to create array from the hidden `mat3`"; + capi_mat3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat3_Dims,mat3_Rank, capi_mat3_intent,Py_None,capi_errmess); + if (capi_mat3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mat3 = (double *)(PyArray_DATA(capi_mat3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(mat6,mat3,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_mat3_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_mat3_as_array == NULL) ... else of mat3 */ + /* End of cleaning variable mat3 */ + } /*CHECKSCALAR(shape(mat6, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_mat6_as_array!=mat6_capi) { + Py_XDECREF(capi_mat6_as_array); } + } /* if (capi_mat6_as_array == NULL) ... else of mat6 */ + /* End of cleaning variable mat6 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of sixtothree_real ***************************/ + +/*********************************** eqvect ***********************************/ +static char doc_f2py_rout_symph_eqvect[] = "\ +eqvect = eqvect(x,y,f)\n\nWrapper for ``eqvect``.\ +\n\nParameters\n----------\n" +"x : input rank-1 array('d') with bounds (3)\n" +"y : input rank-1 array('d') with bounds (3)\n" +"f : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"eqvect : int"; +/* extern void F_WRAPPEDFUNC(eqvect,EQVECT)(int*,double*,double*,double*); */ +static PyObject *f2py_rout_symph_eqvect(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int eqvect = 0; + double *x = NULL; + npy_intp x_Dims[1] = {-1}; + const int x_Rank = 1; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + double *y = NULL; + npy_intp y_Dims[1] = {-1}; + const int y_Rank = 1; + PyArrayObject *capi_y_as_array = NULL; + int capi_y_intent = 0; + PyObject *y_capi = Py_None; + double *f = NULL; + npy_intp f_Dims[1] = {-1}; + const int f_Rank = 1; + PyArrayObject *capi_f_as_array = NULL; + int capi_f_intent = 0; + PyObject *f_capi = Py_None; + static char *capi_kwlist[] = {"x","y","f",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:symph.eqvect",\ + capi_kwlist,&x_capi,&y_capi,&f_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable eqvect */ + /* Processing variable x */ + x_Dims[0]=3; + capi_x_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.eqvect: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (double *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable y */ + y_Dims[0]=3; + capi_y_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.eqvect: failed to create array from the 2nd argument `y`"; + capi_y_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,y_Dims,y_Rank, capi_y_intent,y_capi,capi_errmess); + if (capi_y_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + y = (double *)(PyArray_DATA(capi_y_as_array)); + + /* Processing variable f */ + f_Dims[0]=3; + capi_f_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.eqvect: failed to create array from the 3rd argument `f`"; + capi_f_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_Dims,f_Rank, capi_f_intent,f_capi,capi_errmess); + if (capi_f_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f = (double *)(PyArray_DATA(capi_f_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&eqvect,x,y,f); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",eqvect); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_f_as_array!=f_capi) { + Py_XDECREF(capi_f_as_array); } + } /* if (capi_f_as_array == NULL) ... else of f */ + /* End of cleaning variable f */ + if((PyObject *)capi_y_as_array!=y_capi) { + Py_XDECREF(capi_y_as_array); } + } /* if (capi_y_as_array == NULL) ... else of y */ + /* End of cleaning variable y */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ + /* End of cleaning variable eqvect */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of eqvect *******************************/ + +/**************************** get_equivalent_atoms ****************************/ +static char doc_f2py_rout_symph_get_equivalent_atoms[] = "\ +eq_atoms = get_equivalent_atoms(coords1,coords2,unit_cell,ityp1,ityp2,[nat])\n\nWrapper for ``get_equivalent_atoms``.\ +\n\nParameters\n----------\n" +"coords1 : input rank-2 array('d') with bounds (nat,3)\n" +"coords2 : input rank-2 array('d') with bounds (nat,3)\n" +"unit_cell : input rank-2 array('d') with bounds (3,3)\n" +"ityp1 : input rank-1 array('i') with bounds (nat)\n" +"ityp2 : input rank-1 array('i') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(coords1, 0)\n" +"\nReturns\n-------\n" +"eq_atoms : rank-1 array('i') with bounds (nat)"; +/* extern void F_FUNC_US(get_equivalent_atoms,GET_EQUIVALENT_ATOMS)(double*,double*,double*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_get_equivalent_atoms(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *coords1 = NULL; + npy_intp coords1_Dims[2] = {-1, -1}; + const int coords1_Rank = 2; + PyArrayObject *capi_coords1_as_array = NULL; + int capi_coords1_intent = 0; + PyObject *coords1_capi = Py_None; + double *coords2 = NULL; + npy_intp coords2_Dims[2] = {-1, -1}; + const int coords2_Rank = 2; + PyArrayObject *capi_coords2_as_array = NULL; + int capi_coords2_intent = 0; + PyObject *coords2_capi = Py_None; + double *unit_cell = NULL; + npy_intp unit_cell_Dims[2] = {-1, -1}; + const int unit_cell_Rank = 2; + PyArrayObject *capi_unit_cell_as_array = NULL; + int capi_unit_cell_intent = 0; + PyObject *unit_cell_capi = Py_None; + int *ityp1 = NULL; + npy_intp ityp1_Dims[1] = {-1}; + const int ityp1_Rank = 1; + PyArrayObject *capi_ityp1_as_array = NULL; + int capi_ityp1_intent = 0; + PyObject *ityp1_capi = Py_None; + int *ityp2 = NULL; + npy_intp ityp2_Dims[1] = {-1}; + const int ityp2_Rank = 1; + PyArrayObject *capi_ityp2_as_array = NULL; + int capi_ityp2_intent = 0; + PyObject *ityp2_capi = Py_None; + int *eq_atoms = NULL; + npy_intp eq_atoms_Dims[1] = {-1}; + const int eq_atoms_Rank = 1; + PyArrayObject *capi_eq_atoms_as_array = NULL; + int capi_eq_atoms_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"coords1","coords2","unit_cell","ityp1","ityp2","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.get_equivalent_atoms",\ + capi_kwlist,&coords1_capi,&coords2_capi,&unit_cell_capi,&ityp1_capi,&ityp2_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable coords1 */ + coords1_Dims[1]=3; + capi_coords1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 1st argument `coords1`"; + capi_coords1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords1_Dims,coords1_Rank, capi_coords1_intent,coords1_capi,capi_errmess); + if (capi_coords1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + coords1 = (double *)(PyArray_DATA(capi_coords1_as_array)); + + /* Processing variable unit_cell */ + unit_cell_Dims[0]=3,unit_cell_Dims[1]=3; + capi_unit_cell_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 3rd argument `unit_cell`"; + capi_unit_cell_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_Dims,unit_cell_Rank, capi_unit_cell_intent,unit_cell_capi,capi_errmess); + if (capi_unit_cell_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + unit_cell = (double *)(PyArray_DATA(capi_unit_cell_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(coords1, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_equivalent_atoms() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(coords1, 0) == nat,"shape(coords1, 0) == nat","1st keyword nat","get_equivalent_atoms:nat=%d",nat) { + /* Processing variable coords2 */ + coords2_Dims[0]=nat,coords2_Dims[1]=3; + capi_coords2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 2nd argument `coords2`"; + capi_coords2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords2_Dims,coords2_Rank, capi_coords2_intent,coords2_capi,capi_errmess); + if (capi_coords2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + coords2 = (double *)(PyArray_DATA(capi_coords2_as_array)); + + /* Processing variable ityp1 */ + ityp1_Dims[0]=nat; + capi_ityp1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 4th argument `ityp1`"; + capi_ityp1_as_array = ndarray_from_pyobj( NPY_INT,1,ityp1_Dims,ityp1_Rank, capi_ityp1_intent,ityp1_capi,capi_errmess); + if (capi_ityp1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp1 = (int *)(PyArray_DATA(capi_ityp1_as_array)); + + /* Processing variable ityp2 */ + ityp2_Dims[0]=nat; + capi_ityp2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 5th argument `ityp2`"; + capi_ityp2_as_array = ndarray_from_pyobj( NPY_INT,1,ityp2_Dims,ityp2_Rank, capi_ityp2_intent,ityp2_capi,capi_errmess); + if (capi_ityp2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp2 = (int *)(PyArray_DATA(capi_ityp2_as_array)); + + /* Processing variable eq_atoms */ + eq_atoms_Dims[0]=nat; + capi_eq_atoms_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the hidden `eq_atoms`"; + capi_eq_atoms_as_array = ndarray_from_pyobj( NPY_INT,1,eq_atoms_Dims,eq_atoms_Rank, capi_eq_atoms_intent,Py_None,capi_errmess); + if (capi_eq_atoms_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + eq_atoms = (int *)(PyArray_DATA(capi_eq_atoms_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(coords1,coords2,unit_cell,ityp1,ityp2,eq_atoms,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_eq_atoms_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_eq_atoms_as_array == NULL) ... else of eq_atoms */ + /* End of cleaning variable eq_atoms */ + if((PyObject *)capi_ityp2_as_array!=ityp2_capi) { + Py_XDECREF(capi_ityp2_as_array); } + } /* if (capi_ityp2_as_array == NULL) ... else of ityp2 */ + /* End of cleaning variable ityp2 */ + if((PyObject *)capi_ityp1_as_array!=ityp1_capi) { + Py_XDECREF(capi_ityp1_as_array); } + } /* if (capi_ityp1_as_array == NULL) ... else of ityp1 */ + /* End of cleaning variable ityp1 */ + if((PyObject *)capi_coords2_as_array!=coords2_capi) { + Py_XDECREF(capi_coords2_as_array); } + } /* if (capi_coords2_as_array == NULL) ... else of coords2 */ + /* End of cleaning variable coords2 */ + } /*CHECKSCALAR(shape(coords1, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_unit_cell_as_array!=unit_cell_capi) { + Py_XDECREF(capi_unit_cell_as_array); } + } /* if (capi_unit_cell_as_array == NULL) ... else of unit_cell */ + /* End of cleaning variable unit_cell */ + if((PyObject *)capi_coords1_as_array!=coords1_capi) { + Py_XDECREF(capi_coords1_as_array); } + } /* if (capi_coords1_as_array == NULL) ... else of coords1 */ + /* End of cleaning variable coords1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of get_equivalent_atoms ************************/ + +/***************************** get_closest_vector *****************************/ +static char doc_f2py_rout_symph_get_closest_vector[] = "\ +new_v_dist = get_closest_vector(unit_cell,v_dist)\n\nWrapper for ``get_closest_vector``.\ +\n\nParameters\n----------\n" +"unit_cell : input rank-2 array('d') with bounds (3,3)\n" +"v_dist : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"new_v_dist : rank-1 array('d') with bounds (3)"; +/* extern void F_FUNC_US(get_closest_vector,GET_CLOSEST_VECTOR)(double*,double*,double*); */ +static PyObject *f2py_rout_symph_get_closest_vector(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *unit_cell = NULL; + npy_intp unit_cell_Dims[2] = {-1, -1}; + const int unit_cell_Rank = 2; + PyArrayObject *capi_unit_cell_as_array = NULL; + int capi_unit_cell_intent = 0; + PyObject *unit_cell_capi = Py_None; + double *v_dist = NULL; + npy_intp v_dist_Dims[1] = {-1}; + const int v_dist_Rank = 1; + PyArrayObject *capi_v_dist_as_array = NULL; + int capi_v_dist_intent = 0; + PyObject *v_dist_capi = Py_None; + double *new_v_dist = NULL; + npy_intp new_v_dist_Dims[1] = {-1}; + const int new_v_dist_Rank = 1; + PyArrayObject *capi_new_v_dist_as_array = NULL; + int capi_new_v_dist_intent = 0; + static char *capi_kwlist[] = {"unit_cell","v_dist",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.get_closest_vector",\ + capi_kwlist,&unit_cell_capi,&v_dist_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable unit_cell */ + unit_cell_Dims[0]=3,unit_cell_Dims[1]=3; + capi_unit_cell_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_closest_vector: failed to create array from the 1st argument `unit_cell`"; + capi_unit_cell_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_Dims,unit_cell_Rank, capi_unit_cell_intent,unit_cell_capi,capi_errmess); + if (capi_unit_cell_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + unit_cell = (double *)(PyArray_DATA(capi_unit_cell_as_array)); + + /* Processing variable v_dist */ + v_dist_Dims[0]=3; + capi_v_dist_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_closest_vector: failed to create array from the 2nd argument `v_dist`"; + capi_v_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_dist_Dims,v_dist_Rank, capi_v_dist_intent,v_dist_capi,capi_errmess); + if (capi_v_dist_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_dist = (double *)(PyArray_DATA(capi_v_dist_as_array)); + + /* Processing variable new_v_dist */ + new_v_dist_Dims[0]=3; + capi_new_v_dist_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_closest_vector: failed to create array from the hidden `new_v_dist`"; + capi_new_v_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_v_dist_Dims,new_v_dist_Rank, capi_new_v_dist_intent,Py_None,capi_errmess); + if (capi_new_v_dist_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + new_v_dist = (double *)(PyArray_DATA(capi_new_v_dist_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(unit_cell,v_dist,new_v_dist); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_new_v_dist_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_new_v_dist_as_array == NULL) ... else of new_v_dist */ + /* End of cleaning variable new_v_dist */ + if((PyObject *)capi_v_dist_as_array!=v_dist_capi) { + Py_XDECREF(capi_v_dist_as_array); } + } /* if (capi_v_dist_as_array == NULL) ... else of v_dist */ + /* End of cleaning variable v_dist */ + if((PyObject *)capi_unit_cell_as_array!=unit_cell_capi) { + Py_XDECREF(capi_unit_cell_as_array); } + } /* if (capi_unit_cell_as_array == NULL) ... else of unit_cell */ + /* End of cleaning variable unit_cell */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of get_closest_vector *************************/ + +/******************************** get_gr_data ********************************/ +static char doc_f2py_rout_symph_get_gr_data[] = "\ +r_value,gr = get_gr_data(cells,coords,ityp,type1,type2,r_min,r_max,n_r,[n_structs,nat])\n\nWrapper for ``get_gr_data``.\ +\n\nParameters\n----------\n" +"cells : input rank-3 array('d') with bounds (n_structs,3,3)\n" +"coords : input rank-3 array('d') with bounds (n_structs,nat,3)\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"type1 : input int\n" +"type2 : input int\n" +"r_min : input float\n" +"r_max : input float\n" +"n_r : input int\n" +"\nOther Parameters\n----------------\n" +"n_structs : input int, optional\n Default: shape(cells, 0)\n" +"nat : input int, optional\n Default: shape(coords, 1)\n" +"\nReturns\n-------\n" +"r_value : rank-1 array('d') with bounds (n_r)\n" +"gr : rank-1 array('d') with bounds (n_r)"; +/* extern void F_FUNC_US(get_gr_data,GET_GR_DATA)(double*,double*,int*,int*,int*,double*,double*,int*,double*,double*,int*,int*); */ +static PyObject *f2py_rout_symph_get_gr_data(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,double*,double*,int*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *cells = NULL; + npy_intp cells_Dims[3] = {-1, -1, -1}; + const int cells_Rank = 3; + PyArrayObject *capi_cells_as_array = NULL; + int capi_cells_intent = 0; + PyObject *cells_capi = Py_None; + double *coords = NULL; + npy_intp coords_Dims[3] = {-1, -1, -1}; + const int coords_Rank = 3; + PyArrayObject *capi_coords_as_array = NULL; + int capi_coords_intent = 0; + PyObject *coords_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + int type1 = 0; + PyObject *type1_capi = Py_None; + int type2 = 0; + PyObject *type2_capi = Py_None; + double r_min = 0; + PyObject *r_min_capi = Py_None; + double r_max = 0; + PyObject *r_max_capi = Py_None; + int n_r = 0; + PyObject *n_r_capi = Py_None; + double *r_value = NULL; + npy_intp r_value_Dims[1] = {-1}; + const int r_value_Rank = 1; + PyArrayObject *capi_r_value_as_array = NULL; + int capi_r_value_intent = 0; + double *gr = NULL; + npy_intp gr_Dims[1] = {-1}; + const int gr_Rank = 1; + PyArrayObject *capi_gr_as_array = NULL; + int capi_gr_intent = 0; + int n_structs = 0; + PyObject *n_structs_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"cells","coords","ityp","type1","type2","r_min","r_max","n_r","n_structs","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:symph.get_gr_data",\ + capi_kwlist,&cells_capi,&coords_capi,&ityp_capi,&type1_capi,&type2_capi,&r_min_capi,&r_max_capi,&n_r_capi,&n_structs_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable cells */ + cells_Dims[1]=3,cells_Dims[2]=3; + capi_cells_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the 1st argument `cells`"; + capi_cells_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cells_Dims,cells_Rank, capi_cells_intent,cells_capi,capi_errmess); + if (capi_cells_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + cells = (double *)(PyArray_DATA(capi_cells_as_array)); + + /* Processing variable type1 */ + f2py_success = int_from_pyobj(&type1,type1_capi,"symph.get_gr_data() 4th argument (type1) can't be converted to int"); + if (f2py_success) { + /* Processing variable type2 */ + f2py_success = int_from_pyobj(&type2,type2_capi,"symph.get_gr_data() 5th argument (type2) can't be converted to int"); + if (f2py_success) { + /* Processing variable r_min */ + f2py_success = double_from_pyobj(&r_min,r_min_capi,"symph.get_gr_data() 6th argument (r_min) can't be converted to double"); + if (f2py_success) { + /* Processing variable r_max */ + f2py_success = double_from_pyobj(&r_max,r_max_capi,"symph.get_gr_data() 7th argument (r_max) can't be converted to double"); + if (f2py_success) { + /* Processing variable n_r */ + f2py_success = int_from_pyobj(&n_r,n_r_capi,"symph.get_gr_data() 8th argument (n_r) can't be converted to int"); + if (f2py_success) { + /* Processing variable n_structs */ + if (n_structs_capi == Py_None) n_structs = shape(cells, 0); else + f2py_success = int_from_pyobj(&n_structs,n_structs_capi,"symph.get_gr_data() 1st keyword (n_structs) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(cells, 0) == n_structs,"shape(cells, 0) == n_structs","1st keyword n_structs","get_gr_data:n_structs=%d",n_structs) { + /* Processing variable coords */ + coords_Dims[0]=n_structs,coords_Dims[2]=3; + capi_coords_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the 2nd argument `coords`"; + capi_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords_Dims,coords_Rank, capi_coords_intent,coords_capi,capi_errmess); + if (capi_coords_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + coords = (double *)(PyArray_DATA(capi_coords_as_array)); + + /* Processing variable r_value */ + r_value_Dims[0]=n_r; + capi_r_value_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the hidden `r_value`"; + capi_r_value_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_value_Dims,r_value_Rank, capi_r_value_intent,Py_None,capi_errmess); + if (capi_r_value_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_value = (double *)(PyArray_DATA(capi_r_value_as_array)); + + /* Processing variable gr */ + gr_Dims[0]=n_r; + capi_gr_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the hidden `gr`"; + capi_gr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gr_Dims,gr_Rank, capi_gr_intent,Py_None,capi_errmess); + if (capi_gr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gr = (double *)(PyArray_DATA(capi_gr_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(coords, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_gr_data() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(coords, 1) == nat,"shape(coords, 1) == nat","2nd keyword nat","get_gr_data:nat=%d",nat) { + /* Processing variable ityp */ + ityp_Dims[0]=nat; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the 3rd argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(cells,coords,ityp,&type1,&type2,&r_min,&r_max,&n_r,r_value,gr,&n_structs,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NN",capi_r_value_as_array,capi_gr_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ + } /*CHECKSCALAR(shape(coords, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /* if (capi_gr_as_array == NULL) ... else of gr */ + /* End of cleaning variable gr */ + } /* if (capi_r_value_as_array == NULL) ... else of r_value */ + /* End of cleaning variable r_value */ + if((PyObject *)capi_coords_as_array!=coords_capi) { + Py_XDECREF(capi_coords_as_array); } + } /* if (capi_coords_as_array == NULL) ... else of coords */ + /* End of cleaning variable coords */ + } /*CHECKSCALAR(shape(cells, 0) == n_structs)*/ + } /*if (f2py_success) of n_structs*/ + /* End of cleaning variable n_structs */ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + } /*if (f2py_success) of r_max*/ + /* End of cleaning variable r_max */ + } /*if (f2py_success) of r_min*/ + /* End of cleaning variable r_min */ + } /*if (f2py_success) of type2*/ + /* End of cleaning variable type2 */ + } /*if (f2py_success) of type1*/ + /* End of cleaning variable type1 */ + if((PyObject *)capi_cells_as_array!=cells_capi) { + Py_XDECREF(capi_cells_as_array); } + } /* if (capi_cells_as_array == NULL) ... else of cells */ + /* End of cleaning variable cells */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of get_gr_data *****************************/ + +/************************** fix_coords_in_unit_cell **************************/ +static char doc_f2py_rout_symph_fix_coords_in_unit_cell[] = "\ +new_coords = fix_coords_in_unit_cell(coords,unit_cell,[nat])\n\nWrapper for ``fix_coords_in_unit_cell``.\ +\n\nParameters\n----------\n" +"coords : input rank-2 array('d') with bounds (nat,3)\n" +"unit_cell : input rank-2 array('d') with bounds (3,3)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(coords, 0)\n" +"\nReturns\n-------\n" +"new_coords : rank-2 array('d') with bounds (nat,3)"; +/* extern void F_FUNC_US(fix_coords_in_unit_cell,FIX_COORDS_IN_UNIT_CELL)(double*,double*,double*,int*); */ +static PyObject *f2py_rout_symph_fix_coords_in_unit_cell(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *coords = NULL; + npy_intp coords_Dims[2] = {-1, -1}; + const int coords_Rank = 2; + PyArrayObject *capi_coords_as_array = NULL; + int capi_coords_intent = 0; + PyObject *coords_capi = Py_None; + double *unit_cell = NULL; + npy_intp unit_cell_Dims[2] = {-1, -1}; + const int unit_cell_Rank = 2; + PyArrayObject *capi_unit_cell_as_array = NULL; + int capi_unit_cell_intent = 0; + PyObject *unit_cell_capi = Py_None; + double *new_coords = NULL; + npy_intp new_coords_Dims[2] = {-1, -1}; + const int new_coords_Rank = 2; + PyArrayObject *capi_new_coords_as_array = NULL; + int capi_new_coords_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"coords","unit_cell","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:symph.fix_coords_in_unit_cell",\ + capi_kwlist,&coords_capi,&unit_cell_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable coords */ + coords_Dims[1]=3; + capi_coords_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fix_coords_in_unit_cell: failed to create array from the 1st argument `coords`"; + capi_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords_Dims,coords_Rank, capi_coords_intent,coords_capi,capi_errmess); + if (capi_coords_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + coords = (double *)(PyArray_DATA(capi_coords_as_array)); + + /* Processing variable unit_cell */ + unit_cell_Dims[0]=3,unit_cell_Dims[1]=3; + capi_unit_cell_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.fix_coords_in_unit_cell: failed to create array from the 2nd argument `unit_cell`"; + capi_unit_cell_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_Dims,unit_cell_Rank, capi_unit_cell_intent,unit_cell_capi,capi_errmess); + if (capi_unit_cell_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + unit_cell = (double *)(PyArray_DATA(capi_unit_cell_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(coords, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.fix_coords_in_unit_cell() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(coords, 0) == nat,"shape(coords, 0) == nat","1st keyword nat","fix_coords_in_unit_cell:nat=%d",nat) { + /* Processing variable new_coords */ + new_coords_Dims[0]=nat,new_coords_Dims[1]=3; + capi_new_coords_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.fix_coords_in_unit_cell: failed to create array from the hidden `new_coords`"; + capi_new_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_coords_Dims,new_coords_Rank, capi_new_coords_intent,Py_None,capi_errmess); + if (capi_new_coords_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + new_coords = (double *)(PyArray_DATA(capi_new_coords_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(coords,unit_cell,new_coords,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_new_coords_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_new_coords_as_array == NULL) ... else of new_coords */ + /* End of cleaning variable new_coords */ + } /*CHECKSCALAR(shape(coords, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_unit_cell_as_array!=unit_cell_capi) { + Py_XDECREF(capi_unit_cell_as_array); } + } /* if (capi_unit_cell_as_array == NULL) ... else of unit_cell */ + /* End of cleaning variable unit_cell */ + if((PyObject *)capi_coords_as_array!=coords_capi) { + Py_XDECREF(capi_coords_as_array); } + } /* if (capi_coords_as_array == NULL) ... else of coords */ + /* End of cleaning variable coords */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of fix_coords_in_unit_cell ***********************/ + +/********************************** matinv3 **********************************/ +static char doc_f2py_rout_symph_matinv3[] = "\ +b = matinv3(a)\n\nWrapper for ``matinv3``.\ +\n\nParameters\n----------\n" +"a : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"b : rank-2 array('d') with bounds (3,3)"; +/* extern void F_FUNC(matinv3,MATINV3)(double*,double*); */ +static PyObject *f2py_rout_symph_matinv3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + double *b = NULL; + npy_intp b_Dims[2] = {-1, -1}; + const int b_Rank = 2; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + static char *capi_kwlist[] = {"a",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:symph.matinv3",\ + capi_kwlist,&a_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3,a_Dims[1]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.matinv3: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3,b_Dims[1]=3; + capi_b_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.matinv3: failed to create array from the hidden `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b_Dims,b_Rank, capi_b_intent,Py_None,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (double *)(PyArray_DATA(capi_b_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(a,b); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_b_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of matinv3 *******************************/ + +/*********************************** invmat ***********************************/ +static char doc_f2py_rout_symph_invmat[] = "\ +a_inv = invmat(a,[n])\n\nWrapper for ``invmat``.\ +\n\nParameters\n----------\n" +"a : input rank-2 array('d') with bounds (n,n)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(a, 0)\n" +"\nReturns\n-------\n" +"a_inv : rank-2 array('d') with bounds (n,n)"; +/* extern void F_FUNC(invmat,INVMAT)(int*,double*,double*); */ +static PyObject *f2py_rout_symph_invmat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int n = 0; + PyObject *n_capi = Py_None; + double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + double *a_inv = NULL; + npy_intp a_inv_Dims[2] = {-1, -1}; + const int a_inv_Rank = 2; + PyArrayObject *capi_a_inv_as_array = NULL; + int capi_a_inv_intent = 0; + static char *capi_kwlist[] = {"a","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:symph.invmat",\ + capi_kwlist,&a_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.invmat: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(a, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"symph.invmat() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(a, 0) == n,"shape(a, 0) == n","1st keyword n","invmat:n=%d",n) { + /* Processing variable a_inv */ + a_inv_Dims[0]=n,a_inv_Dims[1]=n; + capi_a_inv_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.invmat: failed to create array from the hidden `a_inv`"; + capi_a_inv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_inv_Dims,a_inv_Rank, capi_a_inv_intent,Py_None,capi_errmess); + if (capi_a_inv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a_inv = (double *)(PyArray_DATA(capi_a_inv_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&n,a,a_inv); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_a_inv_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_a_inv_as_array == NULL) ... else of a_inv */ + /* End of cleaning variable a_inv */ + } /*CHECKSCALAR(shape(a, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of invmat *******************************/ + +/*********************************** recips ***********************************/ +static char doc_f2py_rout_symph_recips[] = "\ +b1,b2,b3 = recips(a1,a2,a3)\n\nWrapper for ``recips``.\ +\n\nParameters\n----------\n" +"a1 : input rank-1 array('d') with bounds (3)\n" +"a2 : input rank-1 array('d') with bounds (3)\n" +"a3 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"b1 : rank-1 array('d') with bounds (3)\n" +"b2 : rank-1 array('d') with bounds (3)\n" +"b3 : rank-1 array('d') with bounds (3)"; +/* extern void F_FUNC(recips,RECIPS)(double*,double*,double*,double*,double*,double*); */ +static PyObject *f2py_rout_symph_recips(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *a1 = NULL; + npy_intp a1_Dims[1] = {-1}; + const int a1_Rank = 1; + PyArrayObject *capi_a1_as_array = NULL; + int capi_a1_intent = 0; + PyObject *a1_capi = Py_None; + double *a2 = NULL; + npy_intp a2_Dims[1] = {-1}; + const int a2_Rank = 1; + PyArrayObject *capi_a2_as_array = NULL; + int capi_a2_intent = 0; + PyObject *a2_capi = Py_None; + double *a3 = NULL; + npy_intp a3_Dims[1] = {-1}; + const int a3_Rank = 1; + PyArrayObject *capi_a3_as_array = NULL; + int capi_a3_intent = 0; + PyObject *a3_capi = Py_None; + double *b1 = NULL; + npy_intp b1_Dims[1] = {-1}; + const int b1_Rank = 1; + PyArrayObject *capi_b1_as_array = NULL; + int capi_b1_intent = 0; + double *b2 = NULL; + npy_intp b2_Dims[1] = {-1}; + const int b2_Rank = 1; + PyArrayObject *capi_b2_as_array = NULL; + int capi_b2_intent = 0; + double *b3 = NULL; + npy_intp b3_Dims[1] = {-1}; + const int b3_Rank = 1; + PyArrayObject *capi_b3_as_array = NULL; + int capi_b3_intent = 0; + static char *capi_kwlist[] = {"a1","a2","a3",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:symph.recips",\ + capi_kwlist,&a1_capi,&a2_capi,&a3_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a1 */ + a1_Dims[0]=3; + capi_a1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.recips: failed to create array from the 1st argument `a1`"; + capi_a1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a1_Dims,a1_Rank, capi_a1_intent,a1_capi,capi_errmess); + if (capi_a1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a1 = (double *)(PyArray_DATA(capi_a1_as_array)); + + /* Processing variable a2 */ + a2_Dims[0]=3; + capi_a2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.recips: failed to create array from the 2nd argument `a2`"; + capi_a2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a2_Dims,a2_Rank, capi_a2_intent,a2_capi,capi_errmess); + if (capi_a2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a2 = (double *)(PyArray_DATA(capi_a2_as_array)); + + /* Processing variable a3 */ + a3_Dims[0]=3; + capi_a3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.recips: failed to create array from the 3rd argument `a3`"; + capi_a3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a3_Dims,a3_Rank, capi_a3_intent,a3_capi,capi_errmess); + if (capi_a3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a3 = (double *)(PyArray_DATA(capi_a3_as_array)); + + /* Processing variable b1 */ + b1_Dims[0]=3; + capi_b1_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.recips: failed to create array from the hidden `b1`"; + capi_b1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b1_Dims,b1_Rank, capi_b1_intent,Py_None,capi_errmess); + if (capi_b1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b1 = (double *)(PyArray_DATA(capi_b1_as_array)); + + /* Processing variable b2 */ + b2_Dims[0]=3; + capi_b2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.recips: failed to create array from the hidden `b2`"; + capi_b2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b2_Dims,b2_Rank, capi_b2_intent,Py_None,capi_errmess); + if (capi_b2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b2 = (double *)(PyArray_DATA(capi_b2_as_array)); + + /* Processing variable b3 */ + b3_Dims[0]=3; + capi_b3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.recips: failed to create array from the hidden `b3`"; + capi_b3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b3_Dims,b3_Rank, capi_b3_intent,Py_None,capi_errmess); + if (capi_b3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b3 = (double *)(PyArray_DATA(capi_b3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(a1,a2,a3,b1,b2,b3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNN",capi_b1_as_array,capi_b2_as_array,capi_b3_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_b3_as_array == NULL) ... else of b3 */ + /* End of cleaning variable b3 */ + } /* if (capi_b2_as_array == NULL) ... else of b2 */ + /* End of cleaning variable b2 */ + } /* if (capi_b1_as_array == NULL) ... else of b1 */ + /* End of cleaning variable b1 */ + if((PyObject *)capi_a3_as_array!=a3_capi) { + Py_XDECREF(capi_a3_as_array); } + } /* if (capi_a3_as_array == NULL) ... else of a3 */ + /* End of cleaning variable a3 */ + if((PyObject *)capi_a2_as_array!=a2_capi) { + Py_XDECREF(capi_a2_as_array); } + } /* if (capi_a2_as_array == NULL) ... else of a2 */ + /* End of cleaning variable a2 */ + if((PyObject *)capi_a1_as_array!=a1_capi) { + Py_XDECREF(capi_a1_as_array); } + } /* if (capi_a1_as_array == NULL) ... else of a1 */ + /* End of cleaning variable a1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of recips *******************************/ + +/******************************** sgam_ph_new ********************************/ +static char doc_f2py_rout_symph_sgam_ph_new[] = "\ +rtau = sgam_ph_new(at,bg,nsym,s,irt,tau,[nat])\n\nWrapper for ``sgam_ph_new``.\ +\n\nParameters\n----------\n" +"at : input rank-2 array('d') with bounds (3,3)\n" +"bg : input rank-2 array('d') with bounds (3,3)\n" +"nsym : input int\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"irt : input rank-2 array('i') with bounds (48,nat)\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(irt, 1)\n" +"\nReturns\n-------\n" +"rtau : rank-3 array('d') with bounds (3,48,nat)"; +/* extern void F_FUNC_US(sgam_ph_new,SGAM_PH_NEW)(double*,double*,int*,int*,int*,double*,double*,int*); */ +static PyObject *f2py_rout_symph_sgam_ph_new(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *at = NULL; + npy_intp at_Dims[2] = {-1, -1}; + const int at_Rank = 2; + PyArrayObject *capi_at_as_array = NULL; + int capi_at_intent = 0; + PyObject *at_capi = Py_None; + double *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *rtau = NULL; + npy_intp rtau_Dims[3] = {-1, -1, -1}; + const int rtau_Rank = 3; + PyArrayObject *capi_rtau_as_array = NULL; + int capi_rtau_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"at","bg","nsym","s","irt","tau","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|O:symph.sgam_ph_new",\ + capi_kwlist,&at_capi,&bg_capi,&nsym_capi,&s_capi,&irt_capi,&tau_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sgam_ph_new() 3rd argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 4th argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable irt */ + irt_Dims[0]=48; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 5th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + + /* Processing variable at */ + at_Dims[0]=3,at_Dims[1]=3; + capi_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 1st argument `at`"; + capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); + if (capi_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at = (double *)(PyArray_DATA(capi_at_as_array)); + + /* Processing variable bg */ + bg_Dims[0]=3,bg_Dims[1]=3; + capi_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 2nd argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (double *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(irt, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sgam_ph_new() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irt, 1) == nat,"shape(irt, 1) == nat","1st keyword nat","sgam_ph_new:nat=%d",nat) { + /* Processing variable tau */ + tau_Dims[0]=3,tau_Dims[1]=nat; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 6th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable rtau */ + rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; + capi_rtau_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the hidden `rtau`"; + capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,Py_None,capi_errmess); + if (capi_rtau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(at,bg,&nsym,s,irt,tau,rtau,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_rtau_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_rtau_as_array == NULL) ... else of rtau */ + /* End of cleaning variable rtau */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*CHECKSCALAR(shape(irt, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + if((PyObject *)capi_at_as_array!=at_capi) { + Py_XDECREF(capi_at_as_array); } + } /* if (capi_at_as_array == NULL) ... else of at */ + /* End of cleaning variable at */ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of sgam_ph_new *****************************/ + +/***************************** get_tau_sc_latvec *****************************/ +static char doc_f2py_rout_symph_get_tau_sc_latvec[] = "\ +tau_sc_latvec = get_tau_sc_latvec(tau_sc,latvec,at_sc,[nat_sc,nr])\n\nWrapper for ``get_tau_sc_latvec``.\ +\n\nParameters\n----------\n" +"tau_sc : input rank-2 array('d') with bounds (3,nat_sc)\n" +"latvec : input rank-2 array('d') with bounds (nr,3)\n" +"at_sc : input rank-2 array('d') with bounds (3,3)\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(tau_sc, 1)\n" +"nr : input int, optional\n Default: shape(latvec, 0)\n" +"\nReturns\n-------\n" +"tau_sc_latvec : rank-2 array('i') with bounds (nat_sc,nr)"; +/* extern void F_FUNC_US(get_tau_sc_latvec,GET_TAU_SC_LATVEC)(double*,double*,double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_get_tau_sc_latvec(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tau_sc = NULL; + npy_intp tau_sc_Dims[2] = {-1, -1}; + const int tau_sc_Rank = 2; + PyArrayObject *capi_tau_sc_as_array = NULL; + int capi_tau_sc_intent = 0; + PyObject *tau_sc_capi = Py_None; + double *latvec = NULL; + npy_intp latvec_Dims[2] = {-1, -1}; + const int latvec_Rank = 2; + PyArrayObject *capi_latvec_as_array = NULL; + int capi_latvec_intent = 0; + PyObject *latvec_capi = Py_None; + double *at_sc = NULL; + npy_intp at_sc_Dims[2] = {-1, -1}; + const int at_sc_Rank = 2; + PyArrayObject *capi_at_sc_as_array = NULL; + int capi_at_sc_intent = 0; + PyObject *at_sc_capi = Py_None; + int *tau_sc_latvec = NULL; + npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; + const int tau_sc_latvec_Rank = 2; + PyArrayObject *capi_tau_sc_latvec_as_array = NULL; + int capi_tau_sc_latvec_intent = 0; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + int nr = 0; + PyObject *nr_capi = Py_None; + static char *capi_kwlist[] = {"tau_sc","latvec","at_sc","nat_sc","nr",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:symph.get_tau_sc_latvec",\ + capi_kwlist,&tau_sc_capi,&latvec_capi,&at_sc_capi,&nat_sc_capi,&nr_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable tau_sc */ + tau_sc_Dims[0]=3; + capi_tau_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the 1st argument `tau_sc`"; + capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); + if (capi_tau_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); + + /* Processing variable latvec */ + latvec_Dims[1]=3; + capi_latvec_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the 2nd argument `latvec`"; + capi_latvec_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,latvec_Dims,latvec_Rank, capi_latvec_intent,latvec_capi,capi_errmess); + if (capi_latvec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + latvec = (double *)(PyArray_DATA(capi_latvec_as_array)); + + /* Processing variable at_sc */ + at_sc_Dims[0]=3,at_sc_Dims[1]=3; + capi_at_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the 3rd argument `at_sc`"; + capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); + if (capi_at_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); + + /* Processing variable nr */ + if (nr_capi == Py_None) nr = shape(latvec, 0); else + f2py_success = int_from_pyobj(&nr,nr_capi,"symph.get_tau_sc_latvec() 2nd keyword (nr) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(latvec, 0) == nr,"shape(latvec, 0) == nr","2nd keyword nr","get_tau_sc_latvec:nr=%d",nr) { + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(tau_sc, 1); else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.get_tau_sc_latvec() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau_sc, 1) == nat_sc,"shape(tau_sc, 1) == nat_sc","1st keyword nat_sc","get_tau_sc_latvec:nat_sc=%d",nat_sc) { + /* Processing variable tau_sc_latvec */ + tau_sc_latvec_Dims[0]=nat_sc,tau_sc_latvec_Dims[1]=nr; + capi_tau_sc_latvec_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the hidden `tau_sc_latvec`"; + capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,Py_None,capi_errmess); + if (capi_tau_sc_latvec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tau_sc,latvec,at_sc,tau_sc_latvec,&nat_sc,&nr); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_tau_sc_latvec_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ + /* End of cleaning variable tau_sc_latvec */ + } /*CHECKSCALAR(shape(tau_sc, 1) == nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + } /*CHECKSCALAR(shape(latvec, 0) == nr)*/ + } /*if (f2py_success) of nr*/ + /* End of cleaning variable nr */ + if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { + Py_XDECREF(capi_at_sc_as_array); } + } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ + /* End of cleaning variable at_sc */ + if((PyObject *)capi_latvec_as_array!=latvec_capi) { + Py_XDECREF(capi_latvec_as_array); } + } /* if (capi_latvec_as_array == NULL) ... else of latvec */ + /* End of cleaning variable latvec */ + if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { + Py_XDECREF(capi_tau_sc_as_array); } + } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ + /* End of cleaning variable tau_sc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of get_tau_sc_latvec **************************/ + +/********************************* permute_v3 *********************************/ +static char doc_f2py_rout_symph_permute_v3[] = "\ +permute_v3(v3,[n])\n\nWrapper for ``permute_v3``.\ +\n\nParameters\n----------\n" +"v3 : in/output rank-3 array('d') with bounds (n,n,n)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(v3, 0)"; +/* extern void F_FUNC_US(permute_v3,PERMUTE_V3)(double*,int*); */ +static PyObject *f2py_rout_symph_permute_v3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v3 = NULL; + npy_intp v3_Dims[3] = {-1, -1, -1}; + const int v3_Rank = 3; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + int n = 0; + PyObject *n_capi = Py_None; + static char *capi_kwlist[] = {"v3","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:symph.permute_v3",\ + capi_kwlist,&v3_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v3 */ + ; + capi_v3_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.permute_v3: failed to create array from the 1st argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(v3, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"symph.permute_v3() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v3, 0) == n,"shape(v3, 0) == n","1st keyword n","permute_v3:n=%d",n) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v3,&n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(v3, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of permute_v3 *****************************/ + +/********************************* permute_v4 *********************************/ +static char doc_f2py_rout_symph_permute_v4[] = "\ +permute_v4(v4,[n])\n\nWrapper for ``permute_v4``.\ +\n\nParameters\n----------\n" +"v4 : in/output rank-4 array('d') with bounds (n,n,n,n)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(v4, 0)"; +/* extern void F_FUNC_US(permute_v4,PERMUTE_V4)(double*,int*); */ +static PyObject *f2py_rout_symph_permute_v4(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v4 = NULL; + npy_intp v4_Dims[4] = {-1, -1, -1, -1}; + const int v4_Rank = 4; + PyArrayObject *capi_v4_as_array = NULL; + int capi_v4_intent = 0; + PyObject *v4_capi = Py_None; + int n = 0; + PyObject *n_capi = Py_None; + static char *capi_kwlist[] = {"v4","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:symph.permute_v4",\ + capi_kwlist,&v4_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v4 */ + ; + capi_v4_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.permute_v4: failed to create array from the 1st argument `v4`"; + capi_v4_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v4_Dims,v4_Rank, capi_v4_intent,v4_capi,capi_errmess); + if (capi_v4_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v4 = (double *)(PyArray_DATA(capi_v4_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(v4, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"symph.permute_v4() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v4, 0) == n,"shape(v4, 0) == n","1st keyword n","permute_v4:n=%d",n) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v4,&n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(v4, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_v4_as_array!=v4_capi) { + Py_XDECREF(capi_v4_as_array); } + } /* if (capi_v4_as_array == NULL) ... else of v4 */ + /* End of cleaning variable v4 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of permute_v4 *****************************/ + +/********************************** trans_v2 **********************************/ +static char doc_f2py_rout_symph_trans_v2[] = "\ +trans_v2(v2,tau_sc_latvec,[nat_sc,nr])\n\nWrapper for ``trans_v2``.\ +\n\nParameters\n----------\n" +"v2 : in/output rank-4 array('d') with bounds (3,3,nat_sc,nat_sc)\n" +"tau_sc_latvec : input rank-2 array('i') with bounds (nat_sc,nr)\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(v2, 2)\n" +"nr : input int, optional\n Default: shape(tau_sc_latvec, 1)"; +/* extern void F_FUNC_US(trans_v2,TRANS_V2)(double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_trans_v2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v2 = NULL; + npy_intp v2_Dims[4] = {-1, -1, -1, -1}; + const int v2_Rank = 4; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + int *tau_sc_latvec = NULL; + npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; + const int tau_sc_latvec_Rank = 2; + PyArrayObject *capi_tau_sc_latvec_as_array = NULL; + int capi_tau_sc_latvec_intent = 0; + PyObject *tau_sc_latvec_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + int nr = 0; + PyObject *nr_capi = Py_None; + static char *capi_kwlist[] = {"v2","tau_sc_latvec","nat_sc","nr",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|OO:symph.trans_v2",\ + capi_kwlist,&v2_capi,&tau_sc_latvec_capi,&nat_sc_capi,&nr_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v2 */ + v2_Dims[0]=3,v2_Dims[1]=3; + capi_v2_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.trans_v2: failed to create array from the 1st argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(v2, 2); else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.trans_v2() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v2, 2) == nat_sc,"shape(v2, 2) == nat_sc","1st keyword nat_sc","trans_v2:nat_sc=%d",nat_sc) { + /* Processing variable tau_sc_latvec */ + tau_sc_latvec_Dims[0]=nat_sc; + capi_tau_sc_latvec_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trans_v2: failed to create array from the 2nd argument `tau_sc_latvec`"; + capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,tau_sc_latvec_capi,capi_errmess); + if (capi_tau_sc_latvec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); + + /* Processing variable nr */ + if (nr_capi == Py_None) nr = shape(tau_sc_latvec, 1); else + f2py_success = int_from_pyobj(&nr,nr_capi,"symph.trans_v2() 2nd keyword (nr) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau_sc_latvec, 1) == nr,"shape(tau_sc_latvec, 1) == nr","2nd keyword nr","trans_v2:nr=%d",nr) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v2,tau_sc_latvec,&nat_sc,&nr); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(tau_sc_latvec, 1) == nr)*/ + } /*if (f2py_success) of nr*/ + /* End of cleaning variable nr */ + if((PyObject *)capi_tau_sc_latvec_as_array!=tau_sc_latvec_capi) { + Py_XDECREF(capi_tau_sc_latvec_as_array); } + } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ + /* End of cleaning variable tau_sc_latvec */ + } /*CHECKSCALAR(shape(v2, 2) == nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of trans_v2 ******************************/ + +/********************************** trans_v3 **********************************/ +static char doc_f2py_rout_symph_trans_v3[] = "\ +trans_v3(v3,tau_sc_latvec,[nat_sc,nr])\n\nWrapper for ``trans_v3``.\ +\n\nParameters\n----------\n" +"v3 : in/output rank-3 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" +"tau_sc_latvec : input rank-2 array('i') with bounds (nat_sc,nr)\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(v3, 0) / 3\n" +"nr : input int, optional\n Default: shape(tau_sc_latvec, 1)"; +/* extern void F_FUNC_US(trans_v3,TRANS_V3)(double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_trans_v3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v3 = NULL; + npy_intp v3_Dims[3] = {-1, -1, -1}; + const int v3_Rank = 3; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + int *tau_sc_latvec = NULL; + npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; + const int tau_sc_latvec_Rank = 2; + PyArrayObject *capi_tau_sc_latvec_as_array = NULL; + int capi_tau_sc_latvec_intent = 0; + PyObject *tau_sc_latvec_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + int nr = 0; + PyObject *nr_capi = Py_None; + static char *capi_kwlist[] = {"v3","tau_sc_latvec","nat_sc","nr",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|OO:symph.trans_v3",\ + capi_kwlist,&v3_capi,&tau_sc_latvec_capi,&nat_sc_capi,&nr_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v3 */ + ; + capi_v3_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.trans_v3: failed to create array from the 1st argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(v3, 0) / 3; else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.trans_v3() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v3, 0) == 3 * nat_sc,"shape(v3, 0) == 3 * nat_sc","1st keyword nat_sc","trans_v3:nat_sc=%d",nat_sc) { + /* Processing variable tau_sc_latvec */ + tau_sc_latvec_Dims[0]=nat_sc; + capi_tau_sc_latvec_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trans_v3: failed to create array from the 2nd argument `tau_sc_latvec`"; + capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,tau_sc_latvec_capi,capi_errmess); + if (capi_tau_sc_latvec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); + + /* Processing variable nr */ + if (nr_capi == Py_None) nr = shape(tau_sc_latvec, 1); else + f2py_success = int_from_pyobj(&nr,nr_capi,"symph.trans_v3() 2nd keyword (nr) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau_sc_latvec, 1) == nr,"shape(tau_sc_latvec, 1) == nr","2nd keyword nr","trans_v3:nr=%d",nr) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v3,tau_sc_latvec,&nat_sc,&nr); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(tau_sc_latvec, 1) == nr)*/ + } /*if (f2py_success) of nr*/ + /* End of cleaning variable nr */ + if((PyObject *)capi_tau_sc_latvec_as_array!=tau_sc_latvec_capi) { + Py_XDECREF(capi_tau_sc_latvec_as_array); } + } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ + /* End of cleaning variable tau_sc_latvec */ + } /*CHECKSCALAR(shape(v3, 0) == 3 * nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of trans_v3 ******************************/ + +/********************************** trans_v4 **********************************/ +static char doc_f2py_rout_symph_trans_v4[] = "\ +trans_v4(v4,tau_sc_latvec,[nat_sc,nr])\n\nWrapper for ``trans_v4``.\ +\n\nParameters\n----------\n" +"v4 : in/output rank-4 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" +"tau_sc_latvec : input rank-2 array('i') with bounds (nat_sc,nr)\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(v4, 0) / 3\n" +"nr : input int, optional\n Default: shape(tau_sc_latvec, 1)"; +/* extern void F_FUNC_US(trans_v4,TRANS_V4)(double*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_trans_v4(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v4 = NULL; + npy_intp v4_Dims[4] = {-1, -1, -1, -1}; + const int v4_Rank = 4; + PyArrayObject *capi_v4_as_array = NULL; + int capi_v4_intent = 0; + PyObject *v4_capi = Py_None; + int *tau_sc_latvec = NULL; + npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; + const int tau_sc_latvec_Rank = 2; + PyArrayObject *capi_tau_sc_latvec_as_array = NULL; + int capi_tau_sc_latvec_intent = 0; + PyObject *tau_sc_latvec_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + int nr = 0; + PyObject *nr_capi = Py_None; + static char *capi_kwlist[] = {"v4","tau_sc_latvec","nat_sc","nr",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|OO:symph.trans_v4",\ + capi_kwlist,&v4_capi,&tau_sc_latvec_capi,&nat_sc_capi,&nr_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v4 */ + ; + capi_v4_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.trans_v4: failed to create array from the 1st argument `v4`"; + capi_v4_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v4_Dims,v4_Rank, capi_v4_intent,v4_capi,capi_errmess); + if (capi_v4_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v4 = (double *)(PyArray_DATA(capi_v4_as_array)); + + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(v4, 0) / 3; else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.trans_v4() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v4, 0) == 3 * nat_sc,"shape(v4, 0) == 3 * nat_sc","1st keyword nat_sc","trans_v4:nat_sc=%d",nat_sc) { + /* Processing variable tau_sc_latvec */ + tau_sc_latvec_Dims[0]=nat_sc; + capi_tau_sc_latvec_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.trans_v4: failed to create array from the 2nd argument `tau_sc_latvec`"; + capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,tau_sc_latvec_capi,capi_errmess); + if (capi_tau_sc_latvec_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); + + /* Processing variable nr */ + if (nr_capi == Py_None) nr = shape(tau_sc_latvec, 1); else + f2py_success = int_from_pyobj(&nr,nr_capi,"symph.trans_v4() 2nd keyword (nr) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau_sc_latvec, 1) == nr,"shape(tau_sc_latvec, 1) == nr","2nd keyword nr","trans_v4:nr=%d",nr) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v4,tau_sc_latvec,&nat_sc,&nr); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(tau_sc_latvec, 1) == nr)*/ + } /*if (f2py_success) of nr*/ + /* End of cleaning variable nr */ + if((PyObject *)capi_tau_sc_latvec_as_array!=tau_sc_latvec_capi) { + Py_XDECREF(capi_tau_sc_latvec_as_array); } + } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ + /* End of cleaning variable tau_sc_latvec */ + } /*CHECKSCALAR(shape(v4, 0) == 3 * nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + if((PyObject *)capi_v4_as_array!=v4_capi) { + Py_XDECREF(capi_v4_as_array); } + } /* if (capi_v4_as_array == NULL) ... else of v4 */ + /* End of cleaning variable v4 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of trans_v4 ******************************/ + +/*********************************** sym_v2 ***********************************/ +static char doc_f2py_rout_symph_sym_v2[] = "\ +sym_v2(v2,at_sc,bg_sc,s,irt,nsym,[nat_sc])\n\nWrapper for ``sym_v2``.\ +\n\nParameters\n----------\n" +"v2 : in/output rank-4 array('d') with bounds (3,3,nat_sc,nat_sc)\n" +"at_sc : input rank-2 array('d') with bounds (3,3)\n" +"bg_sc : input rank-2 array('d') with bounds (3,3)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"irt : input rank-2 array('i') with bounds (48,nat_sc)\n" +"nsym : input int\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(v2, 2)"; +/* extern void F_FUNC_US(sym_v2,SYM_V2)(double*,double*,double*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_sym_v2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v2 = NULL; + npy_intp v2_Dims[4] = {-1, -1, -1, -1}; + const int v2_Rank = 4; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + double *at_sc = NULL; + npy_intp at_sc_Dims[2] = {-1, -1}; + const int at_sc_Rank = 2; + PyArrayObject *capi_at_sc_as_array = NULL; + int capi_at_sc_intent = 0; + PyObject *at_sc_capi = Py_None; + double *bg_sc = NULL; + npy_intp bg_sc_Dims[2] = {-1, -1}; + const int bg_sc_Rank = 2; + PyArrayObject *capi_bg_sc_as_array = NULL; + int capi_bg_sc_intent = 0; + PyObject *bg_sc_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + static char *capi_kwlist[] = {"v2","at_sc","bg_sc","s","irt","nsym","nat_sc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|O:symph.sym_v2",\ + capi_kwlist,&v2_capi,&at_sc_capi,&bg_sc_capi,&s_capi,&irt_capi,&nsym_capi,&nat_sc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v2 */ + v2_Dims[0]=3,v2_Dims[1]=3; + capi_v2_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 1st argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable at_sc */ + at_sc_Dims[0]=3,at_sc_Dims[1]=3; + capi_at_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 2nd argument `at_sc`"; + capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); + if (capi_at_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); + + /* Processing variable bg_sc */ + bg_sc_Dims[0]=3,bg_sc_Dims[1]=3; + capi_bg_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 3rd argument `bg_sc`"; + capi_bg_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_sc_Dims,bg_sc_Rank, capi_bg_sc_intent,bg_sc_capi,capi_errmess); + if (capi_bg_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg_sc = (double *)(PyArray_DATA(capi_bg_sc_as_array)); + + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 4th argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sym_v2() 6th argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(v2, 2); else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.sym_v2() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v2, 2) == nat_sc,"shape(v2, 2) == nat_sc","1st keyword nat_sc","sym_v2:nat_sc=%d",nat_sc) { + /* Processing variable irt */ + irt_Dims[0]=48,irt_Dims[1]=nat_sc; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 5th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v2,at_sc,bg_sc,s,irt,&nsym,&nat_sc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*CHECKSCALAR(shape(v2, 2) == nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + if((PyObject *)capi_bg_sc_as_array!=bg_sc_capi) { + Py_XDECREF(capi_bg_sc_as_array); } + } /* if (capi_bg_sc_as_array == NULL) ... else of bg_sc */ + /* End of cleaning variable bg_sc */ + if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { + Py_XDECREF(capi_at_sc_as_array); } + } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ + /* End of cleaning variable at_sc */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of sym_v2 *******************************/ + +/*********************************** sym_v3 ***********************************/ +static char doc_f2py_rout_symph_sym_v3[] = "\ +sym_v3(v3,at_sc,s,irt,nsym,[nat_sc])\n\nWrapper for ``sym_v3``.\ +\n\nParameters\n----------\n" +"v3 : in/output rank-3 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" +"at_sc : input rank-2 array('d') with bounds (3,3)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"irt : input rank-2 array('i') with bounds (48,nat_sc)\n" +"nsym : input int\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(v3, 0) / 3"; +/* extern void F_FUNC_US(sym_v3,SYM_V3)(double*,double*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_sym_v3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v3 = NULL; + npy_intp v3_Dims[3] = {-1, -1, -1}; + const int v3_Rank = 3; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + double *at_sc = NULL; + npy_intp at_sc_Dims[2] = {-1, -1}; + const int at_sc_Rank = 2; + PyArrayObject *capi_at_sc_as_array = NULL; + int capi_at_sc_intent = 0; + PyObject *at_sc_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + static char *capi_kwlist[] = {"v3","at_sc","s","irt","nsym","nat_sc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.sym_v3",\ + capi_kwlist,&v3_capi,&at_sc_capi,&s_capi,&irt_capi,&nsym_capi,&nat_sc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v3 */ + ; + capi_v3_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 1st argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable at_sc */ + at_sc_Dims[0]=3,at_sc_Dims[1]=3; + capi_at_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 2nd argument `at_sc`"; + capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); + if (capi_at_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); + + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 3rd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sym_v3() 5th argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(v3, 0) / 3; else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.sym_v3() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v3, 0) == 3 * nat_sc,"shape(v3, 0) == 3 * nat_sc","1st keyword nat_sc","sym_v3:nat_sc=%d",nat_sc) { + /* Processing variable irt */ + irt_Dims[0]=48,irt_Dims[1]=nat_sc; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 4th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v3,at_sc,s,irt,&nsym,&nat_sc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*CHECKSCALAR(shape(v3, 0) == 3 * nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { + Py_XDECREF(capi_at_sc_as_array); } + } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ + /* End of cleaning variable at_sc */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of sym_v3 *******************************/ + +/*********************************** sym_v4 ***********************************/ +static char doc_f2py_rout_symph_sym_v4[] = "\ +sym_v4(v4,at_sc,s,irt,nsym,[nat_sc])\n\nWrapper for ``sym_v4``.\ +\n\nParameters\n----------\n" +"v4 : in/output rank-4 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" +"at_sc : input rank-2 array('d') with bounds (3,3)\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"irt : input rank-2 array('i') with bounds (48,nat_sc)\n" +"nsym : input int\n" +"\nOther Parameters\n----------------\n" +"nat_sc : input int, optional\n Default: shape(v4, 0) / 3"; +/* extern void F_FUNC_US(sym_v4,SYM_V4)(double*,double*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_sym_v4(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *v4 = NULL; + npy_intp v4_Dims[4] = {-1, -1, -1, -1}; + const int v4_Rank = 4; + PyArrayObject *capi_v4_as_array = NULL; + int capi_v4_intent = 0; + PyObject *v4_capi = Py_None; + double *at_sc = NULL; + npy_intp at_sc_Dims[2] = {-1, -1}; + const int at_sc_Rank = 2; + PyArrayObject *capi_at_sc_as_array = NULL; + int capi_at_sc_intent = 0; + PyObject *at_sc_capi = Py_None; + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int nat_sc = 0; + PyObject *nat_sc_capi = Py_None; + static char *capi_kwlist[] = {"v4","at_sc","s","irt","nsym","nat_sc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.sym_v4",\ + capi_kwlist,&v4_capi,&at_sc_capi,&s_capi,&irt_capi,&nsym_capi,&nat_sc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v4 */ + ; + capi_v4_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 1st argument `v4`"; + capi_v4_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v4_Dims,v4_Rank, capi_v4_intent,v4_capi,capi_errmess); + if (capi_v4_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v4 = (double *)(PyArray_DATA(capi_v4_as_array)); + + /* Processing variable at_sc */ + at_sc_Dims[0]=3,at_sc_Dims[1]=3; + capi_at_sc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 2nd argument `at_sc`"; + capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); + if (capi_at_sc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); + + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 3rd argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sym_v4() 5th argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable nat_sc */ + if (nat_sc_capi == Py_None) nat_sc = shape(v4, 0) / 3; else + f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.sym_v4() 1st keyword (nat_sc) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(v4, 0) == 3 * nat_sc,"shape(v4, 0) == 3 * nat_sc","1st keyword nat_sc","sym_v4:nat_sc=%d",nat_sc) { + /* Processing variable irt */ + irt_Dims[0]=48,irt_Dims[1]=nat_sc; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 4th argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(v4,at_sc,s,irt,&nsym,&nat_sc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*CHECKSCALAR(shape(v4, 0) == 3 * nat_sc)*/ + } /*if (f2py_success) of nat_sc*/ + /* End of cleaning variable nat_sc */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { + Py_XDECREF(capi_at_sc_as_array); } + } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ + /* End of cleaning variable at_sc */ + if((PyObject *)capi_v4_as_array!=v4_capi) { + Py_XDECREF(capi_v4_as_array); } + } /* if (capi_v4_as_array == NULL) ... else of v4 */ + /* End of cleaning variable v4 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of sym_v4 *******************************/ + +/********************************* print_symm *********************************/ +static char doc_f2py_rout_symph_print_symm[] = "\ +print_symm(s,nsym,irt,supercell,[nat])\n\nWrapper for ``print_symm``.\ +\n\nParameters\n----------\n" +"s : input rank-3 array('i') with bounds (3,3,48)\n" +"nsym : input int\n" +"irt : input rank-2 array('i') with bounds (48,nat)\n" +"supercell : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(irt, 1)"; +/* extern void F_FUNC_US(print_symm,PRINT_SYMM)(int*,int*,int*,int*,int*); */ +static PyObject *f2py_rout_symph_print_symm(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *s = NULL; + npy_intp s_Dims[3] = {-1, -1, -1}; + const int s_Rank = 3; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + int *irt = NULL; + npy_intp irt_Dims[2] = {-1, -1}; + const int irt_Rank = 2; + PyArrayObject *capi_irt_as_array = NULL; + int capi_irt_intent = 0; + PyObject *irt_capi = Py_None; + int supercell = 0; + PyObject *supercell_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"s","nsym","irt","supercell","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|O:symph.print_symm",\ + capi_kwlist,&s_capi,&nsym_capi,&irt_capi,&supercell_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable s */ + s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; + capi_s_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.print_symm: failed to create array from the 1st argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (int *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable nsym */ + f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.print_symm() 2nd argument (nsym) can't be converted to int"); + if (f2py_success) { + /* Processing variable irt */ + irt_Dims[0]=48; + capi_irt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.print_symm: failed to create array from the 3rd argument `irt`"; + capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); + if (capi_irt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irt = (int *)(PyArray_DATA(capi_irt_as_array)); + + /* Processing variable supercell */ + supercell = (int)PyObject_IsTrue(supercell_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(irt, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.print_symm() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irt, 1) == nat,"shape(irt, 1) == nat","1st keyword nat","print_symm:nat=%d",nat) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(s,&nsym,irt,&supercell,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(irt, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of supercell*/ + /* End of cleaning variable supercell */ + if((PyObject *)capi_irt_as_array!=irt_capi) { + Py_XDECREF(capi_irt_as_array); } + } /* if (capi_irt_as_array == NULL) ... else of irt */ + /* End of cleaning variable irt */ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of print_symm *****************************/ + +/****************************** io_global_start ******************************/ +static char doc_f2py_rout_symph_io_global_io_global_start[] = "\ +io_global_start(mpime,ionode_set)\n\nWrapper for ``io_global_start``.\ +\n\nParameters\n----------\n" +"mpime : input int\n" +"ionode_set : input int"; +/* */ +static PyObject *f2py_rout_symph_io_global_io_global_start(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int mpime = 0; + PyObject *mpime_capi = Py_None; + int ionode_set = 0; + PyObject *ionode_set_capi = Py_None; + static char *capi_kwlist[] = {"mpime","ionode_set",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.io_global.io_global_start",\ + capi_kwlist,&mpime_capi,&ionode_set_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable mpime */ + f2py_success = int_from_pyobj(&mpime,mpime_capi,"symph.io_global.io_global_start() 1st argument (mpime) can't be converted to int"); + if (f2py_success) { + /* Processing variable ionode_set */ + f2py_success = int_from_pyobj(&ionode_set,ionode_set_capi,"symph.io_global.io_global_start() 2nd argument (ionode_set) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&mpime,&ionode_set); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of ionode_set*/ + /* End of cleaning variable ionode_set */ + } /*if (f2py_success) of mpime*/ + /* End of cleaning variable mpime */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of io_global_start ***************************/ + +/**************************** meta_io_global_start ****************************/ +static char doc_f2py_rout_symph_io_global_meta_io_global_start[] = "\ +meta_io_global_start(mpime,ionode_set)\n\nWrapper for ``meta_io_global_start``.\ +\n\nParameters\n----------\n" +"mpime : input int\n" +"ionode_set : input int"; +/* */ +static PyObject *f2py_rout_symph_io_global_meta_io_global_start(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int mpime = 0; + PyObject *mpime_capi = Py_None; + int ionode_set = 0; + PyObject *ionode_set_capi = Py_None; + static char *capi_kwlist[] = {"mpime","ionode_set",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.io_global.meta_io_global_start",\ + capi_kwlist,&mpime_capi,&ionode_set_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable mpime */ + f2py_success = int_from_pyobj(&mpime,mpime_capi,"symph.io_global.meta_io_global_start() 1st argument (mpime) can't be converted to int"); + if (f2py_success) { + /* Processing variable ionode_set */ + f2py_success = int_from_pyobj(&ionode_set,ionode_set_capi,"symph.io_global.meta_io_global_start() 2nd argument (ionode_set) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&mpime,&ionode_set); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of ionode_set*/ + /* End of cleaning variable ionode_set */ + } /*if (f2py_success) of mpime*/ + /* End of cleaning variable mpime */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of meta_io_global_start ************************/ + +/**************************** io_global_getionode ****************************/ +static char doc_f2py_rout_symph_io_global_io_global_getionode[] = "\ +ionode_out,ionode_id_out = io_global_getionode()\n\nWrapper for ``io_global_getionode``.\ +\n\nReturns\n-------\n" +"ionode_out : int\n" +"ionode_id_out : int"; +/* */ +static PyObject *f2py_rout_symph_io_global_io_global_getionode(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ionode_out = 0; + int ionode_id_out = 0; + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:symph.io_global.io_global_getionode",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ + /* Processing variable ionode_out */ + /* Processing variable ionode_id_out */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ionode_out,&ionode_id_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("ii",ionode_out,ionode_id_out); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable ionode_id_out */ + /* End of cleaning variable ionode_out */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of io_global_getionode *************************/ + +/***************************** io_global_getmeta *****************************/ +static char doc_f2py_rout_symph_io_global_io_global_getmeta[] = "\ +io_global_getmeta(myrank,root)\n\nWrapper for ``io_global_getmeta``.\ +\n\nParameters\n----------\n" +"myrank : input int\n" +"root : input int"; +/* */ +static PyObject *f2py_rout_symph_io_global_io_global_getmeta(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int myrank = 0; + PyObject *myrank_capi = Py_None; + int root = 0; + PyObject *root_capi = Py_None; + static char *capi_kwlist[] = {"myrank","root",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.io_global.io_global_getmeta",\ + capi_kwlist,&myrank_capi,&root_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable myrank */ + f2py_success = int_from_pyobj(&myrank,myrank_capi,"symph.io_global.io_global_getmeta() 1st argument (myrank) can't be converted to int"); + if (f2py_success) { + /* Processing variable root */ + f2py_success = int_from_pyobj(&root,root_capi,"symph.io_global.io_global_getmeta() 2nd argument (root) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&myrank,&root); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of root*/ + /* End of cleaning variable root */ + } /*if (f2py_success) of myrank*/ + /* End of cleaning variable myrank */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of io_global_getmeta **************************/ + +/****************************** print_kind_info ******************************/ +static char doc_f2py_rout_symph_kinds_print_kind_info[] = "\ +print_kind_info(stdout_bn)\n\nWrapper for ``print_kind_info``.\ +\n\nParameters\n----------\n" +"stdout_bn : input int"; +/* */ +static PyObject *f2py_rout_symph_kinds_print_kind_info(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int stdout_bn = 0; + PyObject *stdout_bn_capi = Py_None; + static char *capi_kwlist[] = {"stdout_bn",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:symph.kinds.print_kind_info",\ + capi_kwlist,&stdout_bn_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable stdout_bn */ + f2py_success = int_from_pyobj(&stdout_bn,stdout_bn_capi,"symph.kinds.print_kind_info() 1st argument (stdout_bn) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&stdout_bn); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of stdout_bn*/ + /* End of cleaning variable stdout_bn */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of print_kind_info ***************************/ + +/**************************** set_accep_threshold ****************************/ +static char doc_f2py_rout_symph_symm_base_set_accep_threshold[] = "\ +set_accep_threshold(thr)\n\nWrapper for ``set_accep_threshold``.\ +\n\nParameters\n----------\n" +"thr : input float"; +/* */ +static PyObject *f2py_rout_symph_symm_base_set_accep_threshold(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double thr = 0; + PyObject *thr_capi = Py_None; + static char *capi_kwlist[] = {"thr",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:symph.symm_base.set_accep_threshold",\ + capi_kwlist,&thr_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable thr */ + f2py_success = double_from_pyobj(&thr,thr_capi,"symph.symm_base.set_accep_threshold() 1st argument (thr) can't be converted to double"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&thr); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of thr*/ + /* End of cleaning variable thr */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of set_accep_threshold *************************/ + +/**************************** get_accep_threshold ****************************/ +static char doc_f2py_rout_symph_symm_base_get_accep_threshold[] = "\ +thr = get_accep_threshold()\n\nWrapper for ``get_accep_threshold``.\ +\n\nReturns\n-------\n" +"thr : float"; +/* */ +static PyObject *f2py_rout_symph_symm_base_get_accep_threshold(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double thr = 0; + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:symph.symm_base.get_accep_threshold",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ + /* Processing variable thr */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&thr); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",thr); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable thr */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of get_accep_threshold *************************/ + +/********************************* set_at_bg *********************************/ +static char doc_f2py_rout_symph_symm_base_set_at_bg[] = "\ +set_at_bg(new_at,new_bg)\n\nWrapper for ``set_at_bg``.\ +\n\nParameters\n----------\n" +"new_at : input rank-2 array('d') with bounds (3,3)\n" +"new_bg : input rank-2 array('d') with bounds (3,3)"; +/* */ +static PyObject *f2py_rout_symph_symm_base_set_at_bg(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *new_at = NULL; + npy_intp new_at_Dims[2] = {-1, -1}; + const int new_at_Rank = 2; + PyArrayObject *capi_new_at_as_array = NULL; + int capi_new_at_intent = 0; + PyObject *new_at_capi = Py_None; + double *new_bg = NULL; + npy_intp new_bg_Dims[2] = {-1, -1}; + const int new_bg_Rank = 2; + PyArrayObject *capi_new_bg_as_array = NULL; + int capi_new_bg_intent = 0; + PyObject *new_bg_capi = Py_None; + static char *capi_kwlist[] = {"new_at","new_bg",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.symm_base.set_at_bg",\ + capi_kwlist,&new_at_capi,&new_bg_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable new_at */ + new_at_Dims[0]=3,new_at_Dims[1]=3; + capi_new_at_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.set_at_bg: failed to create array from the 1st argument `new_at`"; + capi_new_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_at_Dims,new_at_Rank, capi_new_at_intent,new_at_capi,capi_errmess); + if (capi_new_at_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + new_at = (double *)(PyArray_DATA(capi_new_at_as_array)); + + /* Processing variable new_bg */ + new_bg_Dims[0]=3,new_bg_Dims[1]=3; + capi_new_bg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.set_at_bg: failed to create array from the 2nd argument `new_bg`"; + capi_new_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_bg_Dims,new_bg_Rank, capi_new_bg_intent,new_bg_capi,capi_errmess); + if (capi_new_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + new_bg = (double *)(PyArray_DATA(capi_new_bg_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(new_at,new_bg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_new_bg_as_array!=new_bg_capi) { + Py_XDECREF(capi_new_bg_as_array); } + } /* if (capi_new_bg_as_array == NULL) ... else of new_bg */ + /* End of cleaning variable new_bg */ + if((PyObject *)capi_new_at_as_array!=new_at_capi) { + Py_XDECREF(capi_new_at_as_array); } + } /* if (capi_new_at_as_array == NULL) ... else of new_at */ + /* End of cleaning variable new_at */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of set_at_bg ******************************/ + +/********************************* inverse_s *********************************/ +static char doc_f2py_rout_symph_symm_base_inverse_s[] = "\ +inverse_s()\n\nWrapper for ``inverse_s``.\ +\n"; +/* */ +static PyObject *f2py_rout_symph_symm_base_inverse_s(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(void)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:symph.symm_base.inverse_s",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of inverse_s ******************************/ + +/********************************* set_sym_bl *********************************/ +static char doc_f2py_rout_symph_symm_base_set_sym_bl[] = "\ +set_sym_bl()\n\nWrapper for ``set_sym_bl``.\ +\n"; +/* */ +static PyObject *f2py_rout_symph_symm_base_set_sym_bl(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(void)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:symph.symm_base.set_sym_bl",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of set_sym_bl *****************************/ + +/********************************** find_sym **********************************/ +static char doc_f2py_rout_symph_symm_base_find_sym[] = "\ +find_sym(tau,ityp,nr1,nr2,nr3,magnetic_sym,m_loc,[nat])\n\nWrapper for ``find_sym``.\ +\n\nParameters\n----------\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"magnetic_sym : input int\n" +"m_loc : input rank-2 array('d') with bounds (3,nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)"; +/* */ +static PyObject *f2py_rout_symph_symm_base_find_sym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,int*,int*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + int magnetic_sym = 0; + PyObject *magnetic_sym_capi = Py_None; + double *m_loc = NULL; + npy_intp m_loc_Dims[2] = {-1, -1}; + const int m_loc_Rank = 2; + PyArrayObject *capi_m_loc_as_array = NULL; + int capi_m_loc_intent = 0; + PyObject *m_loc_capi = Py_None; + static char *capi_kwlist[] = {"tau","ityp","nr1","nr2","nr3","magnetic_sym","m_loc","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:symph.symm_base.find_sym",\ + capi_kwlist,&tau_capi,&ityp_capi,&nr1_capi,&nr2_capi,&nr3_capi,&magnetic_sym_capi,&m_loc_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.find_sym() 3rd argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.find_sym() 4th argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.find_sym() 5th argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.find_sym: failed to create array from the 1st argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable magnetic_sym */ + magnetic_sym = (int)PyObject_IsTrue(magnetic_sym_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.find_sym() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","find_sym:nat=%d",nat) { + /* Processing variable ityp */ + ityp_Dims[0]=nat; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.find_sym: failed to create array from the 2nd argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + + /* Processing variable m_loc */ + m_loc_Dims[0]=3,m_loc_Dims[1]=nat; + capi_m_loc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.find_sym: failed to create array from the 7th argument `m_loc`"; + capi_m_loc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_loc_Dims,m_loc_Rank, capi_m_loc_intent,m_loc_capi,capi_errmess); + if (capi_m_loc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m_loc = (double *)(PyArray_DATA(capi_m_loc_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,tau,ityp,&nr1,&nr2,&nr3,&magnetic_sym,m_loc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_m_loc_as_array!=m_loc_capi) { + Py_XDECREF(capi_m_loc_as_array); } + } /* if (capi_m_loc_as_array == NULL) ... else of m_loc */ + /* End of cleaning variable m_loc */ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*if (f2py_success) of magnetic_sym*/ + /* End of cleaning variable magnetic_sym */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of find_sym ******************************/ + +/********************************** sgam_at **********************************/ +static char doc_f2py_rout_symph_symm_base_sgam_at[] = "\ +sym = sgam_at(tau,ityp,nr1,nr2,nr3,[nat])\n\nWrapper for ``sgam_at``.\ +\n\nParameters\n----------\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)\n" +"\nReturns\n-------\n" +"sym : rank-1 array('i') with bounds (48)"; +/* */ +static PyObject *f2py_rout_symph_symm_base_sgam_at(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + int *sym = NULL; + npy_intp sym_Dims[1] = {-1}; + const int sym_Rank = 1; + PyArrayObject *capi_sym_as_array = NULL; + int capi_sym_intent = 0; + static char *capi_kwlist[] = {"tau","ityp","nr1","nr2","nr3","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.symm_base.sgam_at",\ + capi_kwlist,&tau_capi,&ityp_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.sgam_at() 3rd argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.sgam_at() 4th argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.sgam_at() 5th argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.sgam_at: failed to create array from the 1st argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable sym */ + sym_Dims[0]=48; + capi_sym_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "symph.symph.symm_base.sgam_at: failed to create array from the hidden `sym`"; + capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,Py_None,capi_errmess); + if (capi_sym_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sym = (int *)(PyArray_DATA(capi_sym_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.sgam_at() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","sgam_at:nat=%d",nat) { + /* Processing variable ityp */ + ityp_Dims[0]=nat; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.sgam_at: failed to create array from the 2nd argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,tau,ityp,&nr1,&nr2,&nr3,sym); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_sym_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /* if (capi_sym_as_array == NULL) ... else of sym */ + /* End of cleaning variable sym */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of sgam_at *******************************/ + +/******************************** sgam_at_mag ********************************/ +static char doc_f2py_rout_symph_symm_base_sgam_at_mag[] = "\ +sgam_at_mag(m_loc,sym,[nat])\n\nWrapper for ``sgam_at_mag``.\ +\n\nParameters\n----------\n" +"m_loc : input rank-2 array('d') with bounds (3,nat)\n" +"sym : in/output rank-1 array('i') with bounds (48)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(m_loc, 1)"; +/* */ +static PyObject *f2py_rout_symph_symm_base_sgam_at_mag(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + double *m_loc = NULL; + npy_intp m_loc_Dims[2] = {-1, -1}; + const int m_loc_Rank = 2; + PyArrayObject *capi_m_loc_as_array = NULL; + int capi_m_loc_intent = 0; + PyObject *m_loc_capi = Py_None; + int *sym = NULL; + npy_intp sym_Dims[1] = {-1}; + const int sym_Rank = 1; + PyArrayObject *capi_sym_as_array = NULL; + int capi_sym_intent = 0; + PyObject *sym_capi = Py_None; + static char *capi_kwlist[] = {"m_loc","sym","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:symph.symm_base.sgam_at_mag",\ + capi_kwlist,&m_loc_capi,&sym_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable m_loc */ + m_loc_Dims[0]=3; + capi_m_loc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.sgam_at_mag: failed to create array from the 1st argument `m_loc`"; + capi_m_loc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_loc_Dims,m_loc_Rank, capi_m_loc_intent,m_loc_capi,capi_errmess); + if (capi_m_loc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m_loc = (double *)(PyArray_DATA(capi_m_loc_as_array)); + + /* Processing variable sym */ + sym_Dims[0]=48; + capi_sym_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.symm_base.sgam_at_mag: failed to create array from the 2nd argument `sym`"; + capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,sym_capi,capi_errmess); + if (capi_sym_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sym = (int *)(PyArray_DATA(capi_sym_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(m_loc, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.sgam_at_mag() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(m_loc, 1) == nat,"shape(m_loc, 1) == nat","1st keyword nat","sgam_at_mag:nat=%d",nat) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,m_loc,sym); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(m_loc, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_sym_as_array!=sym_capi) { + Py_XDECREF(capi_sym_as_array); } + } /* if (capi_sym_as_array == NULL) ... else of sym */ + /* End of cleaning variable sym */ + if((PyObject *)capi_m_loc_as_array!=m_loc_capi) { + Py_XDECREF(capi_m_loc_as_array); } + } /* if (capi_m_loc_as_array == NULL) ... else of m_loc */ + /* End of cleaning variable m_loc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of sgam_at_mag *****************************/ + +/********************************** set_sym **********************************/ +static char doc_f2py_rout_symph_symm_base_set_sym[] = "\ +set_sym(tau,ityp,nspin_mag,m_loc,nr1,nr2,nr3,[nat])\n\nWrapper for ``set_sym``.\ +\n\nParameters\n----------\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"nspin_mag : input int\n" +"m_loc : input rank-2 array('d') with bounds (3,nat)\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)"; +/* */ +static PyObject *f2py_rout_symph_symm_base_set_sym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,int*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + int nspin_mag = 0; + PyObject *nspin_mag_capi = Py_None; + double *m_loc = NULL; + npy_intp m_loc_Dims[2] = {-1, -1}; + const int m_loc_Rank = 2; + PyArrayObject *capi_m_loc_as_array = NULL; + int capi_m_loc_intent = 0; + PyObject *m_loc_capi = Py_None; + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + static char *capi_kwlist[] = {"tau","ityp","nspin_mag","m_loc","nr1","nr2","nr3","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:symph.symm_base.set_sym",\ + capi_kwlist,&tau_capi,&ityp_capi,&nspin_mag_capi,&m_loc_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nspin_mag */ + f2py_success = int_from_pyobj(&nspin_mag,nspin_mag_capi,"symph.symm_base.set_sym() 3rd argument (nspin_mag) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.set_sym() 5th argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.set_sym() 6th argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.set_sym() 7th argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.set_sym: failed to create array from the 1st argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.set_sym() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","set_sym:nat=%d",nat) { + /* Processing variable ityp */ + ityp_Dims[0]=nat; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.set_sym: failed to create array from the 2nd argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + + /* Processing variable m_loc */ + m_loc_Dims[0]=3,m_loc_Dims[1]=nat; + capi_m_loc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.set_sym: failed to create array from the 4th argument `m_loc`"; + capi_m_loc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_loc_Dims,m_loc_Rank, capi_m_loc_intent,m_loc_capi,capi_errmess); + if (capi_m_loc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m_loc = (double *)(PyArray_DATA(capi_m_loc_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,tau,ityp,&nspin_mag,m_loc,&nr1,&nr2,&nr3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_m_loc_as_array!=m_loc_capi) { + Py_XDECREF(capi_m_loc_as_array); } + } /* if (capi_m_loc_as_array == NULL) ... else of m_loc */ + /* End of cleaning variable m_loc */ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ + } /*if (f2py_success) of nspin_mag*/ + /* End of cleaning variable nspin_mag */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of set_sym *******************************/ + +/********************************** copy_sym **********************************/ +static char doc_f2py_rout_symph_symm_base_copy_sym[] = "\ +copy_sym = copy_sym(nrot_,sym)\n\nWrapper for ``copy_sym``.\ +\n\nParameters\n----------\n" +"nrot_ : input int\n" +"sym : in/output rank-1 array('i') with bounds (48)\n" +"\nReturns\n-------\n" +"copy_sym : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_symph_symm_base_copy_sym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int copy_symf2pywrap = 0; + int nrot_ = 0; + PyObject *nrot__capi = Py_None; + int *sym = NULL; + npy_intp sym_Dims[1] = {-1}; + const int sym_Rank = 1; + PyArrayObject *capi_sym_as_array = NULL; + int capi_sym_intent = 0; + PyObject *sym_capi = Py_None; + static char *capi_kwlist[] = {"nrot_","sym",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:symph.symm_base.copy_sym",\ + capi_kwlist,&nrot__capi,&sym_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nrot_ */ + f2py_success = int_from_pyobj(&nrot_,nrot__capi,"symph.symm_base.copy_sym() 1st argument (nrot_) can't be converted to int"); + if (f2py_success) { + /* Processing variable sym */ + sym_Dims[0]=48; + capi_sym_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.symm_base.copy_sym: failed to create array from the 2nd argument `sym`"; + capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,sym_capi,capi_errmess); + if (capi_sym_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sym = (int *)(PyArray_DATA(capi_sym_as_array)); + + /* Processing variable copy_symf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(©_symf2pywrap,&nrot_,sym); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",copy_symf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable copy_symf2pywrap */ + if((PyObject *)capi_sym_as_array!=sym_capi) { + Py_XDECREF(capi_sym_as_array); } + } /* if (capi_sym_as_array == NULL) ... else of sym */ + /* End of cleaning variable sym */ + } /*if (f2py_success) of nrot_*/ + /* End of cleaning variable nrot_ */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of copy_sym ******************************/ + +/********************************** is_group **********************************/ +static char doc_f2py_rout_symph_symm_base_is_group[] = "\ +is_group = is_group()\n\nWrapper for ``is_group``.\ +\n\nReturns\n-------\n" +"is_group : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_symph_symm_base_is_group(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int is_groupf2pywrap = 0; + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:symph.symm_base.is_group",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ + /* Processing variable is_groupf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&is_groupf2pywrap); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",is_groupf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable is_groupf2pywrap */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of is_group ******************************/ + +/*********************************** eqvect ***********************************/ +static char doc_f2py_rout_symph_symm_base_eqvect[] = "\ +eqvect = eqvect(x,y,f)\n\nWrapper for ``eqvect``.\ +\n\nParameters\n----------\n" +"x : input rank-1 array('d') with bounds (3)\n" +"y : input rank-1 array('d') with bounds (3)\n" +"f : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"eqvect : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_symph_symm_base_eqvect(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int eqvectf2pywrap = 0; + double *x = NULL; + npy_intp x_Dims[1] = {-1}; + const int x_Rank = 1; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + double *y = NULL; + npy_intp y_Dims[1] = {-1}; + const int y_Rank = 1; + PyArrayObject *capi_y_as_array = NULL; + int capi_y_intent = 0; + PyObject *y_capi = Py_None; + double *f = NULL; + npy_intp f_Dims[1] = {-1}; + const int f_Rank = 1; + PyArrayObject *capi_f_as_array = NULL; + int capi_f_intent = 0; + PyObject *f_capi = Py_None; + static char *capi_kwlist[] = {"x","y","f",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:symph.symm_base.eqvect",\ + capi_kwlist,&x_capi,&y_capi,&f_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + x_Dims[0]=3; + capi_x_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.eqvect: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (double *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable y */ + y_Dims[0]=3; + capi_y_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.eqvect: failed to create array from the 2nd argument `y`"; + capi_y_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,y_Dims,y_Rank, capi_y_intent,y_capi,capi_errmess); + if (capi_y_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + y = (double *)(PyArray_DATA(capi_y_as_array)); + + /* Processing variable f */ + f_Dims[0]=3; + capi_f_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.eqvect: failed to create array from the 3rd argument `f`"; + capi_f_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_Dims,f_Rank, capi_f_intent,f_capi,capi_errmess); + if (capi_f_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f = (double *)(PyArray_DATA(capi_f_as_array)); + + /* Processing variable eqvectf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&eqvectf2pywrap,x,y,f); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",eqvectf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable eqvectf2pywrap */ + if((PyObject *)capi_f_as_array!=f_capi) { + Py_XDECREF(capi_f_as_array); } + } /* if (capi_f_as_array == NULL) ... else of f */ + /* End of cleaning variable f */ + if((PyObject *)capi_y_as_array!=y_capi) { + Py_XDECREF(capi_y_as_array); } + } /* if (capi_y_as_array == NULL) ... else of y */ + /* End of cleaning variable y */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of eqvect *******************************/ + +/********************************** checksym **********************************/ +static char doc_f2py_rout_symph_symm_base_checksym[] = "\ +checksym = checksym(irot,ityp,xau,rau,ft_,[nat])\n\nWrapper for ``checksym``.\ +\n\nParameters\n----------\n" +"irot : input int\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"xau : input rank-2 array('d') with bounds (3,nat)\n" +"rau : input rank-2 array('d') with bounds (3,nat)\n" +"ft_ : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(ityp, 0)\n" +"\nReturns\n-------\n" +"checksym : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_symph_symm_base_checksym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int checksymf2pywrap = 0; + int irot = 0; + PyObject *irot_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + double *xau = NULL; + npy_intp xau_Dims[2] = {-1, -1}; + const int xau_Rank = 2; + PyArrayObject *capi_xau_as_array = NULL; + int capi_xau_intent = 0; + PyObject *xau_capi = Py_None; + double *rau = NULL; + npy_intp rau_Dims[2] = {-1, -1}; + const int rau_Rank = 2; + PyArrayObject *capi_rau_as_array = NULL; + int capi_rau_intent = 0; + PyObject *rau_capi = Py_None; + double *ft_ = NULL; + npy_intp ft__Dims[1] = {-1}; + const int ft__Rank = 1; + PyArrayObject *capi_ft__as_array = NULL; + int capi_ft__intent = 0; + PyObject *ft__capi = Py_None; + static char *capi_kwlist[] = {"irot","ityp","xau","rau","ft_","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.symm_base.checksym",\ + capi_kwlist,&irot_capi,&ityp_capi,&xau_capi,&rau_capi,&ft__capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ityp */ + ; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 2nd argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + + /* Processing variable irot */ + f2py_success = int_from_pyobj(&irot,irot_capi,"symph.symm_base.checksym() 1st argument (irot) can't be converted to int"); + if (f2py_success) { + /* Processing variable ft_ */ + ft__Dims[0]=3; + capi_ft__intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 5th argument `ft_`"; + capi_ft__as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ft__Dims,ft__Rank, capi_ft__intent,ft__capi,capi_errmess); + if (capi_ft__as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ft_ = (double *)(PyArray_DATA(capi_ft__as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(ityp, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.checksym() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ityp, 0) == nat,"shape(ityp, 0) == nat","1st keyword nat","checksym:nat=%d",nat) { + /* Processing variable xau */ + xau_Dims[0]=3,xau_Dims[1]=nat; + capi_xau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 3rd argument `xau`"; + capi_xau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xau_Dims,xau_Rank, capi_xau_intent,xau_capi,capi_errmess); + if (capi_xau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xau = (double *)(PyArray_DATA(capi_xau_as_array)); + + /* Processing variable rau */ + rau_Dims[0]=3,rau_Dims[1]=nat; + capi_rau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 4th argument `rau`"; + capi_rau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rau_Dims,rau_Rank, capi_rau_intent,rau_capi,capi_errmess); + if (capi_rau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rau = (double *)(PyArray_DATA(capi_rau_as_array)); + + /* Processing variable checksymf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&checksymf2pywrap,&irot,&nat,ityp,xau,rau,ft_); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",checksymf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable checksymf2pywrap */ + if((PyObject *)capi_rau_as_array!=rau_capi) { + Py_XDECREF(capi_rau_as_array); } + } /* if (capi_rau_as_array == NULL) ... else of rau */ + /* End of cleaning variable rau */ + if((PyObject *)capi_xau_as_array!=xau_capi) { + Py_XDECREF(capi_xau_as_array); } + } /* if (capi_xau_as_array == NULL) ... else of xau */ + /* End of cleaning variable xau */ + } /*CHECKSCALAR(shape(ityp, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_ft__as_array!=ft__capi) { + Py_XDECREF(capi_ft__as_array); } + } /* if (capi_ft__as_array == NULL) ... else of ft_ */ + /* End of cleaning variable ft_ */ + } /*if (f2py_success) of irot*/ + /* End of cleaning variable irot */ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of checksym ******************************/ + +/******************************** checkallsym ********************************/ +static char doc_f2py_rout_symph_symm_base_checkallsym[] = "\ +checkallsym(tau,ityp,nr1,nr2,nr3,[nat])\n\nWrapper for ``checkallsym``.\ +\n\nParameters\n----------\n" +"tau : input rank-2 array('d') with bounds (3,nat)\n" +"ityp : input rank-1 array('i') with bounds (nat)\n" +"nr1 : input int\n" +"nr2 : input int\n" +"nr3 : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 1)"; +/* */ +static PyObject *f2py_rout_symph_symm_base_checkallsym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + int *ityp = NULL; + npy_intp ityp_Dims[1] = {-1}; + const int ityp_Rank = 1; + PyArrayObject *capi_ityp_as_array = NULL; + int capi_ityp_intent = 0; + PyObject *ityp_capi = Py_None; + int nr1 = 0; + PyObject *nr1_capi = Py_None; + int nr2 = 0; + PyObject *nr2_capi = Py_None; + int nr3 = 0; + PyObject *nr3_capi = Py_None; + static char *capi_kwlist[] = {"tau","ityp","nr1","nr2","nr3","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:symph.symm_base.checkallsym",\ + capi_kwlist,&tau_capi,&ityp_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nr1 */ + f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.checkallsym() 3rd argument (nr1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr2 */ + f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.checkallsym() 4th argument (nr2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nr3 */ + f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.checkallsym() 5th argument (nr3) can't be converted to int"); + if (f2py_success) { + /* Processing variable tau */ + tau_Dims[0]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.checkallsym: failed to create array from the 1st argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 1); else + f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.checkallsym() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","checkallsym:nat=%d",nat) { + /* Processing variable ityp */ + ityp_Dims[0]=nat; + capi_ityp_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.checkallsym: failed to create array from the 2nd argument `ityp`"; + capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); + if (capi_ityp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,tau,ityp,&nr1,&nr2,&nr3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_ityp_as_array!=ityp_capi) { + Py_XDECREF(capi_ityp_as_array); } + } /* if (capi_ityp_as_array == NULL) ... else of ityp */ + /* End of cleaning variable ityp */ + } /*CHECKSCALAR(shape(tau, 1) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*if (f2py_success) of nr3*/ + /* End of cleaning variable nr3 */ + } /*if (f2py_success) of nr2*/ + /* End of cleaning variable nr2 */ + } /*if (f2py_success) of nr1*/ + /* End of cleaning variable nr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of checkallsym *****************************/ + +/******************************* s_axis_to_cart *******************************/ +static char doc_f2py_rout_symph_symm_base_s_axis_to_cart[] = "\ +s_axis_to_cart()\n\nWrapper for ``s_axis_to_cart``.\ +\n"; +/* */ +static PyObject *f2py_rout_symph_symm_base_s_axis_to_cart(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(void)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:symph.symm_base.s_axis_to_cart",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of s_axis_to_cart ***************************/ + +/********************************** smallg_q **********************************/ +static char doc_f2py_rout_symph_symm_base_smallg_q[] = "\ +minus_q = smallg_q(aq,modenum,sym)\n\nWrapper for ``smallg_q``.\ +\n\nParameters\n----------\n" +"aq : input rank-1 array('d') with bounds (3)\n" +"modenum : input int\n" +"sym : in/output rank-1 array('i') with bounds (48)\n" +"\nReturns\n-------\n" +"minus_q : int"; +/* */ +static PyObject *f2py_rout_symph_symm_base_smallg_q(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *aq = NULL; + npy_intp aq_Dims[1] = {-1}; + const int aq_Rank = 1; + PyArrayObject *capi_aq_as_array = NULL; + int capi_aq_intent = 0; + PyObject *aq_capi = Py_None; + int modenum = 0; + PyObject *modenum_capi = Py_None; + int *sym = NULL; + npy_intp sym_Dims[1] = {-1}; + const int sym_Rank = 1; + PyArrayObject *capi_sym_as_array = NULL; + int capi_sym_intent = 0; + PyObject *sym_capi = Py_None; + int minus_q = 0; + static char *capi_kwlist[] = {"aq","modenum","sym",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:symph.symm_base.smallg_q",\ + capi_kwlist,&aq_capi,&modenum_capi,&sym_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable aq */ + aq_Dims[0]=3; + capi_aq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "symph.symph.symm_base.smallg_q: failed to create array from the 1st argument `aq`"; + capi_aq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,aq_Dims,aq_Rank, capi_aq_intent,aq_capi,capi_errmess); + if (capi_aq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + aq = (double *)(PyArray_DATA(capi_aq_as_array)); + + /* Processing variable modenum */ + f2py_success = int_from_pyobj(&modenum,modenum_capi,"symph.symm_base.smallg_q() 2nd argument (modenum) can't be converted to int"); + if (f2py_success) { + /* Processing variable sym */ + sym_Dims[0]=48; + capi_sym_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "symph.symph.symm_base.smallg_q: failed to create array from the 3rd argument `sym`"; + capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,sym_capi,capi_errmess); + if (capi_sym_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = symph_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sym = (int *)(PyArray_DATA(capi_sym_as_array)); + + /* Processing variable minus_q */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(aq,&modenum,sym,&minus_q); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",minus_q); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable minus_q */ + if((PyObject *)capi_sym_as_array!=sym_capi) { + Py_XDECREF(capi_sym_as_array); } + } /* if (capi_sym_as_array == NULL) ... else of sym */ + /* End of cleaning variable sym */ + } /*if (f2py_success) of modenum*/ + /* End of cleaning variable modenum */ + if((PyObject *)capi_aq_as_array!=aq_capi) { + Py_XDECREF(capi_aq_as_array); } + } /* if (capi_aq_as_array == NULL) ... else of aq */ + /* End of cleaning variable aq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of smallg_q ******************************/ +/*eof body*/ + +/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ + +static FortranDataDef f2py_constants_def[] = { + {"pi",0,{{-1}},NPY_FLOAT, 1}, + {"tpi",0,{{-1}},NPY_FLOAT, 1}, + {"fpi",0,{{-1}},NPY_FLOAT, 1}, + {"sqrtpi",0,{{-1}},NPY_FLOAT, 1}, + {"sqrtpm1",0,{{-1}},NPY_FLOAT, 1}, + {"sqrt2",0,{{-1}},NPY_FLOAT, 1}, + {"h_planck_si",0,{{-1}},NPY_FLOAT, 1}, + {"k_boltzmann_si",0,{{-1}},NPY_FLOAT, 1}, + {"electron_si",0,{{-1}},NPY_FLOAT, 1}, + {"electronvolt_si",0,{{-1}},NPY_FLOAT, 1}, + {"electronmass_si",0,{{-1}},NPY_FLOAT, 1}, + {"hartree_si",0,{{-1}},NPY_FLOAT, 1}, + {"rydberg_si",0,{{-1}},NPY_FLOAT, 1}, + {"bohr_radius_si",0,{{-1}},NPY_FLOAT, 1}, + {"amu_si",0,{{-1}},NPY_FLOAT, 1}, + {"c_si",0,{{-1}},NPY_FLOAT, 1}, + {"munought_si",0,{{-1}},NPY_FLOAT, 1}, + {"epsnought_si",0,{{-1}},NPY_FLOAT, 1}, + {"k_boltzmann_au",0,{{-1}},NPY_FLOAT, 1}, + {"k_boltzmann_ry",0,{{-1}},NPY_FLOAT, 1}, + {"autoev",0,{{-1}},NPY_FLOAT, 1}, + {"rytoev",0,{{-1}},NPY_FLOAT, 1}, + {"amu_au",0,{{-1}},NPY_FLOAT, 1}, + {"amu_ry",0,{{-1}},NPY_FLOAT, 1}, + {"au_sec",0,{{-1}},NPY_FLOAT, 1}, + {"au_ps",0,{{-1}},NPY_FLOAT, 1}, + {"au_gpa",0,{{-1}},NPY_FLOAT, 1}, + {"ry_kbar",0,{{-1}},NPY_FLOAT, 1}, + {"debye_si",0,{{-1}},NPY_FLOAT, 1}, + {"au_debye",0,{{-1}},NPY_FLOAT, 1}, + {"ev_to_kelvin",0,{{-1}},NPY_FLOAT, 1}, + {"ry_to_kelvin",0,{{-1}},NPY_FLOAT, 1}, + {"evtonm",0,{{-1}},NPY_FLOAT, 1}, + {"rytonm",0,{{-1}},NPY_FLOAT, 1}, + {"c_au",0,{{-1}},NPY_FLOAT, 1}, + {"eps4",0,{{-1}},NPY_FLOAT, 1}, + {"eps6",0,{{-1}},NPY_FLOAT, 1}, + {"eps8",0,{{-1}},NPY_FLOAT, 1}, + {"eps12",0,{{-1}},NPY_FLOAT, 1}, + {"eps14",0,{{-1}},NPY_FLOAT, 1}, + {"eps16",0,{{-1}},NPY_FLOAT, 1}, + {"eps24",0,{{-1}},NPY_FLOAT, 1}, + {"eps32",0,{{-1}},NPY_FLOAT, 1}, + {"gsmall",0,{{-1}},NPY_FLOAT, 1}, + {"e2",0,{{-1}},NPY_FLOAT, 1}, + {"degspin",0,{{-1}},NPY_FLOAT, 1}, + {"bohr_radius_cm",0,{{-1}},NPY_FLOAT, 1}, + {"bohr_radius_angs",0,{{-1}},NPY_FLOAT, 1}, + {"angstrom_au",0,{{-1}},NPY_FLOAT, 1}, + {"dip_debye",0,{{-1}},NPY_FLOAT, 1}, + {"au_terahertz",0,{{-1}},NPY_FLOAT, 1}, + {"au_to_ohmcmm1",0,{{-1}},NPY_FLOAT, 1}, + {"ry_to_thz",0,{{-1}},NPY_FLOAT, 1}, + {"ry_to_ghz",0,{{-1}},NPY_FLOAT, 1}, + {"ry_to_cmm1",0,{{-1}},NPY_FLOAT, 1}, + {"avogadro",0,{{-1}},NPY_FLOAT, 1}, + {NULL} +}; + +static void f2py_setup_constants(char *pi,char *tpi,char *fpi,char *sqrtpi,char *sqrtpm1,char *sqrt2,char *h_planck_si,char *k_boltzmann_si,char *electron_si,char *electronvolt_si,char *electronmass_si,char *hartree_si,char *rydberg_si,char *bohr_radius_si,char *amu_si,char *c_si,char *munought_si,char *epsnought_si,char *k_boltzmann_au,char *k_boltzmann_ry,char *autoev,char *rytoev,char *amu_au,char *amu_ry,char *au_sec,char *au_ps,char *au_gpa,char *ry_kbar,char *debye_si,char *au_debye,char *ev_to_kelvin,char *ry_to_kelvin,char *evtonm,char *rytonm,char *c_au,char *eps4,char *eps6,char *eps8,char *eps12,char *eps14,char *eps16,char *eps24,char *eps32,char *gsmall,char *e2,char *degspin,char *bohr_radius_cm,char *bohr_radius_angs,char *angstrom_au,char *dip_debye,char *au_terahertz,char *au_to_ohmcmm1,char *ry_to_thz,char *ry_to_ghz,char *ry_to_cmm1,char *avogadro) { + int i_f2py=0; + f2py_constants_def[i_f2py++].data = pi; + f2py_constants_def[i_f2py++].data = tpi; + f2py_constants_def[i_f2py++].data = fpi; + f2py_constants_def[i_f2py++].data = sqrtpi; + f2py_constants_def[i_f2py++].data = sqrtpm1; + f2py_constants_def[i_f2py++].data = sqrt2; + f2py_constants_def[i_f2py++].data = h_planck_si; + f2py_constants_def[i_f2py++].data = k_boltzmann_si; + f2py_constants_def[i_f2py++].data = electron_si; + f2py_constants_def[i_f2py++].data = electronvolt_si; + f2py_constants_def[i_f2py++].data = electronmass_si; + f2py_constants_def[i_f2py++].data = hartree_si; + f2py_constants_def[i_f2py++].data = rydberg_si; + f2py_constants_def[i_f2py++].data = bohr_radius_si; + f2py_constants_def[i_f2py++].data = amu_si; + f2py_constants_def[i_f2py++].data = c_si; + f2py_constants_def[i_f2py++].data = munought_si; + f2py_constants_def[i_f2py++].data = epsnought_si; + f2py_constants_def[i_f2py++].data = k_boltzmann_au; + f2py_constants_def[i_f2py++].data = k_boltzmann_ry; + f2py_constants_def[i_f2py++].data = autoev; + f2py_constants_def[i_f2py++].data = rytoev; + f2py_constants_def[i_f2py++].data = amu_au; + f2py_constants_def[i_f2py++].data = amu_ry; + f2py_constants_def[i_f2py++].data = au_sec; + f2py_constants_def[i_f2py++].data = au_ps; + f2py_constants_def[i_f2py++].data = au_gpa; + f2py_constants_def[i_f2py++].data = ry_kbar; + f2py_constants_def[i_f2py++].data = debye_si; + f2py_constants_def[i_f2py++].data = au_debye; + f2py_constants_def[i_f2py++].data = ev_to_kelvin; + f2py_constants_def[i_f2py++].data = ry_to_kelvin; + f2py_constants_def[i_f2py++].data = evtonm; + f2py_constants_def[i_f2py++].data = rytonm; + f2py_constants_def[i_f2py++].data = c_au; + f2py_constants_def[i_f2py++].data = eps4; + f2py_constants_def[i_f2py++].data = eps6; + f2py_constants_def[i_f2py++].data = eps8; + f2py_constants_def[i_f2py++].data = eps12; + f2py_constants_def[i_f2py++].data = eps14; + f2py_constants_def[i_f2py++].data = eps16; + f2py_constants_def[i_f2py++].data = eps24; + f2py_constants_def[i_f2py++].data = eps32; + f2py_constants_def[i_f2py++].data = gsmall; + f2py_constants_def[i_f2py++].data = e2; + f2py_constants_def[i_f2py++].data = degspin; + f2py_constants_def[i_f2py++].data = bohr_radius_cm; + f2py_constants_def[i_f2py++].data = bohr_radius_angs; + f2py_constants_def[i_f2py++].data = angstrom_au; + f2py_constants_def[i_f2py++].data = dip_debye; + f2py_constants_def[i_f2py++].data = au_terahertz; + f2py_constants_def[i_f2py++].data = au_to_ohmcmm1; + f2py_constants_def[i_f2py++].data = ry_to_thz; + f2py_constants_def[i_f2py++].data = ry_to_ghz; + f2py_constants_def[i_f2py++].data = ry_to_cmm1; + f2py_constants_def[i_f2py++].data = avogadro; +} +extern void F_FUNC(f2pyinitconstants,F2PYINITCONSTANTS)(void (*)(char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*)); +static void f2py_init_constants(void) { + F_FUNC(f2pyinitconstants,F2PYINITCONSTANTS)(f2py_setup_constants); +} + + +static FortranDataDef f2py_io_global_def[] = { + {"stdout",0,{{-1}},NPY_INT, 1}, + {"ionode",0,{{-1}},NPY_INT, 1}, + {"ionode_id",0,{{-1}},NPY_INT, 1}, + {"meta_ionode",0,{{-1}},NPY_INT, 1}, + {"meta_ionode_id",0,{{-1}},NPY_INT, 1}, + {"xmlinputunit",0,{{-1}},NPY_INT, 1}, + {"xmloutputunit",0,{{-1}},NPY_INT, 1}, + {"xmltmpunit",0,{{-1}},NPY_INT, 1}, + {"io_global_start",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_io_global_start,doc_f2py_rout_symph_io_global_io_global_start}, + {"meta_io_global_start",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_meta_io_global_start,doc_f2py_rout_symph_io_global_meta_io_global_start}, + {"io_global_getionode",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_io_global_getionode,doc_f2py_rout_symph_io_global_io_global_getionode}, + {"io_global_getmeta",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_io_global_getmeta,doc_f2py_rout_symph_io_global_io_global_getmeta}, + {NULL} +}; + +static void f2py_setup_io_global(char *stdout_bn,char *ionode,char *ionode_id,char *meta_ionode,char *meta_ionode_id,char *xmlinputunit,char *xmloutputunit,char *xmltmpunit,char *io_global_start,char *meta_io_global_start,char *io_global_getionode,char *io_global_getmeta) { + int i_f2py=0; + f2py_io_global_def[i_f2py++].data = stdout_bn; + f2py_io_global_def[i_f2py++].data = ionode; + f2py_io_global_def[i_f2py++].data = ionode_id; + f2py_io_global_def[i_f2py++].data = meta_ionode; + f2py_io_global_def[i_f2py++].data = meta_ionode_id; + f2py_io_global_def[i_f2py++].data = xmlinputunit; + f2py_io_global_def[i_f2py++].data = xmloutputunit; + f2py_io_global_def[i_f2py++].data = xmltmpunit; + f2py_io_global_def[i_f2py++].data = io_global_start; + f2py_io_global_def[i_f2py++].data = meta_io_global_start; + f2py_io_global_def[i_f2py++].data = io_global_getionode; + f2py_io_global_def[i_f2py++].data = io_global_getmeta; +} +extern void F_FUNC_US(f2pyinitio_global,F2PYINITIO_GLOBAL)(void (*)(char*,char*,char*,char*,char*,char*,char*,char*,char *,char *,char *,char *)); +static void f2py_init_io_global(void) { + F_FUNC_US(f2pyinitio_global,F2PYINITIO_GLOBAL)(f2py_setup_io_global); +} + + +static FortranDataDef f2py_kinds_def[] = { + {"dp",0,{{-1}},NPY_INT, 1}, + {"sgl",0,{{-1}},NPY_INT, 1}, + {"i4b",0,{{-1}},NPY_INT, 1}, + {"print_kind_info",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_kinds_print_kind_info,doc_f2py_rout_symph_kinds_print_kind_info}, + {NULL} +}; + +static void f2py_setup_kinds(char *dp,char *sgl,char *i4b,char *print_kind_info) { + int i_f2py=0; + f2py_kinds_def[i_f2py++].data = dp; + f2py_kinds_def[i_f2py++].data = sgl; + f2py_kinds_def[i_f2py++].data = i4b; + f2py_kinds_def[i_f2py++].data = print_kind_info; +} +extern void F_FUNC(f2pyinitkinds,F2PYINITKINDS)(void (*)(char*,char*,char*,char *)); +static void f2py_init_kinds(void) { + F_FUNC(f2pyinitkinds,F2PYINITKINDS)(f2py_setup_kinds); +} + + +static FortranDataDef f2py_symm_base_def[] = { + {"eps1",0,{{-1}},NPY_DOUBLE, 1}, + {"eps2",0,{{-1}},NPY_DOUBLE, 1}, + {"s",3,{{3,3,48}},NPY_INT, 1}, + {"sr",3,{{3,3,48}},NPY_DOUBLE, 1}, + {"sname",1,{{48}},NPY_STRING, 45}, + {"ft",2,{{3,48}},NPY_DOUBLE, 1}, + {"ftau",2,{{3,48}},NPY_INT, 1}, + {"nrot",0,{{-1}},NPY_INT, 1}, + {"nsym",0,{{-1}},NPY_INT, 1}, + {"nsym_ns",0,{{-1}},NPY_INT, 1}, + {"nsym_na",0,{{-1}},NPY_INT, 1}, + {"t_rev",1,{{48}},NPY_INT, 1}, + {"no_t_rev",0,{{-1}},NPY_INT, 1}, + {"time_reversal",0,{{-1}},NPY_INT, 1}, + {"irt",2,{{-1,-1}},NPY_INT, 1}, + {"invs",1,{{48}},NPY_INT, 1}, + {"invsym",0,{{-1}},NPY_INT, 1}, + {"d1",3,{{3,3,48}},NPY_DOUBLE, 1}, + {"d2",3,{{5,5,48}},NPY_DOUBLE, 1}, + {"d3",3,{{7,7,48}},NPY_DOUBLE, 1}, + {"allfrac",0,{{-1}},NPY_INT, 1}, + {"nofrac",0,{{-1}},NPY_INT, 1}, + {"nosym",0,{{-1}},NPY_INT, 1}, + {"nosym_evc",0,{{-1}},NPY_INT, 1}, + {"at",2,{{3,3}},NPY_DOUBLE, 1}, + {"bg",2,{{3,3}},NPY_DOUBLE, 1}, + {"set_accep_threshold",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_accep_threshold,doc_f2py_rout_symph_symm_base_set_accep_threshold}, + {"get_accep_threshold",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_get_accep_threshold,doc_f2py_rout_symph_symm_base_get_accep_threshold}, + {"set_at_bg",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_at_bg,doc_f2py_rout_symph_symm_base_set_at_bg}, + {"inverse_s",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_inverse_s,doc_f2py_rout_symph_symm_base_inverse_s}, + {"set_sym_bl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_sym_bl,doc_f2py_rout_symph_symm_base_set_sym_bl}, + {"find_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_find_sym,doc_f2py_rout_symph_symm_base_find_sym}, + {"sgam_at",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_sgam_at,doc_f2py_rout_symph_symm_base_sgam_at}, + {"sgam_at_mag",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_sgam_at_mag,doc_f2py_rout_symph_symm_base_sgam_at_mag}, + {"set_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_sym,doc_f2py_rout_symph_symm_base_set_sym}, + {"copy_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_copy_sym,doc_f2py_rout_symph_symm_base_copy_sym}, + {"is_group",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_is_group,doc_f2py_rout_symph_symm_base_is_group}, + {"eqvect",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_eqvect,doc_f2py_rout_symph_symm_base_eqvect}, + {"checksym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_checksym,doc_f2py_rout_symph_symm_base_checksym}, + {"checkallsym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_checkallsym,doc_f2py_rout_symph_symm_base_checkallsym}, + {"s_axis_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_s_axis_to_cart,doc_f2py_rout_symph_symm_base_s_axis_to_cart}, + {"smallg_q",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_smallg_q,doc_f2py_rout_symph_symm_base_smallg_q}, + {NULL} +}; + +static void f2py_setup_symm_base(char *eps1,char *eps2,char *s,char *sr,char *sname,char *ft,char *ftau,char *nrot,char *nsym,char *nsym_ns,char *nsym_na,char *t_rev,char *no_t_rev,char *time_reversal,void (*irt)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *invs,char *invsym,char *d1,char *d2,char *d3,char *allfrac,char *nofrac,char *nosym,char *nosym_evc,char *at,char *bg,char *set_accep_threshold,char *get_accep_threshold,char *set_at_bg,char *inverse_s,char *set_sym_bl,char *find_sym,char *sgam_at,char *sgam_at_mag,char *set_sym,char *copy_sym,char *is_group,char *eqvect,char *checksym,char *checkallsym,char *s_axis_to_cart,char *smallg_q) { + int i_f2py=0; + f2py_symm_base_def[i_f2py++].data = eps1; + f2py_symm_base_def[i_f2py++].data = eps2; + f2py_symm_base_def[i_f2py++].data = s; + f2py_symm_base_def[i_f2py++].data = sr; + f2py_symm_base_def[i_f2py++].data = sname; + f2py_symm_base_def[i_f2py++].data = ft; + f2py_symm_base_def[i_f2py++].data = ftau; + f2py_symm_base_def[i_f2py++].data = nrot; + f2py_symm_base_def[i_f2py++].data = nsym; + f2py_symm_base_def[i_f2py++].data = nsym_ns; + f2py_symm_base_def[i_f2py++].data = nsym_na; + f2py_symm_base_def[i_f2py++].data = t_rev; + f2py_symm_base_def[i_f2py++].data = no_t_rev; + f2py_symm_base_def[i_f2py++].data = time_reversal; + f2py_symm_base_def[i_f2py++].func = irt; + f2py_symm_base_def[i_f2py++].data = invs; + f2py_symm_base_def[i_f2py++].data = invsym; + f2py_symm_base_def[i_f2py++].data = d1; + f2py_symm_base_def[i_f2py++].data = d2; + f2py_symm_base_def[i_f2py++].data = d3; + f2py_symm_base_def[i_f2py++].data = allfrac; + f2py_symm_base_def[i_f2py++].data = nofrac; + f2py_symm_base_def[i_f2py++].data = nosym; + f2py_symm_base_def[i_f2py++].data = nosym_evc; + f2py_symm_base_def[i_f2py++].data = at; + f2py_symm_base_def[i_f2py++].data = bg; + f2py_symm_base_def[i_f2py++].data = set_accep_threshold; + f2py_symm_base_def[i_f2py++].data = get_accep_threshold; + f2py_symm_base_def[i_f2py++].data = set_at_bg; + f2py_symm_base_def[i_f2py++].data = inverse_s; + f2py_symm_base_def[i_f2py++].data = set_sym_bl; + f2py_symm_base_def[i_f2py++].data = find_sym; + f2py_symm_base_def[i_f2py++].data = sgam_at; + f2py_symm_base_def[i_f2py++].data = sgam_at_mag; + f2py_symm_base_def[i_f2py++].data = set_sym; + f2py_symm_base_def[i_f2py++].data = copy_sym; + f2py_symm_base_def[i_f2py++].data = is_group; + f2py_symm_base_def[i_f2py++].data = eqvect; + f2py_symm_base_def[i_f2py++].data = checksym; + f2py_symm_base_def[i_f2py++].data = checkallsym; + f2py_symm_base_def[i_f2py++].data = s_axis_to_cart; + f2py_symm_base_def[i_f2py++].data = smallg_q; +} +extern void F_FUNC_US(f2pyinitsymm_base,F2PYINITSYMM_BASE)(void (*)(char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_symm_base(void) { + F_FUNC_US(f2pyinitsymm_base,F2PYINITSYMM_BASE)(f2py_setup_symm_base); +} + +/*need_f90modhooks*/ + +/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ + +/******************* See f2py2e/common_rules.py: buildhooks *******************/ + +/*need_commonhooks*/ + +/**************************** See f2py2e/rules.py ****************************/ + +static FortranDataDef f2py_routine_defs[] = { + {"errore",-1,{{-1}},0,0,(char *) F_FUNC(errore,ERRORE), (f2py_init_func)f2py_rout_symph_errore,doc_f2py_rout_symph_errore}, + {"infomsg",-1,{{-1}},0,0,(char *) F_FUNC(infomsg,INFOMSG), (f2py_init_func)f2py_rout_symph_infomsg,doc_f2py_rout_symph_infomsg}, + {"get_latvec",-1,{{-1}},0,0,(char *) F_WRAPPEDFUNC_US(get_latvec,GET_LATVEC), (f2py_init_func)f2py_rout_symph_get_latvec,doc_f2py_rout_symph_get_latvec}, + {"rotate_and_add_dyn",-1,{{-1}},0,0,(char *) F_FUNC_US(rotate_and_add_dyn,ROTATE_AND_ADD_DYN), (f2py_init_func)f2py_rout_symph_rotate_and_add_dyn,doc_f2py_rout_symph_rotate_and_add_dyn}, + {"set_irotmq",-1,{{-1}},0,0,(char *) F_FUNC_US(set_irotmq,SET_IROTMQ), (f2py_init_func)f2py_rout_symph_set_irotmq,doc_f2py_rout_symph_set_irotmq}, + {"symmatrix",-1,{{-1}},0,0,(char *) F_FUNC(symmatrix,SYMMATRIX), (f2py_init_func)f2py_rout_symph_symmatrix,doc_f2py_rout_symph_symmatrix}, + {"cart_to_crys_mat",-1,{{-1}},0,0,(char *) F_FUNC_US(cart_to_crys_mat,CART_TO_CRYS_MAT), (f2py_init_func)f2py_rout_symph_cart_to_crys_mat,doc_f2py_rout_symph_cart_to_crys_mat}, + {"crys_to_cart_mat",-1,{{-1}},0,0,(char *) F_FUNC_US(crys_to_cart_mat,CRYS_TO_CART_MAT), (f2py_init_func)f2py_rout_symph_crys_to_cart_mat,doc_f2py_rout_symph_crys_to_cart_mat}, + {"contract_two_ph_propagator",-1,{{-1}},0,0,(char *) F_FUNC_US(contract_two_ph_propagator,CONTRACT_TWO_PH_PROPAGATOR), (f2py_init_func)f2py_rout_symph_contract_two_ph_propagator,doc_f2py_rout_symph_contract_two_ph_propagator}, + {"get_two_phonon_propagator",-1,{{-1}},0,0,(char *) F_FUNC_US(get_two_phonon_propagator,GET_TWO_PHONON_PROPAGATOR), (f2py_init_func)f2py_rout_symph_get_two_phonon_propagator,doc_f2py_rout_symph_get_two_phonon_propagator}, + {"fc_supercell_from_dyn",-1,{{-1}},0,0,(char *) F_FUNC_US(fc_supercell_from_dyn,FC_SUPERCELL_FROM_DYN), (f2py_init_func)f2py_rout_symph_fc_supercell_from_dyn,doc_f2py_rout_symph_fc_supercell_from_dyn}, + {"fast_ft_real_space_from_dynq",-1,{{-1}},0,0,(char *) F_FUNC_US(fast_ft_real_space_from_dynq,FAST_FT_REAL_SPACE_FROM_DYNQ), (f2py_init_func)f2py_rout_symph_fast_ft_real_space_from_dynq,doc_f2py_rout_symph_fast_ft_real_space_from_dynq}, + {"impose_trans_sc",-1,{{-1}},0,0,(char *) F_FUNC_US(impose_trans_sc,IMPOSE_TRANS_SC), (f2py_init_func)f2py_rout_symph_impose_trans_sc,doc_f2py_rout_symph_impose_trans_sc}, + {"dyn_from_fc",-1,{{-1}},0,0,(char *) F_FUNC_US(dyn_from_fc,DYN_FROM_FC), (f2py_init_func)f2py_rout_symph_dyn_from_fc,doc_f2py_rout_symph_dyn_from_fc}, + {"get_q_grid",-1,{{-1}},0,0,(char *) F_FUNC_US(get_q_grid,GET_Q_GRID), (f2py_init_func)f2py_rout_symph_get_q_grid,doc_f2py_rout_symph_get_q_grid}, + {"star_q",-1,{{-1}},0,0,(char *) F_FUNC_US(star_q,STAR_Q), (f2py_init_func)f2py_rout_symph_star_q,doc_f2py_rout_symph_star_q}, + {"symvector",-1,{{-1}},0,0,(char *) F_FUNC(symvector,SYMVECTOR), (f2py_init_func)f2py_rout_symph_symvector,doc_f2py_rout_symph_symvector}, + {"cryst_to_cart",-1,{{-1}},0,0,(char *) F_FUNC_US(cryst_to_cart,CRYST_TO_CART), (f2py_init_func)f2py_rout_symph_cryst_to_cart,doc_f2py_rout_symph_cryst_to_cart}, + {"flush_unit",-1,{{-1}},0,0,(char *) F_FUNC_US(flush_unit,FLUSH_UNIT), (f2py_init_func)f2py_rout_symph_flush_unit,doc_f2py_rout_symph_flush_unit}, + {"get_translations",-1,{{-1}},0,0,(char *) F_FUNC_US(get_translations,GET_TRANSLATIONS), (f2py_init_func)f2py_rout_symph_get_translations,doc_f2py_rout_symph_get_translations}, + {"q2qstar_out",-1,{{-1}},0,0,(char *) F_FUNC_US(q2qstar_out,Q2QSTAR_OUT), (f2py_init_func)f2py_rout_symph_q2qstar_out,doc_f2py_rout_symph_q2qstar_out}, + {"set_asr",-1,{{-1}},0,0,(char *) F_FUNC_US(set_asr,SET_ASR), (f2py_init_func)f2py_rout_symph_set_asr,doc_f2py_rout_symph_set_asr}, + {"sp_zeu",-1,{{-1}},0,0,(char *) F_FUNC_US(sp_zeu,SP_ZEU), (f2py_init_func)f2py_rout_symph_sp_zeu,doc_f2py_rout_symph_sp_zeu}, + {"sp1",-1,{{-1}},0,0,(char *) F_FUNC(sp1,SP1), (f2py_init_func)f2py_rout_symph_sp1,doc_f2py_rout_symph_sp1}, + {"sp2",-1,{{-1}},0,0,(char *) F_FUNC(sp2,SP2), (f2py_init_func)f2py_rout_symph_sp2,doc_f2py_rout_symph_sp2}, + {"sp3",-1,{{-1}},0,0,(char *) F_FUNC(sp3,SP3), (f2py_init_func)f2py_rout_symph_sp3,doc_f2py_rout_symph_sp3}, + {"symdynph_gq_new",-1,{{-1}},0,0,(char *) F_FUNC_US(symdynph_gq_new,SYMDYNPH_GQ_NEW), (f2py_init_func)f2py_rout_symph_symdynph_gq_new,doc_f2py_rout_symph_symdynph_gq_new}, + {"trntnsc",-1,{{-1}},0,0,(char *) F_FUNC(trntnsc,TRNTNSC), (f2py_init_func)f2py_rout_symph_trntnsc,doc_f2py_rout_symph_trntnsc}, + {"rgd_blk",-1,{{-1}},0,0,(char *) F_FUNC_US(rgd_blk,RGD_BLK), (f2py_init_func)f2py_rout_symph_rgd_blk,doc_f2py_rout_symph_rgd_blk}, + {"rgd_blk_diff_phase_conv",-1,{{-1}},0,0,(char *) F_FUNC_US(rgd_blk_diff_phase_conv,RGD_BLK_DIFF_PHASE_CONV), (f2py_init_func)f2py_rout_symph_rgd_blk_diff_phase_conv,doc_f2py_rout_symph_rgd_blk_diff_phase_conv}, + {"nonanal",-1,{{-1}},0,0,(char *) F_FUNC(nonanal,NONANAL), (f2py_init_func)f2py_rout_symph_nonanal,doc_f2py_rout_symph_nonanal}, + {"trasl",-1,{{-1}},0,0,(char *) F_FUNC(trasl,TRASL), (f2py_init_func)f2py_rout_symph_trasl,doc_f2py_rout_symph_trasl}, + {"frc_blk",-1,{{-1}},0,0,(char *) F_FUNC_US(frc_blk,FRC_BLK), (f2py_init_func)f2py_rout_symph_frc_blk,doc_f2py_rout_symph_frc_blk}, + {"wsinit",-1,{{-1}},0,0,(char *) F_FUNC(wsinit,WSINIT), (f2py_init_func)f2py_rout_symph_wsinit,doc_f2py_rout_symph_wsinit}, + {"wsweight",-1,{{-1}},0,0,(char *) F_WRAPPEDFUNC(wsweight,WSWEIGHT), (f2py_init_func)f2py_rout_symph_wsweight,doc_f2py_rout_symph_wsweight}, + {"get_frc",-1,{{-1}},0,0,(char *) F_FUNC_US(get_frc,GET_FRC), (f2py_init_func)f2py_rout_symph_get_frc,doc_f2py_rout_symph_get_frc}, + {"asign_supercell_index_new",-1,{{-1}},0,0,(char *) F_FUNC_US(asign_supercell_index_new,ASIGN_SUPERCELL_INDEX_NEW), (f2py_init_func)f2py_rout_symph_asign_supercell_index_new,doc_f2py_rout_symph_asign_supercell_index_new}, + {"q_gen",-1,{{-1}},0,0,(char *) F_FUNC_US(q_gen,Q_GEN), (f2py_init_func)f2py_rout_symph_q_gen,doc_f2py_rout_symph_q_gen}, + {"set_tau",-1,{{-1}},0,0,(char *) F_FUNC_US(set_tau,SET_TAU), (f2py_init_func)f2py_rout_symph_set_tau,doc_f2py_rout_symph_set_tau}, + {"threetosix_real",-1,{{-1}},0,0,(char *) F_FUNC_US(threetosix_real,THREETOSIX_REAL), (f2py_init_func)f2py_rout_symph_threetosix_real,doc_f2py_rout_symph_threetosix_real}, + {"sixtothree_real",-1,{{-1}},0,0,(char *) F_FUNC_US(sixtothree_real,SIXTOTHREE_REAL), (f2py_init_func)f2py_rout_symph_sixtothree_real,doc_f2py_rout_symph_sixtothree_real}, + {"eqvect",-1,{{-1}},0,0,(char *) F_WRAPPEDFUNC(eqvect,EQVECT), (f2py_init_func)f2py_rout_symph_eqvect,doc_f2py_rout_symph_eqvect}, + {"get_equivalent_atoms",-1,{{-1}},0,0,(char *) F_FUNC_US(get_equivalent_atoms,GET_EQUIVALENT_ATOMS), (f2py_init_func)f2py_rout_symph_get_equivalent_atoms,doc_f2py_rout_symph_get_equivalent_atoms}, + {"get_closest_vector",-1,{{-1}},0,0,(char *) F_FUNC_US(get_closest_vector,GET_CLOSEST_VECTOR), (f2py_init_func)f2py_rout_symph_get_closest_vector,doc_f2py_rout_symph_get_closest_vector}, + {"get_gr_data",-1,{{-1}},0,0,(char *) F_FUNC_US(get_gr_data,GET_GR_DATA), (f2py_init_func)f2py_rout_symph_get_gr_data,doc_f2py_rout_symph_get_gr_data}, + {"fix_coords_in_unit_cell",-1,{{-1}},0,0,(char *) F_FUNC_US(fix_coords_in_unit_cell,FIX_COORDS_IN_UNIT_CELL), (f2py_init_func)f2py_rout_symph_fix_coords_in_unit_cell,doc_f2py_rout_symph_fix_coords_in_unit_cell}, + {"matinv3",-1,{{-1}},0,0,(char *) F_FUNC(matinv3,MATINV3), (f2py_init_func)f2py_rout_symph_matinv3,doc_f2py_rout_symph_matinv3}, + {"invmat",-1,{{-1}},0,0,(char *) F_FUNC(invmat,INVMAT), (f2py_init_func)f2py_rout_symph_invmat,doc_f2py_rout_symph_invmat}, + {"recips",-1,{{-1}},0,0,(char *) F_FUNC(recips,RECIPS), (f2py_init_func)f2py_rout_symph_recips,doc_f2py_rout_symph_recips}, + {"sgam_ph_new",-1,{{-1}},0,0,(char *) F_FUNC_US(sgam_ph_new,SGAM_PH_NEW), (f2py_init_func)f2py_rout_symph_sgam_ph_new,doc_f2py_rout_symph_sgam_ph_new}, + {"get_tau_sc_latvec",-1,{{-1}},0,0,(char *) F_FUNC_US(get_tau_sc_latvec,GET_TAU_SC_LATVEC), (f2py_init_func)f2py_rout_symph_get_tau_sc_latvec,doc_f2py_rout_symph_get_tau_sc_latvec}, + {"permute_v3",-1,{{-1}},0,0,(char *) F_FUNC_US(permute_v3,PERMUTE_V3), (f2py_init_func)f2py_rout_symph_permute_v3,doc_f2py_rout_symph_permute_v3}, + {"permute_v4",-1,{{-1}},0,0,(char *) F_FUNC_US(permute_v4,PERMUTE_V4), (f2py_init_func)f2py_rout_symph_permute_v4,doc_f2py_rout_symph_permute_v4}, + {"trans_v2",-1,{{-1}},0,0,(char *) F_FUNC_US(trans_v2,TRANS_V2), (f2py_init_func)f2py_rout_symph_trans_v2,doc_f2py_rout_symph_trans_v2}, + {"trans_v3",-1,{{-1}},0,0,(char *) F_FUNC_US(trans_v3,TRANS_V3), (f2py_init_func)f2py_rout_symph_trans_v3,doc_f2py_rout_symph_trans_v3}, + {"trans_v4",-1,{{-1}},0,0,(char *) F_FUNC_US(trans_v4,TRANS_V4), (f2py_init_func)f2py_rout_symph_trans_v4,doc_f2py_rout_symph_trans_v4}, + {"sym_v2",-1,{{-1}},0,0,(char *) F_FUNC_US(sym_v2,SYM_V2), (f2py_init_func)f2py_rout_symph_sym_v2,doc_f2py_rout_symph_sym_v2}, + {"sym_v3",-1,{{-1}},0,0,(char *) F_FUNC_US(sym_v3,SYM_V3), (f2py_init_func)f2py_rout_symph_sym_v3,doc_f2py_rout_symph_sym_v3}, + {"sym_v4",-1,{{-1}},0,0,(char *) F_FUNC_US(sym_v4,SYM_V4), (f2py_init_func)f2py_rout_symph_sym_v4,doc_f2py_rout_symph_sym_v4}, + {"print_symm",-1,{{-1}},0,0,(char *) F_FUNC_US(print_symm,PRINT_SYMM), (f2py_init_func)f2py_rout_symph_print_symm,doc_f2py_rout_symph_print_symm}, + +/*eof routine_defs*/ + {NULL} +}; + +static PyMethodDef f2py_module_methods[] = { + + {NULL,NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "symph", + NULL, + -1, + f2py_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit_symph(void) { + int i; + PyObject *m,*d, *s, *tmp; + m = symph_module = PyModule_Create(&moduledef); + Py_SET_TYPE(&PyFortran_Type, &PyType_Type); + import_array(); + if (PyErr_Occurred()) + {PyErr_SetString(PyExc_ImportError, "can't initialize module symph (failed to import numpy)"); return m;} + d = PyModule_GetDict(m); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + s = PyUnicode_FromString( + "This module 'symph' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" +" errore(calling_routine,message,ierr)\n" +" infomsg(routine,message)\n" +" latvec = get_latvec(tau_sc,tau,itau,nr,nat=shape(tau, 1),nat_sc=shape(tau_sc, 1))\n" +" phi2 = rotate_and_add_dyn(phi,isym,s,invs,irt,rtau,sxq,nat=shape(phi, 2))\n" +" irotmq = set_irotmq(xq,s,nsymq,nsym,minus_q,bg,at,lgamma)\n" +" symmatrix(matr,s,nsym,at,bg)\n" +" cart_to_crys_mat(matr,at)\n" +" crys_to_cart_mat(matr,bg)\n" +" f_output = contract_two_ph_propagator(w_array,w_mu,t,smearing,m,n_w=shape(w_array, 0),n_modes=shape(w_mu, 0))\n" +" chi = get_two_phonon_propagator(w_value,ws,t,smearing,n_w=shape(ws, 0))\n" +" phitot_sc = fc_supercell_from_dyn(phitot,q,tau,tau_sc,itau,nat=shape(phitot, 3),nq=shape(phitot, 0))\n" +" fc_supercell = fast_ft_real_space_from_dynq(unit_cell_coords,super_cell_coords,itau,q_tot,dynq,nat=shape(unit_cell_coords, 0),nat_sc=shape(super_cell_coords, 0),nq=shape(q_tot, 0))\n" +" impose_trans_sc(fc_sc,tau_sc_cryst,itau,nat_sc=shape(fc_sc, 2))\n" +" dyn = dyn_from_fc(phitot_sc,q,tau,tau_sc,itau,nq,nat)\n" +" q_list = get_q_grid(bg,supercell_size,n_size)\n" +" nq,sxq,isq,imq = star_q(xq,at,bg,nsym,s,invs,verbosity)\n" +" symvector(nsym,irt,s,at,bg,vect,nat=shape(irt, 1))\n" +" cryst_to_cart(vec,trmat,iflag,nvec=shape(vec, 1))\n" +" flush_unit(unit_tobeflushed)\n" +" trans = get_translations(pols,masses,nmod=shape(pols, 1),nat=shape(pols, 0) / 3)\n" +" dynqstar = q2qstar_out(dyn,at,bg,nsym,s,invs,irt,rtau,nq,sxq,isq,imq,nqtot,nat=shape(dyn, 0) / 3)\n" +" set_asr(asr,axis,tau,dyn,zeu,nat=shape(tau, 1))\n" +" sp_zeu(zeu_u,zeu_v,scal,nat=shape(zeu_u, 2))\n" +" sp1(u,v,scal,nat=shape(u, 2))\n" +" sp2(u,v,ind_v,scal,nat=shape(u, 2))\n" +" sp3(u,v,i,na,scal,nat=shape(u, 2))\n" +" symdynph_gq_new(xq,phi,s,invs,rtau,irt,irotmq,minus_q,nsymq,nat=shape(phi, 2))\n" +" trntnsc(phi,at,bg,iflg)\n" +" rgd_blk(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,nat=shape(dyn, 2))\n" +" rgd_blk_diff_phase_conv(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,nat=shape(dyn, 2))\n" +" nonanal(itau_blk,epsil,q,zeu,omega,dyn,nat=shape(itau_blk, 0),nat_blk=shape(zeu, 2))\n" +" phid = trasl(phiq,nq,nr1,nr2,nr3,m1,m2,m3,nat=shape(phiq, 2))\n" +" dyn = frc_blk(q,tau,frc,at,rws,nrws,nat=shape(tau, 1),nr1=shape(frc, 0),nr2=shape(frc, 1),nr3=shape(frc, 2),nrwsx=shape(rws, 1))\n" +" nrws = wsinit(rws,atw,nrwsx=shape(rws, 1))\n" +" wsweight = wsweight(r,rws,nrws,nrwsx=shape(rws, 1))\n" +" frc = get_frc(phi_sc,tau,tau_sc,at,itau,size1,size2,size3,nat=shape(tau, 1),natsc=shape(phi_sc, 2))\n" +" l,m,n = asign_supercell_index_new(vect,at)\n" +" qbid = q_gen(nsc,at_blk,bg_blk,at,bg)\n" +" set_tau(at,at_blk,tau,tau_blk,ityp,ityp_blk,itau_blk,nat=shape(tau, 1),nat_blk=shape(tau_blk, 1))\n" +" mat6 = threetosix_real(mat3,nat=shape(mat3, 0) / 3)\n" +" mat3 = sixtothree_real(mat6,nat=shape(mat6, 0))\n" +" eqvect = eqvect(x,y,f)\n" +" eq_atoms = get_equivalent_atoms(coords1,coords2,unit_cell,ityp1,ityp2,nat=shape(coords1, 0))\n" +" new_v_dist = get_closest_vector(unit_cell,v_dist)\n" +" r_value,gr = get_gr_data(cells,coords,ityp,type1,type2,r_min,r_max,n_r,n_structs=shape(cells, 0),nat=shape(coords, 1))\n" +" new_coords = fix_coords_in_unit_cell(coords,unit_cell,nat=shape(coords, 0))\n" +" b = matinv3(a)\n" +" a_inv = invmat(a,n=shape(a, 0))\n" +" b1,b2,b3 = recips(a1,a2,a3)\n" +" rtau = sgam_ph_new(at,bg,nsym,s,irt,tau,nat=shape(irt, 1))\n" +" tau_sc_latvec = get_tau_sc_latvec(tau_sc,latvec,at_sc,nat_sc=shape(tau_sc, 1),nr=shape(latvec, 0))\n" +" permute_v3(v3,n=shape(v3, 0))\n" +" permute_v4(v4,n=shape(v4, 0))\n" +" trans_v2(v2,tau_sc_latvec,nat_sc=shape(v2, 2),nr=shape(tau_sc_latvec, 1))\n" +" trans_v3(v3,tau_sc_latvec,nat_sc=shape(v3, 0) / 3,nr=shape(tau_sc_latvec, 1))\n" +" trans_v4(v4,tau_sc_latvec,nat_sc=shape(v4, 0) / 3,nr=shape(tau_sc_latvec, 1))\n" +" sym_v2(v2,at_sc,bg_sc,s,irt,nsym,nat_sc=shape(v2, 2))\n" +" sym_v3(v3,at_sc,s,irt,nsym,nat_sc=shape(v3, 0) / 3)\n" +" sym_v4(v4,at_sc,s,irt,nsym,nat_sc=shape(v4, 0) / 3)\n" +" print_symm(s,nsym,irt,supercell,nat=shape(irt, 1))\n" +"Fortran 90/95 modules:\n"" constants --- pi,tpi,fpi,sqrtpi,sqrtpm1,sqrt2,h_planck_si,k_boltzmann_si,electron_si,electronvolt_si,electronmass_si,hartree_si,rydberg_si,bohr_radius_si,amu_si,c_si,munought_si,epsnought_si,k_boltzmann_au,k_boltzmann_ry,autoev,rytoev,amu_au,amu_ry,au_sec,au_ps,au_gpa,ry_kbar,debye_si,au_debye,ev_to_kelvin,ry_to_kelvin,evtonm,rytonm,c_au,eps4,eps6,eps8,eps12,eps14,eps16,eps24,eps32,gsmall,e2,degspin,bohr_radius_cm,bohr_radius_angs,angstrom_au,dip_debye,au_terahertz,au_to_ohmcmm1,ry_to_thz,ry_to_ghz,ry_to_cmm1,avogadro"" io_global --- stdout,ionode,ionode_id,meta_ionode,meta_ionode_id,xmlinputunit,xmloutputunit,xmltmpunit,io_global_start(),meta_io_global_start(),io_global_getionode(),io_global_getmeta()"" kinds --- dp,sgl,i4b,print_kind_info()"" symm_base --- eps1,eps2,s,sr,sname,ft,ftau,nrot,nsym,nsym_ns,nsym_na,t_rev,no_t_rev,time_reversal,irt,invs,invsym,d1,d2,d3,allfrac,nofrac,nosym,nosym_evc,at,bg,set_accep_threshold(),get_accep_threshold(),set_at_bg(),inverse_s(),set_sym_bl(),find_sym(),sgam_at(),sgam_at_mag(),set_sym(),copy_sym(),is_group(),eqvect(),checksym(),checkallsym(),s_axis_to_cart(),smallg_q()""."); + PyDict_SetItemString(d, "__doc__", s); + Py_DECREF(s); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__f2py_numpy_version__", s); + Py_DECREF(s); + symph_error = PyErr_NewException ("symph.error", NULL, NULL); + /* + * Store the error object inside the dict, so that it could get deallocated. + * (in practice, this is a module, so it likely will not and cannot.) + */ + PyDict_SetItemString(d, "_symph_error", symph_error); + Py_DECREF(symph_error); + for(i=0;f2py_routine_defs[i].name!=NULL;i++) { + tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); + PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); + Py_DECREF(tmp); + } + + + + { + extern void F_FUNC_US(get_latvec,GET_LATVEC)(void); + PyObject* o = PyDict_GetItemString(d,"get_latvec"); + tmp = F2PyCapsule_FromVoidPtr((void*)F_FUNC_US(get_latvec,GET_LATVEC),NULL); + PyObject_SetAttrString(o,"_cpointer", tmp); + Py_DECREF(tmp); + s = PyUnicode_FromString("get_latvec"); + PyObject_SetAttrString(o,"__name__", s); + Py_DECREF(s); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + extern double F_FUNC(wsweight,WSWEIGHT)(void); + PyObject* o = PyDict_GetItemString(d,"wsweight"); + tmp = F2PyCapsule_FromVoidPtr((void*)F_FUNC(wsweight,WSWEIGHT),NULL); + PyObject_SetAttrString(o,"_cpointer", tmp); + Py_DECREF(tmp); + s = PyUnicode_FromString("wsweight"); + PyObject_SetAttrString(o,"__name__", s); + Py_DECREF(s); + } + + + + + + + + + { + extern int F_FUNC(eqvect,EQVECT)(void); + PyObject* o = PyDict_GetItemString(d,"eqvect"); + tmp = F2PyCapsule_FromVoidPtr((void*)F_FUNC(eqvect,EQVECT),NULL); + PyObject_SetAttrString(o,"_cpointer", tmp); + Py_DECREF(tmp); + s = PyUnicode_FromString("eqvect"); + PyObject_SetAttrString(o,"__name__", s); + Py_DECREF(s); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*eof initf2pywraphooks*/ + PyDict_SetItemString(d, "symm_base", PyFortranObject_New(f2py_symm_base_def,f2py_init_symm_base)); + PyDict_SetItemString(d, "kinds", PyFortranObject_New(f2py_kinds_def,f2py_init_kinds)); + PyDict_SetItemString(d, "io_global", PyFortranObject_New(f2py_io_global_def,f2py_init_io_global)); + PyDict_SetItemString(d, "constants", PyFortranObject_New(f2py_constants_def,f2py_init_constants)); +/*eof initf90modhooks*/ + +/*eof initcommonhooks*/ + + +#ifdef F2PY_REPORT_ATEXIT + if (! PyErr_Occurred()) + on_exit(f2py_report_on_exit,(void*)"symph"); +#endif + return m; +} +#ifdef __cplusplus +} +#endif diff --git a/f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 b/f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 new file mode 100644 index 00000000..0e00b066 --- /dev/null +++ b/f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 @@ -0,0 +1,400 @@ +! -*- f90 -*- +! This file is autogenerated with f2py (version:1.26.4) +! It contains Fortran 90 wrappers to fortran functions. + + subroutine f2pywrap_get_lf_vec_dot_mat (vec_dot_matf2pywrap, v1, m& + &1, f2py_v1_d0, f2py_m1_d0, f2py_m1_d1) + use get_lf, only : vec_dot_mat + integer f2py_v1_d0 + integer f2py_m1_d0 + integer f2py_m1_d1 + real(kind=8) v1(f2py_v1_d0) + real(kind=8) m1(f2py_m1_d0,f2py_m1_d1) + real(kind=8) vec_dot_matf2pywrap(size(v1)) + vec_dot_matf2pywrap = vec_dot_mat(v1, m1) + end subroutine f2pywrap_get_lf_vec_dot_mat + subroutine f2pywrap_get_lf_inv (invf2pywrap, a, f2py_a_d0, f2py_a_& + &d1) + use get_lf, only : inv + integer f2py_a_d0 + integer f2py_a_d1 + real(kind=8) a(f2py_a_d0,f2py_a_d1) + real(kind=8) invf2pywrap(size(a, 1),size(a, 2)) + invf2pywrap = inv(a) + end subroutine f2pywrap_get_lf_inv + + subroutine f2pyinitget_lf(f2pysetupfunc) + use get_lf, only : calculate_lineshapes + use get_lf, only : calculate_lineshapes_mode_mixing + use get_lf, only : calculate_lineshapes_cartesian + use get_lf, only : calculate_lifetimes_selfconsistently + use get_lf, only : solve_selfconsistent_equation + use get_lf, only : calculate_correlation_function + use get_lf, only : calculate_lifetimes_perturbative + use get_lf, only : calculate_lifetimes + use get_lf, only : calculate_self_energy_la + use get_lf, only : calculate_self_energy_p + use get_lf, only : calculate_self_energy_full + use get_lf, only : check_if_gamma + use get_lf, only : calculate_real_part_via_kramers_kronig + use get_lf, only : calculate_real_part_via_kramers_kronig_2d + use get_lf, only : hilbert_transform_via_fft + use get_lf, only : ht + use get_lf, only : cfft + use get_lf, only : interpolate_fc2 + interface + subroutine f2pywrap_get_lf_vec_dot_mat (vec_dot_matf2pywrap, v1, m& + &1, f2py_v1_d0, f2py_m1_d0, f2py_m1_d1) + integer f2py_v1_d0 + integer f2py_m1_d0 + integer f2py_m1_d1 + real(kind=8) v1(f2py_v1_d0) + real(kind=8) m1(f2py_m1_d0,f2py_m1_d1) + real(kind=8) vec_dot_matf2pywrap(size(v1)) + end subroutine f2pywrap_get_lf_vec_dot_mat + subroutine f2pywrap_get_lf_inv (invf2pywrap, a, f2py_a_d0, f2py_a_& + &d1) + integer f2py_a_d0 + integer f2py_a_d1 + real(kind=8) a(f2py_a_d0,f2py_a_d1) + real(kind=8) invf2pywrap(size(a, 1),size(a, 2)) + end subroutine f2pywrap_get_lf_inv + end interface + external f2pysetupfunc + call f2pysetupfunc(calculate_lineshapes,calculate_lineshapes_mode_& + &mixing,calculate_lineshapes_cartesian,calculate_lifetimes_selfcons& + &istently,solve_selfconsistent_equation,calculate_correlation_funct& + &ion,calculate_lifetimes_perturbative,calculate_lifetimes,calculate& + &_self_energy_la,calculate_self_energy_p,calculate_self_energy_full& + &,check_if_gamma,f2pywrap_get_lf_vec_dot_mat,calculate_real_part_vi& + &a_kramers_kronig,calculate_real_part_via_kramers_kronig_2d,hilbert& + &_transform_via_fft,ht,cfft,f2pywrap_get_lf_inv,interpolate_fc2) + end subroutine f2pyinitget_lf + + subroutine f2pywrap_scattering_grids_same_vector (same_vectorf2pyw& + &rap, v1, v2) + use scattering_grids, only : same_vector + real(kind=8) v1(3) + real(kind=8) v2(3) + logical same_vectorf2pywrap + same_vectorf2pywrap = .not.(.not.same_vector(v1, v2)) + end subroutine f2pywrap_scattering_grids_same_vector + subroutine f2pywrap_scattering_grids_same_vector_nopbc (same_vecto& + &r_nopbcf2pywrap, v1, v2) + use scattering_grids, only : same_vector_nopbc + real(kind=8) v1(3) + real(kind=8) v2(3) + logical same_vector_nopbcf2pywrap + same_vector_nopbcf2pywrap = .not.(.not.same_vector_nopbc(v1, v2)) + end subroutine f2pywrap_scattering_grids_same_vector_nopbc + + subroutine f2pyinitscattering_grids(f2pysetupfunc) + use scattering_grids, only : get_scattering_q_grid + interface + subroutine f2pywrap_scattering_grids_same_vector (same_vectorf2pyw& + &rap, v1, v2) + real(kind=8) v1(3) + real(kind=8) v2(3) + logical same_vectorf2pywrap + end subroutine f2pywrap_scattering_grids_same_vector + subroutine f2pywrap_scattering_grids_same_vector_nopbc (same_vecto& + &r_nopbcf2pywrap, v1, v2) + real(kind=8) v1(3) + real(kind=8) v2(3) + logical same_vector_nopbcf2pywrap + end subroutine f2pywrap_scattering_grids_same_vector_nopbc + end interface + external f2pysetupfunc + call f2pysetupfunc(get_scattering_q_grid,f2pywrap_scattering_grids& + &_same_vector,f2pywrap_scattering_grids_same_vector_nopbc) + end subroutine f2pyinitscattering_grids + + subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& + &f2pywrap, v1, v2, v3, d1, d2, d3, tol) + use third_order_centering, only : within_dmax + real(kind=8) d1 + real(kind=8) d2 + real(kind=8) d3 + real(kind=8) tol + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + logical within_dmaxf2pywrap + within_dmaxf2pywrap = .not.(.not.within_dmax(v1, v2, v3, d1, d2, d& + &3, tol)) + end subroutine f2pywrap_third_order_centering_within_dmax + subroutine f2pywrap_third_order_centering_compute_perimeter (compu& + &te_perimeterf2pywrap, v1, v2, v3) + use third_order_centering, only : compute_perimeter + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + real(kind=8) compute_perimeterf2pywrap + compute_perimeterf2pywrap = compute_perimeter(v1, v2, v3) + end subroutine f2pywrap_third_order_centering_compute_perimeter + subroutine f2pywrap_third_order_centering_three_to_one_len (three_& + &to_one_lenf2pywrap, v, v_min, v_len) + use third_order_centering, only : three_to_one_len + integer v(3) + integer v_min(3) + integer v_len(3) + integer three_to_one_lenf2pywrap + three_to_one_lenf2pywrap = three_to_one_len(v, v_min, v_len) + end subroutine f2pywrap_third_order_centering_three_to_one_len + subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& + &nef2pywrap, v, v_min, v_max) + use third_order_centering, only : three_to_one + integer v(3) + integer v_min(3) + integer v_max(3) + integer three_to_onef2pywrap + three_to_onef2pywrap = three_to_one(v, v_min, v_max) + end subroutine f2pywrap_third_order_centering_three_to_one + subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& + &_three_lenf2pywrap, j, v_min, v_len) + use third_order_centering, only : one_to_three_len + integer j + integer v_min(3) + integer v_len(3) + integer one_to_three_lenf2pywrap(3) + one_to_three_lenf2pywrap = one_to_three_len(j, v_min, v_len) + end subroutine f2pywrap_third_order_centering_one_to_three_len + subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& + &eef2pywrap, j, v_min, v_max) + use third_order_centering, only : one_to_three + integer j + integer v_min(3) + integer v_max(3) + integer one_to_threef2pywrap(3) + one_to_threef2pywrap = one_to_three(j, v_min, v_max) + end subroutine f2pywrap_third_order_centering_one_to_three + subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& + &se_2f2pywrap, a, b) + use third_order_centering, only : min_el_wise_2 + integer a(3) + integer b(3) + integer min_el_wise_2f2pywrap(3) + min_el_wise_2f2pywrap = min_el_wise_2(a, b) + end subroutine f2pywrap_third_order_centering_min_el_wise_2 + subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& + &se_2f2pywrap, a, b) + use third_order_centering, only : max_el_wise_2 + integer a(3) + integer b(3) + integer max_el_wise_2f2pywrap(3) + max_el_wise_2f2pywrap = max_el_wise_2(a, b) + end subroutine f2pywrap_third_order_centering_max_el_wise_2 + subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& + &se_3f2pywrap, a, b, c) + use third_order_centering, only : min_el_wise_3 + integer a(3) + integer b(3) + integer c(3) + integer min_el_wise_3f2pywrap(3) + min_el_wise_3f2pywrap = min_el_wise_3(a, b, c) + end subroutine f2pywrap_third_order_centering_min_el_wise_3 + subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& + &se_3f2pywrap, a, b, c) + use third_order_centering, only : max_el_wise_3 + integer a(3) + integer b(3) + integer c(3) + integer max_el_wise_3f2pywrap(3) + max_el_wise_3f2pywrap = max_el_wise_3(a, b, c) + end subroutine f2pywrap_third_order_centering_max_el_wise_3 + subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& + &cartf2pywrap, v, alat) + use third_order_centering, only : cryst_to_cart + integer v(3) + real(kind=8) alat(3,3) + real(kind=8) cryst_to_cartf2pywrap(3) + cryst_to_cartf2pywrap = cryst_to_cart(v, alat) + end subroutine f2pywrap_third_order_centering_cryst_to_cart + + subroutine f2pyinitthird_order_centering(f2pysetupfunc) + use third_order_centering, only : analysis + use third_order_centering, only : center + use third_order_centering, only : center_sparse + use third_order_centering, only : pre_center + use third_order_centering, only : assign + interface + subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& + &f2pywrap, v1, v2, v3, d1, d2, d3, tol) + real(kind=8) d1 + real(kind=8) d2 + real(kind=8) d3 + real(kind=8) tol + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + logical within_dmaxf2pywrap + end subroutine f2pywrap_third_order_centering_within_dmax + subroutine f2pywrap_third_order_centering_compute_perimeter (compu& + &te_perimeterf2pywrap, v1, v2, v3) + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + real(kind=8) compute_perimeterf2pywrap + end subroutine f2pywrap_third_order_centering_compute_perimeter + subroutine f2pywrap_third_order_centering_three_to_one_len (three_& + &to_one_lenf2pywrap, v, v_min, v_len) + integer v(3) + integer v_min(3) + integer v_len(3) + integer three_to_one_lenf2pywrap + end subroutine f2pywrap_third_order_centering_three_to_one_len + subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& + &nef2pywrap, v, v_min, v_max) + integer v(3) + integer v_min(3) + integer v_max(3) + integer three_to_onef2pywrap + end subroutine f2pywrap_third_order_centering_three_to_one + subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& + &_three_lenf2pywrap, j, v_min, v_len) + integer j + integer v_min(3) + integer v_len(3) + integer one_to_three_lenf2pywrap(3) + end subroutine f2pywrap_third_order_centering_one_to_three_len + subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& + &eef2pywrap, j, v_min, v_max) + integer j + integer v_min(3) + integer v_max(3) + integer one_to_threef2pywrap(3) + end subroutine f2pywrap_third_order_centering_one_to_three + subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& + &se_2f2pywrap, a, b) + integer a(3) + integer b(3) + integer min_el_wise_2f2pywrap(3) + end subroutine f2pywrap_third_order_centering_min_el_wise_2 + subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& + &se_2f2pywrap, a, b) + integer a(3) + integer b(3) + integer max_el_wise_2f2pywrap(3) + end subroutine f2pywrap_third_order_centering_max_el_wise_2 + subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& + &se_3f2pywrap, a, b, c) + integer a(3) + integer b(3) + integer c(3) + integer min_el_wise_3f2pywrap(3) + end subroutine f2pywrap_third_order_centering_min_el_wise_3 + subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& + &se_3f2pywrap, a, b, c) + integer a(3) + integer b(3) + integer c(3) + integer max_el_wise_3f2pywrap(3) + end subroutine f2pywrap_third_order_centering_max_el_wise_3 + subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& + &cartf2pywrap, v, alat) + integer v(3) + real(kind=8) alat(3,3) + real(kind=8) cryst_to_cartf2pywrap(3) + end subroutine f2pywrap_third_order_centering_cryst_to_cart + end interface + external f2pysetupfunc + call f2pysetupfunc(analysis,center,center_sparse,pre_center,assign& + &,f2pywrap_third_order_centering_within_dmax,f2pywrap_third_order_c& + &entering_compute_perimeter,f2pywrap_third_order_centering_three_to& + &_one_len,f2pywrap_third_order_centering_three_to_one,f2pywrap_thir& + &d_order_centering_one_to_three_len,f2pywrap_third_order_centering_& + &one_to_three,f2pywrap_third_order_centering_min_el_wise_2,f2pywrap& + &_third_order_centering_max_el_wise_2,f2pywrap_third_order_centerin& + &g_min_el_wise_3,f2pywrap_third_order_centering_max_el_wise_3,f2pyw& + &rap_third_order_centering_cryst_to_cart) + end subroutine f2pyinitthird_order_centering + + subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& + & t) + use third_order_cond, only : f_bose + real(kind=8) freq + real(kind=8) t + real(kind=8) f_bosef2pywrap + f_bosef2pywrap = f_bose(freq, t) + end subroutine f2pywrap_third_order_cond_f_bose + subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& + &q, t) + use third_order_cond, only : df_bose + real(kind=8) freq + real(kind=8) t + real(kind=8) df_bosef2pywrap + df_bosef2pywrap = df_bose(freq, t) + end subroutine f2pywrap_third_order_cond_df_bose + subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& + &unctionf2pywrap, x, sigma) + use third_order_cond, only : gaussian_function + real(kind=8) x + real(kind=8) sigma + real(kind=8) gaussian_functionf2pywrap + gaussian_functionf2pywrap = gaussian_function(x, sigma) + end subroutine f2pywrap_third_order_cond_gaussian_function + subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& + &_d0, f2py_a_d1) + use third_order_cond, only : cinv + integer f2py_a_d0 + integer f2py_a_d1 + complex(kind=8) a(f2py_a_d0,f2py_a_d1) + complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) + cinvf2pywrap = cinv(a) + end subroutine f2pywrap_third_order_cond_cinv + + subroutine f2pyinitthird_order_cond(f2pysetupfunc) + use third_order_cond, only : interpol_v2 + use third_order_cond, only : interpol_v3 + use third_order_cond, only : compute_full_dynamic_bubble_single + use third_order_cond, only : compute_diag_dynamic_bubble_single + use third_order_cond, only : compute_perturb_selfnrg_single + use third_order_cond, only : compute_spectralf_diag_single + use third_order_cond, only : lambda_dynamic_single + use third_order_cond, only : lambda_dynamic_value_single + use third_order_cond, only : calculate_spectral_function + use third_order_cond, only : calculate_spectral_function_mode_mixi& + &ng + use third_order_cond, only : calculate_spectral_function_cartesian + use third_order_cond, only : bose_freq + use third_order_cond, only : eq_freq + use third_order_cond, only : eliminate_transl + interface + subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& + & t) + real(kind=8) freq + real(kind=8) t + real(kind=8) f_bosef2pywrap + end subroutine f2pywrap_third_order_cond_f_bose + subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& + &q, t) + real(kind=8) freq + real(kind=8) t + real(kind=8) df_bosef2pywrap + end subroutine f2pywrap_third_order_cond_df_bose + subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& + &unctionf2pywrap, x, sigma) + real(kind=8) x + real(kind=8) sigma + real(kind=8) gaussian_functionf2pywrap + end subroutine f2pywrap_third_order_cond_gaussian_function + subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& + &_d0, f2py_a_d1) + integer f2py_a_d0 + integer f2py_a_d1 + complex(kind=8) a(f2py_a_d0,f2py_a_d1) + complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) + end subroutine f2pywrap_third_order_cond_cinv + end interface + external f2pysetupfunc + call f2pysetupfunc(interpol_v2,interpol_v3,compute_full_dynamic_bu& + &bble_single,compute_diag_dynamic_bubble_single,compute_perturb_sel& + &fnrg_single,compute_spectralf_diag_single,lambda_dynamic_single,la& + &mbda_dynamic_value_single,calculate_spectral_function,calculate_sp& + &ectral_function_mode_mixing,calculate_spectral_function_cartesian,& + &bose_freq,eq_freq,f2pywrap_third_order_cond_f_bose,f2pywrap_third_& + &order_cond_df_bose,f2pywrap_third_order_cond_gaussian_function,eli& + &minate_transl,f2pywrap_third_order_cond_cinv) + end subroutine f2pyinitthird_order_cond + + diff --git a/f2py_wrappers/thermal_conductivitymodule.c b/f2py_wrappers/thermal_conductivitymodule.c new file mode 100644 index 00000000..ecd7a3e0 --- /dev/null +++ b/f2py_wrappers/thermal_conductivitymodule.c @@ -0,0 +1,13977 @@ +/* File: thermal_conductivitymodule.c + * This file is auto-generated with f2py (version:1.26.4). + * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, + * written by Pearu Peterson . + * Generation date: Fri Sep 12 13:28:40 2025 + * Do not edit this file directly unless you know what you are doing!!! + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ + +/* Unconditionally included */ +#include +#include + +/*********************** See f2py2e/cfuncs.py: includes ***********************/ +#include "fortranobject.h" +#include + +/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ +static PyObject *thermal_conductivity_error; +static PyObject *thermal_conductivity_module; + +/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ +typedef struct {double r,i;} complex_double; + +/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ +/*need_typedefs_generated*/ + +/********************** See f2py2e/cfuncs.py: cppmacros **********************/ + +/* See fortranobject.h for definitions. The macros here are provided for BC. */ +#define rank f2py_rank +#define shape f2py_shape +#define fshape f2py_shape +#define len f2py_len +#define flen f2py_flen +#define slen f2py_slen +#define size f2py_size + + +#define CHECKSCALAR(check,tcheck,name,show,var)\ + if (!(check)) {\ + char errstring[256];\ + sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ + PyErr_SetString(thermal_conductivity_error,errstring);\ + /*goto capi_fail;*/\ + } else + +#ifdef DEBUGCFUNCS +#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); +#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ + PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ + fprintf(stderr,"\n"); +#else +#define CFUNCSMESS(mess) +#define CFUNCSMESSPY(mess,obj) +#endif + + +#ifndef max +#define max(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) ((a < b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef MIN +#define MIN(a,b) ((a < b) ? (a) : (b)) +#endif + + +#define CHECKARRAY(check,tcheck,name) \ + if (!(check)) {\ + PyErr_SetString(thermal_conductivity_error,"("tcheck") failed for "name);\ + /*goto capi_fail;*/\ + } else + +#define pyobj_from_complex_double1(v) (PyComplex_FromDoubles(v.r,v.i)) + +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F +#else +#define F_FUNC(f,F) _##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F##_ +#else +#define F_FUNC(f,F) _##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F +#else +#define F_FUNC(f,F) f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F##_ +#else +#define F_FUNC(f,F) f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) +#else +#define F_FUNC_US(f,F) F_FUNC(f,F) +#endif + + +/************************ See f2py2e/cfuncs.py: cfuncs ************************/ + +static int +double_from_pyobj(double* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + if (PyFloat_Check(obj)) { + *v = PyFloat_AsDouble(obj); + return !(*v == -1.0 && PyErr_Occurred()); + } + + tmp = PyNumber_Float(obj); + if (tmp) { + *v = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return !(*v == -1.0 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} + Py_DECREF(tmp); + } + { + PyObject* err = PyErr_Occurred(); + if (err==NULL) err = thermal_conductivity_error; + PyErr_SetString(err,errmess); + } + return 0; +} + + +static int +int_from_pyobj(int* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + + if (PyLong_Check(obj)) { + *v = Npy__PyLong_AsInt(obj); + return !(*v == -1 && PyErr_Occurred()); + } + + tmp = PyNumber_Long(obj); + if (tmp) { + *v = Npy__PyLong_AsInt(tmp); + Py_DECREF(tmp); + return !(*v == -1 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (int_from_pyobj(v, tmp, errmess)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + + { + PyObject* err = PyErr_Occurred(); + if (err == NULL) { + err = thermal_conductivity_error; + } + PyErr_SetString(err, errmess); + } + return 0; +} + + +/********************* See f2py2e/cfuncs.py: userincludes *********************/ +/*need_userincludes*/ + +/********************* See f2py2e/capi_rules.py: usercode *********************/ + + +/* See f2py2e/rules.py */ +/*eof externroutines*/ + +/******************** See f2py2e/capi_rules.py: usercode1 ********************/ + + +/******************* See f2py2e/cb_rules.py: buildcallback *******************/ +/*need_callbacks*/ + +/*********************** See f2py2e/rules.py: buildapi ***********************/ + +/**************************** calculate_lineshapes ****************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes[] = "\ +lineshapes = calculate_lineshapes(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lineshapes``.\ +\n\nParameters\n----------\n" +"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" +"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" +"weights : input rank-1 array('i') with bounds (n_events)\n" +"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"rprim : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"t : input float\n" +"gaussian : input int\n" +"classical : input int\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"n_events : input int, optional\n Default: shape(qgrid, 1)\n" +"\nReturns\n-------\n" +"lineshapes : rank-3 array('d') with bounds (nirrqpt,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + int *scatt_events = NULL; + npy_intp scatt_events_Dims[1] = {-1}; + const int scatt_events_Rank = 1; + PyArrayObject *capi_scatt_events_as_array = NULL; + int capi_scatt_events_intent = 0; + PyObject *scatt_events_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *rprim = NULL; + npy_intp rprim_Dims[2] = {-1, -1}; + const int rprim_Rank = 2; + PyArrayObject *capi_rprim_as_array = NULL; + int capi_rprim_intent = 0; + PyObject *rprim_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[2] = {-1, -1}; + const int smear_Rank = 2; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double *smear_id = NULL; + npy_intp smear_id_Dims[2] = {-1, -1}; + const int smear_id_Rank = 2; + PyArrayObject *capi_smear_id_as_array = NULL; + int capi_smear_id_intent = 0; + PyObject *smear_id_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int n_events = 0; + PyObject *n_events_capi = Py_None; + double *lineshapes = NULL; + npy_intp lineshapes_Dims[3] = {-1, -1, -1}; + const int lineshapes_Rank = 3; + PyArrayObject *capi_lineshapes_as_array = NULL; + int capi_lineshapes_intent = 0; + static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lineshapes",\ + capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable irrqgrid */ + irrqgrid_Dims[0]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 1st argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 2nd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 5th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable rprim */ + rprim_Dims[0]=3,rprim_Dims[1]=3; + capi_rprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 10th argument `rprim`"; + capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); + if (capi_rprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 18th argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 15th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 2nd keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lineshapes:nirrqpt=%d",nirrqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 3rd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lineshapes:nat=%d",nat) { + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 4th keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lineshapes:nfc2=%d",nfc2) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lineshapes:ne=%d",ne) { + /* Processing variable n_events */ + if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 6th keyword (n_events) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lineshapes:n_events=%d",n_events) { + /* Processing variable weights */ + weights_Dims[0]=n_events; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 3rd argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable scatt_events */ + scatt_events_Dims[0]=nirrqpt; + capi_scatt_events_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 4th argument `scatt_events`"; + capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); + if (capi_scatt_events_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 7th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 6th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 11st argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 12nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 13rd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable smear_id */ + smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; + capi_smear_id_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 14th argument `smear_id`"; + capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); + if (capi_smear_id_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); + + /* Processing variable lineshapes */ + lineshapes_Dims[0]=nirrqpt,lineshapes_Dims[1]=3 * nat,lineshapes_Dims[2]=ne; + capi_lineshapes_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the hidden `lineshapes`"; + capi_lineshapes_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,lineshapes_Dims,lineshapes_Rank, capi_lineshapes_intent,Py_None,capi_errmess); + if (capi_lineshapes_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lineshapes = (double *)(PyArray_DATA(capi_lineshapes_as_array)); + + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 5th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lineshapes:nfc3=%d",nfc3) { + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 8th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 9th argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,lineshapes); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lineshapes_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /* if (capi_lineshapes_as_array == NULL) ... else of lineshapes */ + /* End of cleaning variable lineshapes */ + if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { + Py_XDECREF(capi_smear_id_as_array); } + } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ + /* End of cleaning variable smear_id */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { + Py_XDECREF(capi_scatt_events_as_array); } + } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ + /* End of cleaning variable scatt_events */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ + } /*if (f2py_success) of n_events*/ + /* End of cleaning variable n_events */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_rprim_as_array!=rprim_capi) { + Py_XDECREF(capi_rprim_as_array); } + } /* if (capi_rprim_as_array == NULL) ... else of rprim */ + /* End of cleaning variable rprim */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of calculate_lineshapes ************************/ + +/********************** calculate_lineshapes_mode_mixing **********************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing[] = "\ +lineshapes = calculate_lineshapes_mode_mixing(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lineshapes_mode_mixing``.\ +\n\nParameters\n----------\n" +"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" +"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" +"weights : input rank-1 array('i') with bounds (n_events)\n" +"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"rprim : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"t : input float\n" +"gaussian : input int\n" +"classical : input int\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"n_events : input int, optional\n Default: shape(qgrid, 1)\n" +"\nReturns\n-------\n" +"lineshapes : rank-4 array('D') with bounds (nirrqpt,3 * nat,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + int *scatt_events = NULL; + npy_intp scatt_events_Dims[1] = {-1}; + const int scatt_events_Rank = 1; + PyArrayObject *capi_scatt_events_as_array = NULL; + int capi_scatt_events_intent = 0; + PyObject *scatt_events_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *rprim = NULL; + npy_intp rprim_Dims[2] = {-1, -1}; + const int rprim_Rank = 2; + PyArrayObject *capi_rprim_as_array = NULL; + int capi_rprim_intent = 0; + PyObject *rprim_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[2] = {-1, -1}; + const int smear_Rank = 2; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double *smear_id = NULL; + npy_intp smear_id_Dims[2] = {-1, -1}; + const int smear_id_Rank = 2; + PyArrayObject *capi_smear_id_as_array = NULL; + int capi_smear_id_intent = 0; + PyObject *smear_id_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int n_events = 0; + PyObject *n_events_capi = Py_None; + complex_double *lineshapes = NULL; + npy_intp lineshapes_Dims[4] = {-1, -1, -1, -1}; + const int lineshapes_Rank = 4; + PyArrayObject *capi_lineshapes_as_array = NULL; + int capi_lineshapes_intent = 0; + static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing",\ + capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable irrqgrid */ + irrqgrid_Dims[0]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 1st argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 2nd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 5th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable rprim */ + rprim_Dims[0]=3,rprim_Dims[1]=3; + capi_rprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 10th argument `rprim`"; + capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); + if (capi_rprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 18th argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 15th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 2nd keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lineshapes_mode_mixing:nirrqpt=%d",nirrqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 3rd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lineshapes_mode_mixing:nat=%d",nat) { + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 4th keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lineshapes_mode_mixing:nfc2=%d",nfc2) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lineshapes_mode_mixing:ne=%d",ne) { + /* Processing variable n_events */ + if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 6th keyword (n_events) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lineshapes_mode_mixing:n_events=%d",n_events) { + /* Processing variable weights */ + weights_Dims[0]=n_events; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 3rd argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable scatt_events */ + scatt_events_Dims[0]=nirrqpt; + capi_scatt_events_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 4th argument `scatt_events`"; + capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); + if (capi_scatt_events_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 7th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 6th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 11st argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 12nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 13rd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable smear_id */ + smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; + capi_smear_id_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 14th argument `smear_id`"; + capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); + if (capi_smear_id_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); + + /* Processing variable lineshapes */ + lineshapes_Dims[0]=nirrqpt,lineshapes_Dims[1]=3 * nat,lineshapes_Dims[2]=3 * nat,lineshapes_Dims[3]=ne; + capi_lineshapes_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the hidden `lineshapes`"; + capi_lineshapes_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lineshapes_Dims,lineshapes_Rank, capi_lineshapes_intent,Py_None,capi_errmess); + if (capi_lineshapes_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lineshapes = (complex_double *)(PyArray_DATA(capi_lineshapes_as_array)); + + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 5th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lineshapes_mode_mixing:nfc3=%d",nfc3) { + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 8th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 9th argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,lineshapes); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lineshapes_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /* if (capi_lineshapes_as_array == NULL) ... else of lineshapes */ + /* End of cleaning variable lineshapes */ + if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { + Py_XDECREF(capi_smear_id_as_array); } + } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ + /* End of cleaning variable smear_id */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { + Py_XDECREF(capi_scatt_events_as_array); } + } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ + /* End of cleaning variable scatt_events */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ + } /*if (f2py_success) of n_events*/ + /* End of cleaning variable n_events */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_rprim_as_array!=rprim_capi) { + Py_XDECREF(capi_rprim_as_array); } + } /* if (capi_rprim_as_array == NULL) ... else of rprim */ + /* End of cleaning variable rprim */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************** end of calculate_lineshapes_mode_mixing ******************/ + +/*********************** calculate_lineshapes_cartesian ***********************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian[] = "\ +lineshapes = calculate_lineshapes_cartesian(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lineshapes_cartesian``.\ +\n\nParameters\n----------\n" +"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" +"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" +"weights : input rank-1 array('i') with bounds (n_events)\n" +"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"rprim : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"t : input float\n" +"gaussian : input int\n" +"classical : input int\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"n_events : input int, optional\n Default: shape(qgrid, 1)\n" +"\nReturns\n-------\n" +"lineshapes : rank-4 array('D') with bounds (nirrqpt,3 * nat,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + int *scatt_events = NULL; + npy_intp scatt_events_Dims[1] = {-1}; + const int scatt_events_Rank = 1; + PyArrayObject *capi_scatt_events_as_array = NULL; + int capi_scatt_events_intent = 0; + PyObject *scatt_events_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *rprim = NULL; + npy_intp rprim_Dims[2] = {-1, -1}; + const int rprim_Rank = 2; + PyArrayObject *capi_rprim_as_array = NULL; + int capi_rprim_intent = 0; + PyObject *rprim_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[2] = {-1, -1}; + const int smear_Rank = 2; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double *smear_id = NULL; + npy_intp smear_id_Dims[2] = {-1, -1}; + const int smear_id_Rank = 2; + PyArrayObject *capi_smear_id_as_array = NULL; + int capi_smear_id_intent = 0; + PyObject *smear_id_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int n_events = 0; + PyObject *n_events_capi = Py_None; + complex_double *lineshapes = NULL; + npy_intp lineshapes_Dims[4] = {-1, -1, -1, -1}; + const int lineshapes_Rank = 4; + PyArrayObject *capi_lineshapes_as_array = NULL; + int capi_lineshapes_intent = 0; + static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lineshapes_cartesian",\ + capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable irrqgrid */ + irrqgrid_Dims[0]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 1st argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 2nd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 5th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable rprim */ + rprim_Dims[0]=3,rprim_Dims[1]=3; + capi_rprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 10th argument `rprim`"; + capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); + if (capi_rprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 18th argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 15th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 2nd keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lineshapes_cartesian:nirrqpt=%d",nirrqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 3rd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lineshapes_cartesian:nat=%d",nat) { + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 4th keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lineshapes_cartesian:nfc2=%d",nfc2) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lineshapes_cartesian:ne=%d",ne) { + /* Processing variable n_events */ + if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 6th keyword (n_events) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lineshapes_cartesian:n_events=%d",n_events) { + /* Processing variable weights */ + weights_Dims[0]=n_events; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 3rd argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable scatt_events */ + scatt_events_Dims[0]=nirrqpt; + capi_scatt_events_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 4th argument `scatt_events`"; + capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); + if (capi_scatt_events_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 7th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 6th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 11st argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 12nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 13rd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable smear_id */ + smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; + capi_smear_id_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 14th argument `smear_id`"; + capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); + if (capi_smear_id_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); + + /* Processing variable lineshapes */ + lineshapes_Dims[0]=nirrqpt,lineshapes_Dims[1]=3 * nat,lineshapes_Dims[2]=3 * nat,lineshapes_Dims[3]=ne; + capi_lineshapes_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the hidden `lineshapes`"; + capi_lineshapes_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lineshapes_Dims,lineshapes_Rank, capi_lineshapes_intent,Py_None,capi_errmess); + if (capi_lineshapes_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lineshapes = (complex_double *)(PyArray_DATA(capi_lineshapes_as_array)); + + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 5th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lineshapes_cartesian:nfc3=%d",nfc3) { + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 8th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 9th argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,lineshapes); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lineshapes_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /* if (capi_lineshapes_as_array == NULL) ... else of lineshapes */ + /* End of cleaning variable lineshapes */ + if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { + Py_XDECREF(capi_smear_id_as_array); } + } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ + /* End of cleaning variable smear_id */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { + Py_XDECREF(capi_scatt_events_as_array); } + } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ + /* End of cleaning variable scatt_events */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ + } /*if (f2py_success) of n_events*/ + /* End of cleaning variable n_events */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_rprim_as_array!=rprim_capi) { + Py_XDECREF(capi_rprim_as_array); } + } /* if (capi_rprim_as_array == NULL) ... else of rprim */ + /* End of cleaning variable rprim */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************* end of calculate_lineshapes_cartesian *******************/ + +/******************** calculate_lifetimes_selfconsistently ********************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently[] = "\ +selfengs = calculate_lifetimes_selfconsistently(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lifetimes_selfconsistently``.\ +\n\nParameters\n----------\n" +"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" +"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" +"weights : input rank-1 array('i') with bounds (n_events)\n" +"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"rprim : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"t : input float\n" +"gaussian : input int\n" +"classical : input int\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"n_events : input int, optional\n Default: shape(qgrid, 1)\n" +"\nReturns\n-------\n" +"selfengs : rank-2 array('D') with bounds (nirrqpt,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + int *scatt_events = NULL; + npy_intp scatt_events_Dims[1] = {-1}; + const int scatt_events_Rank = 1; + PyArrayObject *capi_scatt_events_as_array = NULL; + int capi_scatt_events_intent = 0; + PyObject *scatt_events_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *rprim = NULL; + npy_intp rprim_Dims[2] = {-1, -1}; + const int rprim_Rank = 2; + PyArrayObject *capi_rprim_as_array = NULL; + int capi_rprim_intent = 0; + PyObject *rprim_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[2] = {-1, -1}; + const int smear_Rank = 2; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double *smear_id = NULL; + npy_intp smear_id_Dims[2] = {-1, -1}; + const int smear_id_Rank = 2; + PyArrayObject *capi_smear_id_as_array = NULL; + int capi_smear_id_intent = 0; + PyObject *smear_id_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int n_events = 0; + PyObject *n_events_capi = Py_None; + complex_double *selfengs = NULL; + npy_intp selfengs_Dims[2] = {-1, -1}; + const int selfengs_Rank = 2; + PyArrayObject *capi_selfengs_as_array = NULL; + int capi_selfengs_intent = 0; + static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently",\ + capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable irrqgrid */ + irrqgrid_Dims[0]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 1st argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 2nd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 5th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable rprim */ + rprim_Dims[0]=3,rprim_Dims[1]=3; + capi_rprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 10th argument `rprim`"; + capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); + if (capi_rprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 18th argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 15th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 2nd keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lifetimes_selfconsistently:nirrqpt=%d",nirrqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 3rd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lifetimes_selfconsistently:nat=%d",nat) { + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 4th keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lifetimes_selfconsistently:nfc2=%d",nfc2) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lifetimes_selfconsistently:ne=%d",ne) { + /* Processing variable n_events */ + if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 6th keyword (n_events) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lifetimes_selfconsistently:n_events=%d",n_events) { + /* Processing variable weights */ + weights_Dims[0]=n_events; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 3rd argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable scatt_events */ + scatt_events_Dims[0]=nirrqpt; + capi_scatt_events_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 4th argument `scatt_events`"; + capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); + if (capi_scatt_events_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 7th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 6th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 11st argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 12nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 13rd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable smear_id */ + smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; + capi_smear_id_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 14th argument `smear_id`"; + capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); + if (capi_smear_id_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); + + /* Processing variable selfengs */ + selfengs_Dims[0]=nirrqpt,selfengs_Dims[1]=3 * nat; + capi_selfengs_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the hidden `selfengs`"; + capi_selfengs_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfengs_Dims,selfengs_Rank, capi_selfengs_intent,Py_None,capi_errmess); + if (capi_selfengs_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfengs = (complex_double *)(PyArray_DATA(capi_selfengs_as_array)); + + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 5th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lifetimes_selfconsistently:nfc3=%d",nfc3) { + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 8th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 9th argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,selfengs); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_selfengs_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /* if (capi_selfengs_as_array == NULL) ... else of selfengs */ + /* End of cleaning variable selfengs */ + if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { + Py_XDECREF(capi_smear_id_as_array); } + } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ + /* End of cleaning variable smear_id */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { + Py_XDECREF(capi_scatt_events_as_array); } + } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ + /* End of cleaning variable scatt_events */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ + } /*if (f2py_success) of n_events*/ + /* End of cleaning variable n_events */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_rprim_as_array!=rprim_capi) { + Py_XDECREF(capi_rprim_as_array); } + } /* if (capi_rprim_as_array == NULL) ... else of rprim */ + /* End of cleaning variable rprim */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************** end of calculate_lifetimes_selfconsistently ****************/ + +/*********************** solve_selfconsistent_equation ***********************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation[] = "\ +solve_selfconsistent_equation(w_q,self_energy,energies,tau,omega,[ne,nband])\n\nWrapper for ``solve_selfconsistent_equation``.\ +\n\nParameters\n----------\n" +"w_q : input rank-1 array('d') with bounds (nband)\n" +"self_energy : input rank-2 array('D') with bounds (ne,nband)\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"tau : in/output rank-1 array('d') with bounds (nband)\n" +"omega : in/output rank-1 array('d') with bounds (nband)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(self_energy, 0)\n" +"nband : input int, optional\n Default: shape(w_q, 0)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,double*,complex_double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + int nband = 0; + PyObject *nband_capi = Py_None; + double *w_q = NULL; + npy_intp w_q_Dims[1] = {-1}; + const int w_q_Rank = 1; + PyArrayObject *capi_w_q_as_array = NULL; + int capi_w_q_intent = 0; + PyObject *w_q_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[2] = {-1, -1}; + const int self_energy_Rank = 2; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + PyObject *self_energy_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[1] = {-1}; + const int tau_Rank = 1; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *omega = NULL; + npy_intp omega_Dims[1] = {-1}; + const int omega_Rank = 1; + PyArrayObject *capi_omega_as_array = NULL; + int capi_omega_intent = 0; + PyObject *omega_capi = Py_None; + static char *capi_kwlist[] = {"w_q","self_energy","energies","tau","omega","ne","nband",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:thermal_conductivity.get_lf.solve_selfconsistent_equation",\ + capi_kwlist,&w_q_capi,&self_energy_capi,&energies_capi,&tau_capi,&omega_capi,&ne_capi,&nband_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_q */ + ; + capi_w_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 1st argument `w_q`"; + capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); + if (capi_w_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); + + /* Processing variable nband */ + if (nband_capi == Py_None) nband = shape(w_q, 0); else + f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.solve_selfconsistent_equation() 2nd keyword (nband) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_q, 0) == nband,"shape(w_q, 0) == nband","2nd keyword nband","solve_selfconsistent_equation:nband=%d",nband) { + /* Processing variable self_energy */ + self_energy_Dims[1]=nband; + capi_self_energy_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 2nd argument `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable tau */ + tau_Dims[0]=nband; + capi_tau_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 4th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable omega */ + omega_Dims[0]=nband; + capi_omega_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 5th argument `omega`"; + capi_omega_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,omega_Dims,omega_Rank, capi_omega_intent,omega_capi,capi_errmess); + if (capi_omega_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + omega = (double *)(PyArray_DATA(capi_omega_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(self_energy, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.solve_selfconsistent_equation() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","solve_selfconsistent_equation:ne=%d",ne) { + /* Processing variable energies */ + energies_Dims[0]=ne; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 3rd argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,&nband,w_q,self_energy,energies,tau,omega); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_omega_as_array!=omega_capi) { + Py_XDECREF(capi_omega_as_array); } + } /* if (capi_omega_as_array == NULL) ... else of omega */ + /* End of cleaning variable omega */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { + Py_XDECREF(capi_self_energy_as_array); } + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ + } /*CHECKSCALAR(shape(w_q, 0) == nband)*/ + } /*if (f2py_success) of nband*/ + /* End of cleaning variable nband */ + if((PyObject *)capi_w_q_as_array!=w_q_capi) { + Py_XDECREF(capi_w_q_as_array); } + } /* if (capi_w_q_as_array == NULL) ... else of w_q */ + /* End of cleaning variable w_q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of solve_selfconsistent_equation ********************/ + +/*********************** calculate_correlation_function ***********************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function[] = "\ +calculate_correlation_function(energies,w_q,self_energy,lineshape,[nat,ne])\n\nWrapper for ``calculate_correlation_function``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"w_q : input rank-1 array('d') with bounds (3 * nat)\n" +"self_energy : input rank-2 array('D') with bounds (ne,3 * nat)\n" +"lineshape : in/output rank-2 array('d') with bounds (ne,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" +"ne : input int, optional\n Default: shape(energies, 0)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *w_q = NULL; + npy_intp w_q_Dims[1] = {-1}; + const int w_q_Rank = 1; + PyArrayObject *capi_w_q_as_array = NULL; + int capi_w_q_intent = 0; + PyObject *w_q_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[2] = {-1, -1}; + const int self_energy_Rank = 2; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + PyObject *self_energy_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *lineshape = NULL; + npy_intp lineshape_Dims[2] = {-1, -1}; + const int lineshape_Rank = 2; + PyArrayObject *capi_lineshape_as_array = NULL; + int capi_lineshape_intent = 0; + PyObject *lineshape_capi = Py_None; + static char *capi_kwlist[] = {"energies","w_q","self_energy","lineshape","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|OO:thermal_conductivity.get_lf.calculate_correlation_function",\ + capi_kwlist,&energies_capi,&w_q_capi,&self_energy_capi,&lineshape_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_q */ + ; + capi_w_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 2nd argument `w_q`"; + capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); + if (capi_w_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_correlation_function() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","1st keyword nat","calculate_correlation_function:nat=%d",nat) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_correlation_function() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","2nd keyword ne","calculate_correlation_function:ne=%d",ne) { + /* Processing variable self_energy */ + self_energy_Dims[0]=ne,self_energy_Dims[1]=3 * nat; + capi_self_energy_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 3rd argument `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable lineshape */ + lineshape_Dims[0]=ne,lineshape_Dims[1]=3 * nat; + capi_lineshape_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 4th argument `lineshape`"; + capi_lineshape_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,lineshape_Dims,lineshape_Rank, capi_lineshape_intent,lineshape_capi,capi_errmess); + if (capi_lineshape_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lineshape = (double *)(PyArray_DATA(capi_lineshape_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(energies,w_q,self_energy,&nat,&ne,lineshape); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_lineshape_as_array!=lineshape_capi) { + Py_XDECREF(capi_lineshape_as_array); } + } /* if (capi_lineshape_as_array == NULL) ... else of lineshape */ + /* End of cleaning variable lineshape */ + if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { + Py_XDECREF(capi_self_energy_as_array); } + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_w_q_as_array!=w_q_capi) { + Py_XDECREF(capi_w_q_as_array); } + } /* if (capi_w_q_as_array == NULL) ... else of w_q */ + /* End of cleaning variable w_q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************* end of calculate_correlation_function *******************/ + +/********************** calculate_lifetimes_perturbative **********************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative[] = "\ +self_energies = calculate_lifetimes_perturbative(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,t,gaussian,classical,[nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lifetimes_perturbative``.\ +\n\nParameters\n----------\n" +"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" +"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" +"weights : input rank-1 array('i') with bounds (n_events)\n" +"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"rprim : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"t : input float\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"n_events : input int, optional\n Default: shape(qgrid, 1)\n" +"\nReturns\n-------\n" +"self_energies : rank-2 array('D') with bounds (nirrqpt,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + int *scatt_events = NULL; + npy_intp scatt_events_Dims[1] = {-1}; + const int scatt_events_Rank = 1; + PyArrayObject *capi_scatt_events_as_array = NULL; + int capi_scatt_events_intent = 0; + PyObject *scatt_events_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *rprim = NULL; + npy_intp rprim_Dims[2] = {-1, -1}; + const int rprim_Rank = 2; + PyArrayObject *capi_rprim_as_array = NULL; + int capi_rprim_intent = 0; + PyObject *rprim_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[2] = {-1, -1}; + const int smear_Rank = 2; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int n_events = 0; + PyObject *n_events_capi = Py_None; + complex_double *self_energies = NULL; + npy_intp self_energies_Dims[2] = {-1, -1}; + const int self_energies_Rank = 2; + PyArrayObject *capi_self_energies_as_array = NULL; + int capi_self_energies_intent = 0; + static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","t","gaussian","classical","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_lifetimes_perturbative",\ + capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&t_capi,&gaussian_capi,&classical_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable irrqgrid */ + irrqgrid_Dims[0]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 1st argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 2nd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 5th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable rprim */ + rprim_Dims[0]=3,rprim_Dims[1]=3; + capi_rprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 10th argument `rprim`"; + capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); + if (capi_rprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 14th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 1st keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","1st keyword nirrqpt","calculate_lifetimes_perturbative:nirrqpt=%d",nirrqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","2nd keyword nat","calculate_lifetimes_perturbative:nat=%d",nat) { + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 3rd keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_lifetimes_perturbative:nfc2=%d",nfc2) { + /* Processing variable n_events */ + if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 5th keyword (n_events) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","5th keyword n_events","calculate_lifetimes_perturbative:n_events=%d",n_events) { + /* Processing variable weights */ + weights_Dims[0]=n_events; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 3rd argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable scatt_events */ + scatt_events_Dims[0]=nirrqpt; + capi_scatt_events_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 4th argument `scatt_events`"; + capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); + if (capi_scatt_events_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 7th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 6th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 11st argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 12nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 13rd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable self_energies */ + self_energies_Dims[0]=nirrqpt,self_energies_Dims[1]=3 * nat; + capi_self_energies_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the hidden `self_energies`"; + capi_self_energies_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energies_Dims,self_energies_Rank, capi_self_energies_intent,Py_None,capi_errmess); + if (capi_self_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energies = (complex_double *)(PyArray_DATA(capi_self_energies_as_array)); + + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 4th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_lifetimes_perturbative:nfc3=%d",nfc3) { + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 8th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 9th argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,&t,&gaussian,&classical,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,self_energies); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_self_energies_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /* if (capi_self_energies_as_array == NULL) ... else of self_energies */ + /* End of cleaning variable self_energies */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { + Py_XDECREF(capi_scatt_events_as_array); } + } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ + /* End of cleaning variable scatt_events */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ + } /*if (f2py_success) of n_events*/ + /* End of cleaning variable n_events */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_rprim_as_array!=rprim_capi) { + Py_XDECREF(capi_rprim_as_array); } + } /* if (capi_rprim_as_array == NULL) ... else of rprim */ + /* End of cleaning variable rprim */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************** end of calculate_lifetimes_perturbative ******************/ + +/**************************** calculate_lifetimes ****************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes[] = "\ +self_energies = calculate_lifetimes(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,t,gaussian,classical,[nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lifetimes``.\ +\n\nParameters\n----------\n" +"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" +"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" +"weights : input rank-1 array('i') with bounds (n_events)\n" +"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"rprim : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" +"t : input float\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"n_events : input int, optional\n Default: shape(qgrid, 1)\n" +"\nReturns\n-------\n" +"self_energies : rank-2 array('D') with bounds (nirrqpt,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + int *scatt_events = NULL; + npy_intp scatt_events_Dims[1] = {-1}; + const int scatt_events_Rank = 1; + PyArrayObject *capi_scatt_events_as_array = NULL; + int capi_scatt_events_intent = 0; + PyObject *scatt_events_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *rprim = NULL; + npy_intp rprim_Dims[2] = {-1, -1}; + const int rprim_Rank = 2; + PyArrayObject *capi_rprim_as_array = NULL; + int capi_rprim_intent = 0; + PyObject *rprim_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[2] = {-1, -1}; + const int smear_Rank = 2; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int n_events = 0; + PyObject *n_events_capi = Py_None; + complex_double *self_energies = NULL; + npy_intp self_energies_Dims[2] = {-1, -1}; + const int self_energies_Rank = 2; + PyArrayObject *capi_self_energies_as_array = NULL; + int capi_self_energies_intent = 0; + static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","t","gaussian","classical","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_lifetimes",\ + capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&t_capi,&gaussian_capi,&classical_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable irrqgrid */ + irrqgrid_Dims[0]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 1st argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 2nd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 5th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable rprim */ + rprim_Dims[0]=3,rprim_Dims[1]=3; + capi_rprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 10th argument `rprim`"; + capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); + if (capi_rprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 14th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 1st keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","1st keyword nirrqpt","calculate_lifetimes:nirrqpt=%d",nirrqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","2nd keyword nat","calculate_lifetimes:nat=%d",nat) { + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 3rd keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_lifetimes:nfc2=%d",nfc2) { + /* Processing variable n_events */ + if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 5th keyword (n_events) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","5th keyword n_events","calculate_lifetimes:n_events=%d",n_events) { + /* Processing variable weights */ + weights_Dims[0]=n_events; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 3rd argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable scatt_events */ + scatt_events_Dims[0]=nirrqpt; + capi_scatt_events_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 4th argument `scatt_events`"; + capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); + if (capi_scatt_events_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 7th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 6th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 11st argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 12nd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 13rd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable self_energies */ + self_energies_Dims[0]=nirrqpt,self_energies_Dims[1]=3 * nat; + capi_self_energies_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the hidden `self_energies`"; + capi_self_energies_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energies_Dims,self_energies_Rank, capi_self_energies_intent,Py_None,capi_errmess); + if (capi_self_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energies = (complex_double *)(PyArray_DATA(capi_self_energies_as_array)); + + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 4th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_lifetimes:nfc3=%d",nfc3) { + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 8th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 9th argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,&t,&gaussian,&classical,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,self_energies); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_self_energies_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /* if (capi_self_energies_as_array == NULL) ... else of self_energies */ + /* End of cleaning variable self_energies */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { + Py_XDECREF(capi_scatt_events_as_array); } + } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ + /* End of cleaning variable scatt_events */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ + } /*if (f2py_success) of n_events*/ + /* End of cleaning variable n_events */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_rprim_as_array!=rprim_capi) { + Py_XDECREF(capi_rprim_as_array); } + } /* if (capi_rprim_as_array == NULL) ... else of rprim */ + /* End of cleaning variable rprim */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of calculate_lifetimes *************************/ + +/************************** calculate_self_energy_la **************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la[] = "\ +self_energy = calculate_self_energy_la(w_q,qpt,pols_q,is_q_gamma,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,t,parallelize,gaussian,classical,[nqpt,nat,nfc2,nfc3])\n\nWrapper for ``calculate_self_energy_la``.\ +\n\nParameters\n----------\n" +"w_q : input rank-1 array('d') with bounds (3 * nat)\n" +"qpt : input rank-1 array('d') with bounds (3)\n" +"pols_q : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"is_q_gamma : input int\n" +"qgrid : input rank-2 array('d') with bounds (3,nqpt)\n" +"weights : input rank-1 array('i') with bounds (nqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"kprim : input rank-2 array('d') with bounds (3,3)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"t : input float\n" +"parallelize : input int\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"nqpt : input int, optional\n Default: shape(qgrid, 1)\n" +"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"\nReturns\n-------\n" +"self_energy : rank-1 array('D') with bounds (3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,int*,int*,int*,int*,int*,double*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *w_q = NULL; + npy_intp w_q_Dims[1] = {-1}; + const int w_q_Rank = 1; + PyArrayObject *capi_w_q_as_array = NULL; + int capi_w_q_intent = 0; + PyObject *w_q_capi = Py_None; + double *qpt = NULL; + npy_intp qpt_Dims[1] = {-1}; + const int qpt_Rank = 1; + PyArrayObject *capi_qpt_as_array = NULL; + int capi_qpt_intent = 0; + PyObject *qpt_capi = Py_None; + complex_double *pols_q = NULL; + npy_intp pols_q_Dims[2] = {-1, -1}; + const int pols_q_Rank = 2; + PyArrayObject *capi_pols_q_as_array = NULL; + int capi_pols_q_intent = 0; + PyObject *pols_q_capi = Py_None; + int is_q_gamma = 0; + PyObject *is_q_gamma_capi = Py_None; + int nqpt = 0; + PyObject *nqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *kprim = NULL; + npy_intp kprim_Dims[2] = {-1, -1}; + const int kprim_Rank = 2; + PyArrayObject *capi_kprim_as_array = NULL; + int capi_kprim_intent = 0; + PyObject *kprim_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int parallelize = 0; + PyObject *parallelize_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[1] = {-1}; + const int self_energy_Rank = 1; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + static char *capi_kwlist[] = {"w_q","qpt","pols_q","is_q_gamma","qgrid","weights","fc2","fc3","r2_2","r3_2","r3_3","pos","kprim","masses","smear","t","parallelize","gaussian","classical","nqpt","nat","nfc2","nfc3",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOOO|OOOO:thermal_conductivity.get_lf.calculate_self_energy_la",\ + capi_kwlist,&w_q_capi,&qpt_capi,&pols_q_capi,&is_q_gamma_capi,&qgrid_capi,&weights_capi,&fc2_capi,&fc3_capi,&r2_2_capi,&r3_2_capi,&r3_3_capi,&pos_capi,&kprim_capi,&masses_capi,&smear_capi,&t_capi,¶llelize_capi,&gaussian_capi,&classical_capi,&nqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_q */ + ; + capi_w_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 1st argument `w_q`"; + capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); + if (capi_w_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); + + /* Processing variable qpt */ + qpt_Dims[0]=3; + capi_qpt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 2nd argument `qpt`"; + capi_qpt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qpt_Dims,qpt_Rank, capi_qpt_intent,qpt_capi,capi_errmess); + if (capi_qpt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qpt = (double *)(PyArray_DATA(capi_qpt_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 5th argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable kprim */ + kprim_Dims[0]=3,kprim_Dims[1]=3; + capi_kprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 13rd argument `kprim`"; + capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); + if (capi_kprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 16th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_q_gamma */ + is_q_gamma = (int)PyObject_IsTrue(is_q_gamma_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable parallelize */ + parallelize = (int)PyObject_IsTrue(parallelize_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nqpt */ + if (nqpt_capi == Py_None) nqpt = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 1st keyword (nqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == nqpt,"shape(qgrid, 1) == nqpt","1st keyword nqpt","calculate_self_energy_la:nqpt=%d",nqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","2nd keyword nat","calculate_self_energy_la:nat=%d",nat) { + /* Processing variable weights */ + weights_Dims[0]=nqpt; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 6th argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable fc2 */ + fc2_Dims[1]=3 * nat,fc2_Dims[2]=3 * nat; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 7th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 8th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 12nd argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 14th argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 15th argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable pols_q */ + pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; + capi_pols_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 3rd argument `pols_q`"; + capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,pols_q_capi,capi_errmess); + if (capi_pols_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); + + /* Processing variable self_energy */ + self_energy_Dims[0]=3 * nat; + capi_self_energy_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the hidden `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,Py_None,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 3rd keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_self_energy_la:nfc2=%d",nfc2) { + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 4th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_self_energy_la:nfc3=%d",nfc3) { + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 9th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 10th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 11st argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(w_q,qpt,pols_q,&is_q_gamma,&nqpt,&nat,&nfc2,&nfc3,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,&t,¶llelize,&gaussian,&classical,self_energy); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_self_energy_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ + if((PyObject *)capi_pols_q_as_array!=pols_q_capi) { + Py_XDECREF(capi_pols_q_as_array); } + } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ + /* End of cleaning variable pols_q */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(qgrid, 1) == nqpt)*/ + } /*if (f2py_success) of nqpt*/ + /* End of cleaning variable nqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of parallelize*/ + /* End of cleaning variable parallelize */ + } /*if (f2py_success) of is_q_gamma*/ + /* End of cleaning variable is_q_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_kprim_as_array!=kprim_capi) { + Py_XDECREF(capi_kprim_as_array); } + } /* if (capi_kprim_as_array == NULL) ... else of kprim */ + /* End of cleaning variable kprim */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_qpt_as_array!=qpt_capi) { + Py_XDECREF(capi_qpt_as_array); } + } /* if (capi_qpt_as_array == NULL) ... else of qpt */ + /* End of cleaning variable qpt */ + if((PyObject *)capi_w_q_as_array!=w_q_capi) { + Py_XDECREF(capi_w_q_as_array); } + } /* if (capi_w_q_as_array == NULL) ... else of w_q */ + /* End of cleaning variable w_q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************** end of calculate_self_energy_la **********************/ + +/************************** calculate_self_energy_p **************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p[] = "\ +self_energy = calculate_self_energy_p(w_q,qpt,pols_q,is_q_gamma,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,t,energies,parallelize,gaussian,classical,[nqpt,nat,nfc2,nfc3,ne])\n\nWrapper for ``calculate_self_energy_p``.\ +\n\nParameters\n----------\n" +"w_q : input rank-1 array('d') with bounds (3 * nat)\n" +"qpt : input rank-1 array('d') with bounds (3)\n" +"pols_q : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"is_q_gamma : input int\n" +"qgrid : input rank-2 array('d') with bounds (3,nqpt)\n" +"weights : input rank-1 array('i') with bounds (nqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"kprim : input rank-2 array('d') with bounds (3,3)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"t : input float\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"parallelize : input int\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"nqpt : input int, optional\n Default: shape(qgrid, 1)\n" +"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"\nReturns\n-------\n" +"self_energy : rank-2 array('D') with bounds (ne,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,int*,int*,int*,int*,int*,int*,double*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *w_q = NULL; + npy_intp w_q_Dims[1] = {-1}; + const int w_q_Rank = 1; + PyArrayObject *capi_w_q_as_array = NULL; + int capi_w_q_intent = 0; + PyObject *w_q_capi = Py_None; + double *qpt = NULL; + npy_intp qpt_Dims[1] = {-1}; + const int qpt_Rank = 1; + PyArrayObject *capi_qpt_as_array = NULL; + int capi_qpt_intent = 0; + PyObject *qpt_capi = Py_None; + complex_double *pols_q = NULL; + npy_intp pols_q_Dims[2] = {-1, -1}; + const int pols_q_Rank = 2; + PyArrayObject *capi_pols_q_as_array = NULL; + int capi_pols_q_intent = 0; + PyObject *pols_q_capi = Py_None; + int is_q_gamma = 0; + PyObject *is_q_gamma_capi = Py_None; + int nqpt = 0; + PyObject *nqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *kprim = NULL; + npy_intp kprim_Dims[2] = {-1, -1}; + const int kprim_Rank = 2; + PyArrayObject *capi_kprim_as_array = NULL; + int capi_kprim_intent = 0; + PyObject *kprim_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int parallelize = 0; + PyObject *parallelize_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[2] = {-1, -1}; + const int self_energy_Rank = 2; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + static char *capi_kwlist[] = {"w_q","qpt","pols_q","is_q_gamma","qgrid","weights","fc2","fc3","r2_2","r3_2","r3_3","pos","kprim","masses","smear","t","energies","parallelize","gaussian","classical","nqpt","nat","nfc2","nfc3","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_self_energy_p",\ + capi_kwlist,&w_q_capi,&qpt_capi,&pols_q_capi,&is_q_gamma_capi,&qgrid_capi,&weights_capi,&fc2_capi,&fc3_capi,&r2_2_capi,&r3_2_capi,&r3_3_capi,&pos_capi,&kprim_capi,&masses_capi,&smear_capi,&t_capi,&energies_capi,¶llelize_capi,&gaussian_capi,&classical_capi,&nqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_q */ + ; + capi_w_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 1st argument `w_q`"; + capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); + if (capi_w_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); + + /* Processing variable qpt */ + qpt_Dims[0]=3; + capi_qpt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 2nd argument `qpt`"; + capi_qpt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qpt_Dims,qpt_Rank, capi_qpt_intent,qpt_capi,capi_errmess); + if (capi_qpt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qpt = (double *)(PyArray_DATA(capi_qpt_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 5th argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable kprim */ + kprim_Dims[0]=3,kprim_Dims[1]=3; + capi_kprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 13rd argument `kprim`"; + capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); + if (capi_kprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 17th argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 16th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_q_gamma */ + is_q_gamma = (int)PyObject_IsTrue(is_q_gamma_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable parallelize */ + parallelize = (int)PyObject_IsTrue(parallelize_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nqpt */ + if (nqpt_capi == Py_None) nqpt = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 1st keyword (nqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == nqpt,"shape(qgrid, 1) == nqpt","1st keyword nqpt","calculate_self_energy_p:nqpt=%d",nqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","2nd keyword nat","calculate_self_energy_p:nat=%d",nat) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 5th keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","5th keyword ne","calculate_self_energy_p:ne=%d",ne) { + /* Processing variable weights */ + weights_Dims[0]=nqpt; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 6th argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable fc2 */ + fc2_Dims[1]=3 * nat,fc2_Dims[2]=3 * nat; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 7th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 8th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 12nd argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 14th argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 15th argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable pols_q */ + pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; + capi_pols_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 3rd argument `pols_q`"; + capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,pols_q_capi,capi_errmess); + if (capi_pols_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); + + /* Processing variable self_energy */ + self_energy_Dims[0]=ne,self_energy_Dims[1]=3 * nat; + capi_self_energy_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the hidden `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,Py_None,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 3rd keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_self_energy_p:nfc2=%d",nfc2) { + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 4th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_self_energy_p:nfc3=%d",nfc3) { + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 9th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 10th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 11st argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(w_q,qpt,pols_q,&is_q_gamma,&nqpt,&nat,&nfc2,&nfc3,&ne,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,&t,energies,¶llelize,&gaussian,&classical,self_energy); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_self_energy_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ + if((PyObject *)capi_pols_q_as_array!=pols_q_capi) { + Py_XDECREF(capi_pols_q_as_array); } + } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ + /* End of cleaning variable pols_q */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(qgrid, 1) == nqpt)*/ + } /*if (f2py_success) of nqpt*/ + /* End of cleaning variable nqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of parallelize*/ + /* End of cleaning variable parallelize */ + } /*if (f2py_success) of is_q_gamma*/ + /* End of cleaning variable is_q_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_kprim_as_array!=kprim_capi) { + Py_XDECREF(capi_kprim_as_array); } + } /* if (capi_kprim_as_array == NULL) ... else of kprim */ + /* End of cleaning variable kprim */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_qpt_as_array!=qpt_capi) { + Py_XDECREF(capi_qpt_as_array); } + } /* if (capi_qpt_as_array == NULL) ... else of qpt */ + /* End of cleaning variable qpt */ + if((PyObject *)capi_w_q_as_array!=w_q_capi) { + Py_XDECREF(capi_w_q_as_array); } + } /* if (capi_w_q_as_array == NULL) ... else of w_q */ + /* End of cleaning variable w_q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of calculate_self_energy_p ***********************/ + +/************************* calculate_self_energy_full *************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full[] = "\ +self_energy = calculate_self_energy_full(w_q,qpt,pols_q,is_q_gamma,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,t,energies,parallelize,gaussian,classical,[nqpt,nat,nfc2,nfc3,ne])\n\nWrapper for ``calculate_self_energy_full``.\ +\n\nParameters\n----------\n" +"w_q : input rank-1 array('d') with bounds (3 * nat)\n" +"qpt : input rank-1 array('d') with bounds (3)\n" +"pols_q : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"is_q_gamma : input int\n" +"qgrid : input rank-2 array('d') with bounds (3,nqpt)\n" +"weights : input rank-1 array('i') with bounds (nqpt)\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" +"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"kprim : input rank-2 array('d') with bounds (3,3)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"t : input float\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"parallelize : input int\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"nqpt : input int, optional\n Default: shape(qgrid, 1)\n" +"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"\nReturns\n-------\n" +"self_energy : rank-3 array('D') with bounds (ne,3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,int*,int*,int*,int*,int*,int*,double*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *w_q = NULL; + npy_intp w_q_Dims[1] = {-1}; + const int w_q_Rank = 1; + PyArrayObject *capi_w_q_as_array = NULL; + int capi_w_q_intent = 0; + PyObject *w_q_capi = Py_None; + double *qpt = NULL; + npy_intp qpt_Dims[1] = {-1}; + const int qpt_Rank = 1; + PyArrayObject *capi_qpt_as_array = NULL; + int capi_qpt_intent = 0; + PyObject *qpt_capi = Py_None; + complex_double *pols_q = NULL; + npy_intp pols_q_Dims[2] = {-1, -1}; + const int pols_q_Rank = 2; + PyArrayObject *capi_pols_q_as_array = NULL; + int capi_pols_q_intent = 0; + PyObject *pols_q_capi = Py_None; + int is_q_gamma = 0; + PyObject *is_q_gamma_capi = Py_None; + int nqpt = 0; + PyObject *nqpt_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nfc3 = 0; + PyObject *nfc3_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + int *weights = NULL; + npy_intp weights_Dims[1] = {-1}; + const int weights_Rank = 1; + PyArrayObject *capi_weights_as_array = NULL; + int capi_weights_intent = 0; + PyObject *weights_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *fc3 = NULL; + npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; + const int fc3_Rank = 4; + PyArrayObject *capi_fc3_as_array = NULL; + int capi_fc3_intent = 0; + PyObject *fc3_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *r3_2 = NULL; + npy_intp r3_2_Dims[2] = {-1, -1}; + const int r3_2_Rank = 2; + PyArrayObject *capi_r3_2_as_array = NULL; + int capi_r3_2_intent = 0; + PyObject *r3_2_capi = Py_None; + double *r3_3 = NULL; + npy_intp r3_3_Dims[2] = {-1, -1}; + const int r3_3_Rank = 2; + PyArrayObject *capi_r3_3_as_array = NULL; + int capi_r3_3_intent = 0; + PyObject *r3_3_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *kprim = NULL; + npy_intp kprim_Dims[2] = {-1, -1}; + const int kprim_Rank = 2; + PyArrayObject *capi_kprim_as_array = NULL; + int capi_kprim_intent = 0; + PyObject *kprim_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int parallelize = 0; + PyObject *parallelize_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[3] = {-1, -1, -1}; + const int self_energy_Rank = 3; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + static char *capi_kwlist[] = {"w_q","qpt","pols_q","is_q_gamma","qgrid","weights","fc2","fc3","r2_2","r3_2","r3_3","pos","kprim","masses","smear","t","energies","parallelize","gaussian","classical","nqpt","nat","nfc2","nfc3","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_self_energy_full",\ + capi_kwlist,&w_q_capi,&qpt_capi,&pols_q_capi,&is_q_gamma_capi,&qgrid_capi,&weights_capi,&fc2_capi,&fc3_capi,&r2_2_capi,&r3_2_capi,&r3_3_capi,&pos_capi,&kprim_capi,&masses_capi,&smear_capi,&t_capi,&energies_capi,¶llelize_capi,&gaussian_capi,&classical_capi,&nqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable w_q */ + ; + capi_w_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 1st argument `w_q`"; + capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); + if (capi_w_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); + + /* Processing variable qpt */ + qpt_Dims[0]=3; + capi_qpt_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 2nd argument `qpt`"; + capi_qpt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qpt_Dims,qpt_Rank, capi_qpt_intent,qpt_capi,capi_errmess); + if (capi_qpt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qpt = (double *)(PyArray_DATA(capi_qpt_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[0]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 5th argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable kprim */ + kprim_Dims[0]=3,kprim_Dims[1]=3; + capi_kprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 13rd argument `kprim`"; + capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); + if (capi_kprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); + + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 17th argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 16th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_q_gamma */ + is_q_gamma = (int)PyObject_IsTrue(is_q_gamma_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable parallelize */ + parallelize = (int)PyObject_IsTrue(parallelize_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable nqpt */ + if (nqpt_capi == Py_None) nqpt = shape(qgrid, 1); else + f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 1st keyword (nqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 1) == nqpt,"shape(qgrid, 1) == nqpt","1st keyword nqpt","calculate_self_energy_full:nqpt=%d",nqpt) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","2nd keyword nat","calculate_self_energy_full:nat=%d",nat) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 5th keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","5th keyword ne","calculate_self_energy_full:ne=%d",ne) { + /* Processing variable weights */ + weights_Dims[0]=nqpt; + capi_weights_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 6th argument `weights`"; + capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); + if (capi_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weights = (int *)(PyArray_DATA(capi_weights_as_array)); + + /* Processing variable fc2 */ + fc2_Dims[1]=3 * nat,fc2_Dims[2]=3 * nat; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 7th argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable fc3 */ + fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; + capi_fc3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 8th argument `fc3`"; + capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); + if (capi_fc3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 12nd argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 14th argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable smear */ + smear_Dims[0]=3 * nat; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 15th argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable pols_q */ + pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; + capi_pols_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 3rd argument `pols_q`"; + capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,pols_q_capi,capi_errmess); + if (capi_pols_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); + + /* Processing variable self_energy */ + self_energy_Dims[0]=ne,self_energy_Dims[1]=3 * nat,self_energy_Dims[2]=3 * nat; + capi_self_energy_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the hidden `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,Py_None,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 3rd keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_self_energy_full:nfc2=%d",nfc2) { + /* Processing variable nfc3 */ + if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else + f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 4th keyword (nfc3) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_self_energy_full:nfc3=%d",nfc3) { + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 9th argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable r3_2 */ + r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; + capi_r3_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 10th argument `r3_2`"; + capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); + if (capi_r3_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); + + /* Processing variable r3_3 */ + r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; + capi_r3_3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 11st argument `r3_3`"; + capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); + if (capi_r3_3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(w_q,qpt,pols_q,&is_q_gamma,&nqpt,&nat,&nfc2,&nfc3,&ne,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,&t,energies,¶llelize,&gaussian,&classical,self_energy); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_self_energy_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { + Py_XDECREF(capi_r3_3_as_array); } + } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ + /* End of cleaning variable r3_3 */ + if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { + Py_XDECREF(capi_r3_2_as_array); } + } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ + /* End of cleaning variable r3_2 */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ + } /*if (f2py_success) of nfc3*/ + /* End of cleaning variable nfc3 */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ + if((PyObject *)capi_pols_q_as_array!=pols_q_capi) { + Py_XDECREF(capi_pols_q_as_array); } + } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ + /* End of cleaning variable pols_q */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_fc3_as_array!=fc3_capi) { + Py_XDECREF(capi_fc3_as_array); } + } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ + /* End of cleaning variable fc3 */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ + if((PyObject *)capi_weights_as_array!=weights_capi) { + Py_XDECREF(capi_weights_as_array); } + } /* if (capi_weights_as_array == NULL) ... else of weights */ + /* End of cleaning variable weights */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(qgrid, 1) == nqpt)*/ + } /*if (f2py_success) of nqpt*/ + /* End of cleaning variable nqpt */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of parallelize*/ + /* End of cleaning variable parallelize */ + } /*if (f2py_success) of is_q_gamma*/ + /* End of cleaning variable is_q_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + if((PyObject *)capi_kprim_as_array!=kprim_capi) { + Py_XDECREF(capi_kprim_as_array); } + } /* if (capi_kprim_as_array == NULL) ... else of kprim */ + /* End of cleaning variable kprim */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_qpt_as_array!=qpt_capi) { + Py_XDECREF(capi_qpt_as_array); } + } /* if (capi_qpt_as_array == NULL) ... else of qpt */ + /* End of cleaning variable qpt */ + if((PyObject *)capi_w_q_as_array!=w_q_capi) { + Py_XDECREF(capi_w_q_as_array); } + } /* if (capi_w_q_as_array == NULL) ... else of w_q */ + /* End of cleaning variable w_q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of calculate_self_energy_full *********************/ + +/******************************* check_if_gamma *******************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_check_if_gamma[] = "\ +is_gamma = check_if_gamma(q,kprim,w2_q,[nat])\n\nWrapper for ``check_if_gamma``.\ +\n\nParameters\n----------\n" +"q : input rank-1 array('d') with bounds (3)\n" +"kprim : input rank-2 array('d') with bounds (3,3)\n" +"w2_q : in/output rank-1 array('d') with bounds (3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(w2_q, 0) / 3\n" +"\nReturns\n-------\n" +"is_gamma : int"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_check_if_gamma(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nat = 0; + PyObject *nat_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[1] = {-1}; + const int q_Rank = 1; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *kprim = NULL; + npy_intp kprim_Dims[2] = {-1, -1}; + const int kprim_Rank = 2; + PyArrayObject *capi_kprim_as_array = NULL; + int capi_kprim_intent = 0; + PyObject *kprim_capi = Py_None; + double *w2_q = NULL; + npy_intp w2_q_Dims[1] = {-1}; + const int w2_q_Rank = 1; + PyArrayObject *capi_w2_q_as_array = NULL; + int capi_w2_q_intent = 0; + PyObject *w2_q_capi = Py_None; + int is_gamma = 0; + static char *capi_kwlist[] = {"q","kprim","w2_q","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:thermal_conductivity.get_lf.check_if_gamma",\ + capi_kwlist,&q_capi,&kprim_capi,&w2_q_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.check_if_gamma: failed to create array from the 1st argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable kprim */ + kprim_Dims[0]=3,kprim_Dims[1]=3; + capi_kprim_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.check_if_gamma: failed to create array from the 2nd argument `kprim`"; + capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); + if (capi_kprim_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); + + /* Processing variable w2_q */ + ; + capi_w2_q_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.check_if_gamma: failed to create array from the 3rd argument `w2_q`"; + capi_w2_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w2_q_Dims,w2_q_Rank, capi_w2_q_intent,w2_q_capi,capi_errmess); + if (capi_w2_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w2_q = (double *)(PyArray_DATA(capi_w2_q_as_array)); + + /* Processing variable is_gamma */ + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(w2_q, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.check_if_gamma() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(w2_q, 0) == 3 * nat,"shape(w2_q, 0) == 3 * nat","1st keyword nat","check_if_gamma:nat=%d",nat) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nat,q,kprim,w2_q,&is_gamma); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",is_gamma); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(w2_q, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + /* End of cleaning variable is_gamma */ + if((PyObject *)capi_w2_q_as_array!=w2_q_capi) { + Py_XDECREF(capi_w2_q_as_array); } + } /* if (capi_w2_q_as_array == NULL) ... else of w2_q */ + /* End of cleaning variable w2_q */ + if((PyObject *)capi_kprim_as_array!=kprim_capi) { + Py_XDECREF(capi_kprim_as_array); } + } /* if (capi_kprim_as_array == NULL) ... else of kprim */ + /* End of cleaning variable kprim */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of check_if_gamma ***************************/ + +/******************************** vec_dot_mat ********************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_vec_dot_mat[] = "\ +v2 = vec_dot_mat(v1,m1)\n\nWrapper for ``vec_dot_mat``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (f2py_v1_d0)\n" +"m1 : input rank-2 array('d') with bounds (f2py_m1_d0,f2py_m1_d1)\n" +"\nReturns\n-------\n" +"v2 : rank-1 array('d') with bounds (size(v1)) and vec_dot_matf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_vec_dot_mat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *vec_dot_matf2pywrap = NULL; + npy_intp vec_dot_matf2pywrap_Dims[1] = {-1}; + const int vec_dot_matf2pywrap_Rank = 1; + PyArrayObject *capi_vec_dot_matf2pywrap_as_array = NULL; + int capi_vec_dot_matf2pywrap_intent = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *m1 = NULL; + npy_intp m1_Dims[2] = {-1, -1}; + const int m1_Rank = 2; + PyArrayObject *capi_m1_as_array = NULL; + int capi_m1_intent = 0; + PyObject *m1_capi = Py_None; + int f2py_v1_d0 = 0; + int f2py_m1_d0 = 0; + int f2py_m1_d1 = 0; + static char *capi_kwlist[] = {"v1","m1",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.get_lf.vec_dot_mat",\ + capi_kwlist,&v1_capi,&m1_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable m1 */ + ; + capi_m1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.vec_dot_mat: failed to create array from the 2nd argument `m1`"; + capi_m1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m1_Dims,m1_Rank, capi_m1_intent,m1_capi,capi_errmess); + if (capi_m1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m1 = (double *)(PyArray_DATA(capi_m1_as_array)); + + /* Processing variable v1 */ + ; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.vec_dot_mat: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable vec_dot_matf2pywrap */ + vec_dot_matf2pywrap_Dims[0]=size(v1); + capi_vec_dot_matf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.vec_dot_mat: failed to create array from the hidden `vec_dot_matf2pywrap`"; + capi_vec_dot_matf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vec_dot_matf2pywrap_Dims,vec_dot_matf2pywrap_Rank, capi_vec_dot_matf2pywrap_intent,Py_None,capi_errmess); + if (capi_vec_dot_matf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + vec_dot_matf2pywrap = (double *)(PyArray_DATA(capi_vec_dot_matf2pywrap_as_array)); + + /* Processing variable f2py_v1_d0 */ + f2py_v1_d0 = shape(v1, 0); + /* Processing variable f2py_m1_d0 */ + f2py_m1_d0 = shape(m1, 0); + /* Processing variable f2py_m1_d1 */ + f2py_m1_d1 = shape(m1, 1); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(vec_dot_matf2pywrap,v1,m1,&f2py_v1_d0,&f2py_m1_d0,&f2py_m1_d1); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_vec_dot_matf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_m1_d1 */ + /* End of cleaning variable f2py_m1_d0 */ + /* End of cleaning variable f2py_v1_d0 */ + } /* if (capi_vec_dot_matf2pywrap_as_array == NULL) ... else of vec_dot_matf2pywrap */ + /* End of cleaning variable vec_dot_matf2pywrap */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ + if((PyObject *)capi_m1_as_array!=m1_capi) { + Py_XDECREF(capi_m1_as_array); } + } /* if (capi_m1_as_array == NULL) ... else of m1 */ + /* End of cleaning variable m1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of vec_dot_mat *****************************/ + +/******************* calculate_real_part_via_kramers_kronig *******************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig[] = "\ +calculate_real_part_via_kramers_kronig(self_energy,energies,freq,[ne,nband])\n\nWrapper for ``calculate_real_part_via_kramers_kronig``.\ +\n\nParameters\n----------\n" +"self_energy : in/output rank-2 array('D') with bounds (ne,nband)\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"freq : input rank-1 array('d') with bounds (nband)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(self_energy, 0)\n" +"nband : input int, optional\n Default: shape(self_energy, 1)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,complex_double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + int nband = 0; + PyObject *nband_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[2] = {-1, -1}; + const int self_energy_Rank = 2; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + PyObject *self_energy_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + static char *capi_kwlist[] = {"self_energy","energies","freq","ne","nband",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig",\ + capi_kwlist,&self_energy_capi,&energies_capi,&freq_capi,&ne_capi,&nband_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable self_energy */ + ; + capi_self_energy_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig: failed to create array from the 1st argument `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(self_energy, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","calculate_real_part_via_kramers_kronig:ne=%d",ne) { + /* Processing variable nband */ + if (nband_capi == Py_None) nband = shape(self_energy, 1); else + f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig() 2nd keyword (nband) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 1) == nband,"shape(self_energy, 1) == nband","2nd keyword nband","calculate_real_part_via_kramers_kronig:nband=%d",nband) { + /* Processing variable energies */ + energies_Dims[0]=ne; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig: failed to create array from the 2nd argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=nband; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig: failed to create array from the 3rd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,&nband,self_energy,energies,freq); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + } /*CHECKSCALAR(shape(self_energy, 1) == nband)*/ + } /*if (f2py_success) of nband*/ + /* End of cleaning variable nband */ + } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { + Py_XDECREF(capi_self_energy_as_array); } + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************** end of calculate_real_part_via_kramers_kronig ***************/ + +/***************** calculate_real_part_via_kramers_kronig_2d *****************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d[] = "\ +calculate_real_part_via_kramers_kronig_2d(self_energy,energies,freq,[ne,nband])\n\nWrapper for ``calculate_real_part_via_kramers_kronig_2d``.\ +\n\nParameters\n----------\n" +"self_energy : in/output rank-3 array('D') with bounds (ne,nband,nband)\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"freq : input rank-1 array('d') with bounds (nband)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(self_energy, 0)\n" +"nband : input int, optional\n Default: shape(self_energy, 1)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,complex_double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + int nband = 0; + PyObject *nband_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[3] = {-1, -1, -1}; + const int self_energy_Rank = 3; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + PyObject *self_energy_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + static char *capi_kwlist[] = {"self_energy","energies","freq","ne","nband",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d",\ + capi_kwlist,&self_energy_capi,&energies_capi,&freq_capi,&ne_capi,&nband_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable self_energy */ + ; + capi_self_energy_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d: failed to create array from the 1st argument `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(self_energy, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","calculate_real_part_via_kramers_kronig_2d:ne=%d",ne) { + /* Processing variable nband */ + if (nband_capi == Py_None) nband = shape(self_energy, 1); else + f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d() 2nd keyword (nband) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 1) == nband,"shape(self_energy, 1) == nband","2nd keyword nband","calculate_real_part_via_kramers_kronig_2d:nband=%d",nband) { + /* Processing variable energies */ + energies_Dims[0]=ne; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d: failed to create array from the 2nd argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=nband; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d: failed to create array from the 3rd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,&nband,self_energy,energies,freq); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + } /*CHECKSCALAR(shape(self_energy, 1) == nband)*/ + } /*if (f2py_success) of nband*/ + /* End of cleaning variable nband */ + } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { + Py_XDECREF(capi_self_energy_as_array); } + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************** end of calculate_real_part_via_kramers_kronig_2d **************/ + +/************************* hilbert_transform_via_fft *************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft[] = "\ +hilbert_transform_via_fft(self_energy,[ne,nband])\n\nWrapper for ``hilbert_transform_via_fft``.\ +\n\nParameters\n----------\n" +"self_energy : in/output rank-2 array('D') with bounds (ne,nband)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(self_energy, 0)\n" +"nband : input int, optional\n Default: shape(self_energy, 1)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + int nband = 0; + PyObject *nband_capi = Py_None; + complex_double *self_energy = NULL; + npy_intp self_energy_Dims[2] = {-1, -1}; + const int self_energy_Rank = 2; + PyArrayObject *capi_self_energy_as_array = NULL; + int capi_self_energy_intent = 0; + PyObject *self_energy_capi = Py_None; + static char *capi_kwlist[] = {"self_energy","ne","nband",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|OO:thermal_conductivity.get_lf.hilbert_transform_via_fft",\ + capi_kwlist,&self_energy_capi,&ne_capi,&nband_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable self_energy */ + ; + capi_self_energy_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.hilbert_transform_via_fft: failed to create array from the 1st argument `self_energy`"; + capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); + if (capi_self_energy_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(self_energy, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.hilbert_transform_via_fft() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","hilbert_transform_via_fft:ne=%d",ne) { + /* Processing variable nband */ + if (nband_capi == Py_None) nband = shape(self_energy, 1); else + f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.hilbert_transform_via_fft() 2nd keyword (nband) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(self_energy, 1) == nband,"shape(self_energy, 1) == nband","2nd keyword nband","hilbert_transform_via_fft:nband=%d",nband) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,&nband,self_energy); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(self_energy, 1) == nband)*/ + } /*if (f2py_success) of nband*/ + /* End of cleaning variable nband */ + } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { + Py_XDECREF(capi_self_energy_as_array); } + } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ + /* End of cleaning variable self_energy */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************** end of hilbert_transform_via_fft **********************/ + +/************************************* ht *************************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_ht[] = "\ +ht(x,[n])\n\nWrapper for ``ht``.\ +\n\nParameters\n----------\n" +"x : in/output rank-1 array('d') with bounds (n)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(x, 0)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_ht(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *x = NULL; + npy_intp x_Dims[1] = {-1}; + const int x_Rank = 1; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + int n = 0; + PyObject *n_capi = Py_None; + static char *capi_kwlist[] = {"x","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:thermal_conductivity.get_lf.ht",\ + capi_kwlist,&x_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + ; + capi_x_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.ht: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (double *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(x, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"thermal_conductivity.get_lf.ht() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(x, 0) == n,"shape(x, 0) == n","1st keyword n","ht:n=%d",n) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(x,&n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(x, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of ht *********************************/ + +/************************************ cfft ************************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_cfft[] = "\ +cfft(x,isig,[n])\n\nWrapper for ``cfft``.\ +\n\nParameters\n----------\n" +"x : in/output rank-1 array('D') with bounds (n)\n" +"isig : input int\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(x, 0)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_cfft(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *x = NULL; + npy_intp x_Dims[1] = {-1}; + const int x_Rank = 1; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + int n = 0; + PyObject *n_capi = Py_None; + int isig = 0; + PyObject *isig_capi = Py_None; + static char *capi_kwlist[] = {"x","isig","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thermal_conductivity.get_lf.cfft",\ + capi_kwlist,&x_capi,&isig_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable isig */ + f2py_success = int_from_pyobj(&isig,isig_capi,"thermal_conductivity.get_lf.cfft() 2nd argument (isig) can't be converted to int"); + if (f2py_success) { + /* Processing variable x */ + ; + capi_x_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.cfft: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (complex_double *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(x, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"thermal_conductivity.get_lf.cfft() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(x, 0) == n,"shape(x, 0) == n","1st keyword n","cfft:n=%d",n) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(x,&n,&isig); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(x, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ + } /*if (f2py_success) of isig*/ + /* End of cleaning variable isig */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of cfft ********************************/ + +/************************************ inv ************************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_inv[] = "\ +ainv = inv(a)\n\nWrapper for ``inv``.\ +\n\nParameters\n----------\n" +"a : input rank-2 array('d') with bounds (f2py_a_d0,f2py_a_d1)\n" +"\nReturns\n-------\n" +"ainv : rank-2 array('d') with bounds (size(a, 1),size(a, 2)) and invf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_inv(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *invf2pywrap = NULL; + npy_intp invf2pywrap_Dims[2] = {-1, -1}; + const int invf2pywrap_Rank = 2; + PyArrayObject *capi_invf2pywrap_as_array = NULL; + int capi_invf2pywrap_intent = 0; + double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int f2py_a_d0 = 0; + int f2py_a_d1 = 0; + static char *capi_kwlist[] = {"a",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thermal_conductivity.get_lf.inv",\ + capi_kwlist,&a_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.inv: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable invf2pywrap */ + invf2pywrap_Dims[0]=size(a, 1),invf2pywrap_Dims[1]=size(a, 2); + capi_invf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.inv: failed to create array from the hidden `invf2pywrap`"; + capi_invf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,invf2pywrap_Dims,invf2pywrap_Rank, capi_invf2pywrap_intent,Py_None,capi_errmess); + if (capi_invf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + invf2pywrap = (double *)(PyArray_DATA(capi_invf2pywrap_as_array)); + + /* Processing variable f2py_a_d0 */ + f2py_a_d0 = shape(a, 0); + /* Processing variable f2py_a_d1 */ + f2py_a_d1 = shape(a, 1); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(invf2pywrap,a,&f2py_a_d0,&f2py_a_d1); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_invf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_a_d1 */ + /* End of cleaning variable f2py_a_d0 */ + } /* if (capi_invf2pywrap_as_array == NULL) ... else of invf2pywrap */ + /* End of cleaning variable invf2pywrap */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of inv *********************************/ + +/****************************** interpolate_fc2 ******************************/ +static char doc_f2py_rout_thermal_conductivity_get_lf_interpolate_fc2[] = "\ +w2_q,pols_q,pols_q1 = interpolate_fc2(fc2,r2_2,masses,pos,q,[nfc2,nat])\n\nWrapper for ``interpolate_fc2``.\ +\n\nParameters\n----------\n" +"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" +"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" +"masses : input rank-1 array('d') with bounds (nat)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"q : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" +"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" +"\nReturns\n-------\n" +"w2_q : rank-1 array('d') with bounds (3 * nat)\n" +"pols_q : rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"pols_q1 : rank-2 array('D') with bounds (3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_get_lf_interpolate_fc2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,double*,double*,double*,double*,double*,double*,complex_double*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nfc2 = 0; + PyObject *nfc2_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double *fc2 = NULL; + npy_intp fc2_Dims[3] = {-1, -1, -1}; + const int fc2_Rank = 3; + PyArrayObject *capi_fc2_as_array = NULL; + int capi_fc2_intent = 0; + PyObject *fc2_capi = Py_None; + double *r2_2 = NULL; + npy_intp r2_2_Dims[2] = {-1, -1}; + const int r2_2_Rank = 2; + PyArrayObject *capi_r2_2_as_array = NULL; + int capi_r2_2_intent = 0; + PyObject *r2_2_capi = Py_None; + double *masses = NULL; + npy_intp masses_Dims[1] = {-1}; + const int masses_Rank = 1; + PyArrayObject *capi_masses_as_array = NULL; + int capi_masses_intent = 0; + PyObject *masses_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *q = NULL; + npy_intp q_Dims[1] = {-1}; + const int q_Rank = 1; + PyArrayObject *capi_q_as_array = NULL; + int capi_q_intent = 0; + PyObject *q_capi = Py_None; + double *w2_q = NULL; + npy_intp w2_q_Dims[1] = {-1}; + const int w2_q_Rank = 1; + PyArrayObject *capi_w2_q_as_array = NULL; + int capi_w2_q_intent = 0; + complex_double *pols_q = NULL; + npy_intp pols_q_Dims[2] = {-1, -1}; + const int pols_q_Rank = 2; + PyArrayObject *capi_pols_q_as_array = NULL; + int capi_pols_q_intent = 0; + complex_double *pols_q1 = NULL; + npy_intp pols_q1_Dims[2] = {-1, -1}; + const int pols_q1_Rank = 2; + PyArrayObject *capi_pols_q1_as_array = NULL; + int capi_pols_q1_intent = 0; + static char *capi_kwlist[] = {"fc2","r2_2","masses","pos","q","nfc2","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:thermal_conductivity.get_lf.interpolate_fc2",\ + capi_kwlist,&fc2_capi,&r2_2_capi,&masses_capi,&pos_capi,&q_capi,&nfc2_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc2 */ + ; + capi_fc2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 1st argument `fc2`"; + capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); + if (capi_fc2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); + + /* Processing variable q */ + q_Dims[0]=3; + capi_q_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 5th argument `q`"; + capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); + if (capi_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q = (double *)(PyArray_DATA(capi_q_as_array)); + + /* Processing variable nfc2 */ + if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else + f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.interpolate_fc2() 1st keyword (nfc2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","1st keyword nfc2","interpolate_fc2:nfc2=%d",nfc2) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.interpolate_fc2() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","2nd keyword nat","interpolate_fc2:nat=%d",nat) { + /* Processing variable r2_2 */ + r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; + capi_r2_2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 2nd argument `r2_2`"; + capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); + if (capi_r2_2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 4th argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable masses */ + masses_Dims[0]=nat; + capi_masses_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 3rd argument `masses`"; + capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); + if (capi_masses_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + masses = (double *)(PyArray_DATA(capi_masses_as_array)); + + /* Processing variable w2_q */ + w2_q_Dims[0]=3 * nat; + capi_w2_q_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the hidden `w2_q`"; + capi_w2_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w2_q_Dims,w2_q_Rank, capi_w2_q_intent,Py_None,capi_errmess); + if (capi_w2_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w2_q = (double *)(PyArray_DATA(capi_w2_q_as_array)); + + /* Processing variable pols_q */ + pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; + capi_pols_q_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the hidden `pols_q`"; + capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,Py_None,capi_errmess); + if (capi_pols_q_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); + + /* Processing variable pols_q1 */ + pols_q1_Dims[0]=3 * nat,pols_q1_Dims[1]=3 * nat; + capi_pols_q1_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the hidden `pols_q1`"; + capi_pols_q1_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q1_Dims,pols_q1_Rank, capi_pols_q1_intent,Py_None,capi_errmess); + if (capi_pols_q1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pols_q1 = (complex_double *)(PyArray_DATA(capi_pols_q1_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nfc2,&nat,fc2,r2_2,masses,pos,q,w2_q,pols_q,pols_q1); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNN",capi_w2_q_as_array,capi_pols_q_as_array,capi_pols_q1_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_pols_q1_as_array == NULL) ... else of pols_q1 */ + /* End of cleaning variable pols_q1 */ + } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ + /* End of cleaning variable pols_q */ + } /* if (capi_w2_q_as_array == NULL) ... else of w2_q */ + /* End of cleaning variable w2_q */ + if((PyObject *)capi_masses_as_array!=masses_capi) { + Py_XDECREF(capi_masses_as_array); } + } /* if (capi_masses_as_array == NULL) ... else of masses */ + /* End of cleaning variable masses */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { + Py_XDECREF(capi_r2_2_as_array); } + } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ + /* End of cleaning variable r2_2 */ + } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ + } /*if (f2py_success) of nfc2*/ + /* End of cleaning variable nfc2 */ + if((PyObject *)capi_q_as_array!=q_capi) { + Py_XDECREF(capi_q_as_array); } + } /* if (capi_q_as_array == NULL) ... else of q */ + /* End of cleaning variable q */ + if((PyObject *)capi_fc2_as_array!=fc2_capi) { + Py_XDECREF(capi_fc2_as_array); } + } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ + /* End of cleaning variable fc2 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of interpolate_fc2 ***************************/ + +/*************************** get_scattering_q_grid ***************************/ +static char doc_f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid[] = "\ +scattering_grid,scattering_weights = get_scattering_q_grid(rotations,irrqgrid,qgrid,scatt_qgrid,[nirrqpt,nqpt,scatt_nqpt,nsym])\n\nWrapper for ``get_scattering_q_grid``.\ +\n\nParameters\n----------\n" +"rotations : input rank-3 array('d') with bounds (nsym,3,3)\n" +"irrqgrid : input rank-2 array('d') with bounds (nirrqpt,3)\n" +"qgrid : input rank-2 array('d') with bounds (nqpt,3)\n" +"scatt_qgrid : input rank-2 array('d') with bounds (scatt_nqpt,3)\n" +"\nOther Parameters\n----------------\n" +"nirrqpt : input int, optional\n Default: shape(irrqgrid, 0)\n" +"nqpt : input int, optional\n Default: shape(qgrid, 0)\n" +"scatt_nqpt : input int, optional\n Default: shape(scatt_qgrid, 0)\n" +"nsym : input int, optional\n Default: shape(rotations, 0)\n" +"\nReturns\n-------\n" +"scattering_grid : rank-3 array('d') with bounds (nirrqpt,scatt_nqpt,3)\n" +"scattering_weights : rank-2 array('i') with bounds (nirrqpt,scatt_nqpt)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,int*,int*,int*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *rotations = NULL; + npy_intp rotations_Dims[3] = {-1, -1, -1}; + const int rotations_Rank = 3; + PyArrayObject *capi_rotations_as_array = NULL; + int capi_rotations_intent = 0; + PyObject *rotations_capi = Py_None; + double *irrqgrid = NULL; + npy_intp irrqgrid_Dims[2] = {-1, -1}; + const int irrqgrid_Rank = 2; + PyArrayObject *capi_irrqgrid_as_array = NULL; + int capi_irrqgrid_intent = 0; + PyObject *irrqgrid_capi = Py_None; + double *qgrid = NULL; + npy_intp qgrid_Dims[2] = {-1, -1}; + const int qgrid_Rank = 2; + PyArrayObject *capi_qgrid_as_array = NULL; + int capi_qgrid_intent = 0; + PyObject *qgrid_capi = Py_None; + double *scatt_qgrid = NULL; + npy_intp scatt_qgrid_Dims[2] = {-1, -1}; + const int scatt_qgrid_Rank = 2; + PyArrayObject *capi_scatt_qgrid_as_array = NULL; + int capi_scatt_qgrid_intent = 0; + PyObject *scatt_qgrid_capi = Py_None; + int nirrqpt = 0; + PyObject *nirrqpt_capi = Py_None; + int nqpt = 0; + PyObject *nqpt_capi = Py_None; + int scatt_nqpt = 0; + PyObject *scatt_nqpt_capi = Py_None; + int nsym = 0; + PyObject *nsym_capi = Py_None; + double *scattering_grid = NULL; + npy_intp scattering_grid_Dims[3] = {-1, -1, -1}; + const int scattering_grid_Rank = 3; + PyArrayObject *capi_scattering_grid_as_array = NULL; + int capi_scattering_grid_intent = 0; + int *scattering_weights = NULL; + npy_intp scattering_weights_Dims[2] = {-1, -1}; + const int scattering_weights_Rank = 2; + PyArrayObject *capi_scattering_weights_as_array = NULL; + int capi_scattering_weights_intent = 0; + static char *capi_kwlist[] = {"rotations","irrqgrid","qgrid","scatt_qgrid","nirrqpt","nqpt","scatt_nqpt","nsym",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|OOOO:thermal_conductivity.scattering_grids.get_scattering_q_grid",\ + capi_kwlist,&rotations_capi,&irrqgrid_capi,&qgrid_capi,&scatt_qgrid_capi,&nirrqpt_capi,&nqpt_capi,&scatt_nqpt_capi,&nsym_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable rotations */ + rotations_Dims[1]=3,rotations_Dims[2]=3; + capi_rotations_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 1st argument `rotations`"; + capi_rotations_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rotations_Dims,rotations_Rank, capi_rotations_intent,rotations_capi,capi_errmess); + if (capi_rotations_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rotations = (double *)(PyArray_DATA(capi_rotations_as_array)); + + /* Processing variable irrqgrid */ + irrqgrid_Dims[1]=3; + capi_irrqgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 2nd argument `irrqgrid`"; + capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); + if (capi_irrqgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); + + /* Processing variable qgrid */ + qgrid_Dims[1]=3; + capi_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 3rd argument `qgrid`"; + capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); + if (capi_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); + + /* Processing variable scatt_qgrid */ + scatt_qgrid_Dims[1]=3; + capi_scatt_qgrid_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 4th argument `scatt_qgrid`"; + capi_scatt_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,scatt_qgrid_Dims,scatt_qgrid_Rank, capi_scatt_qgrid_intent,scatt_qgrid_capi,capi_errmess); + if (capi_scatt_qgrid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scatt_qgrid = (double *)(PyArray_DATA(capi_scatt_qgrid_as_array)); + + /* Processing variable nirrqpt */ + if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 0); else + f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 1st keyword (nirrqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(irrqgrid, 0) == nirrqpt,"shape(irrqgrid, 0) == nirrqpt","1st keyword nirrqpt","get_scattering_q_grid:nirrqpt=%d",nirrqpt) { + /* Processing variable nqpt */ + if (nqpt_capi == Py_None) nqpt = shape(qgrid, 0); else + f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 2nd keyword (nqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(qgrid, 0) == nqpt,"shape(qgrid, 0) == nqpt","2nd keyword nqpt","get_scattering_q_grid:nqpt=%d",nqpt) { + /* Processing variable nsym */ + if (nsym_capi == Py_None) nsym = shape(rotations, 0); else + f2py_success = int_from_pyobj(&nsym,nsym_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 4th keyword (nsym) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(rotations, 0) == nsym,"shape(rotations, 0) == nsym","4th keyword nsym","get_scattering_q_grid:nsym=%d",nsym) { + /* Processing variable scatt_nqpt */ + if (scatt_nqpt_capi == Py_None) scatt_nqpt = shape(scatt_qgrid, 0); else + f2py_success = int_from_pyobj(&scatt_nqpt,scatt_nqpt_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 3rd keyword (scatt_nqpt) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(scatt_qgrid, 0) == scatt_nqpt,"shape(scatt_qgrid, 0) == scatt_nqpt","3rd keyword scatt_nqpt","get_scattering_q_grid:scatt_nqpt=%d",scatt_nqpt) { + /* Processing variable scattering_grid */ + scattering_grid_Dims[0]=nirrqpt,scattering_grid_Dims[1]=scatt_nqpt,scattering_grid_Dims[2]=3; + capi_scattering_grid_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the hidden `scattering_grid`"; + capi_scattering_grid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,scattering_grid_Dims,scattering_grid_Rank, capi_scattering_grid_intent,Py_None,capi_errmess); + if (capi_scattering_grid_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scattering_grid = (double *)(PyArray_DATA(capi_scattering_grid_as_array)); + + /* Processing variable scattering_weights */ + scattering_weights_Dims[0]=nirrqpt,scattering_weights_Dims[1]=scatt_nqpt; + capi_scattering_weights_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the hidden `scattering_weights`"; + capi_scattering_weights_as_array = ndarray_from_pyobj( NPY_INT,1,scattering_weights_Dims,scattering_weights_Rank, capi_scattering_weights_intent,Py_None,capi_errmess); + if (capi_scattering_weights_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + scattering_weights = (int *)(PyArray_DATA(capi_scattering_weights_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(rotations,irrqgrid,qgrid,scatt_qgrid,&nirrqpt,&nqpt,&scatt_nqpt,&nsym,scattering_grid,scattering_weights); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NN",capi_scattering_grid_as_array,capi_scattering_weights_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_scattering_weights_as_array == NULL) ... else of scattering_weights */ + /* End of cleaning variable scattering_weights */ + } /* if (capi_scattering_grid_as_array == NULL) ... else of scattering_grid */ + /* End of cleaning variable scattering_grid */ + } /*CHECKSCALAR(shape(scatt_qgrid, 0) == scatt_nqpt)*/ + } /*if (f2py_success) of scatt_nqpt*/ + /* End of cleaning variable scatt_nqpt */ + } /*CHECKSCALAR(shape(rotations, 0) == nsym)*/ + } /*if (f2py_success) of nsym*/ + /* End of cleaning variable nsym */ + } /*CHECKSCALAR(shape(qgrid, 0) == nqpt)*/ + } /*if (f2py_success) of nqpt*/ + /* End of cleaning variable nqpt */ + } /*CHECKSCALAR(shape(irrqgrid, 0) == nirrqpt)*/ + } /*if (f2py_success) of nirrqpt*/ + /* End of cleaning variable nirrqpt */ + if((PyObject *)capi_scatt_qgrid_as_array!=scatt_qgrid_capi) { + Py_XDECREF(capi_scatt_qgrid_as_array); } + } /* if (capi_scatt_qgrid_as_array == NULL) ... else of scatt_qgrid */ + /* End of cleaning variable scatt_qgrid */ + if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { + Py_XDECREF(capi_qgrid_as_array); } + } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ + /* End of cleaning variable qgrid */ + if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { + Py_XDECREF(capi_irrqgrid_as_array); } + } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ + /* End of cleaning variable irrqgrid */ + if((PyObject *)capi_rotations_as_array!=rotations_capi) { + Py_XDECREF(capi_rotations_as_array); } + } /* if (capi_rotations_as_array == NULL) ... else of rotations */ + /* End of cleaning variable rotations */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of get_scattering_q_grid ************************/ + +/******************************** same_vector ********************************/ +static char doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector[] = "\ +same_vector = same_vector(v1,v2)\n\nWrapper for ``same_vector``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"same_vector : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_scattering_grids_same_vector(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int same_vectorf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.scattering_grids.same_vector",\ + capi_kwlist,&v1_capi,&v2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable same_vectorf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&same_vectorf2pywrap,v1,v2); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",same_vectorf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable same_vectorf2pywrap */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of same_vector *****************************/ + +/***************************** same_vector_nopbc *****************************/ +static char doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc[] = "\ +same_vector_nopbc = same_vector_nopbc(v1,v2)\n\nWrapper for ``same_vector_nopbc``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"same_vector_nopbc : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int same_vector_nopbcf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.scattering_grids.same_vector_nopbc",\ + capi_kwlist,&v1_capi,&v2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector_nopbc: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector_nopbc: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable same_vector_nopbcf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&same_vector_nopbcf2pywrap,v1,v2); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",same_vector_nopbcf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable same_vector_nopbcf2pywrap */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of same_vector_nopbc **************************/ + +/********************************** analysis **********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_analysis[] = "\ +weight,xr2,xr3 = analysis(far,tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,[nat,n_blocks])\n\nWrapper for ``analysis``.\ +\n\nParameters\n----------\n" +"far : input int\n" +"tol : input float\n" +"dmax : input rank-1 array('d') with bounds (nat)\n" +"sc_size : input rank-1 array('i') with bounds (3)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"tau : input rank-2 array('d') with bounds (nat,3)\n" +"tensor : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(dmax, 0)\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"\nReturns\n-------\n" +"weight : rank-4 array('i') with bounds (nat,nat,nat,n_blocks)\n" +"xr2 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)\n" +"xr3 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_analysis(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,int*,int*,int*,double*,double*,double*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int far = 0; + PyObject *far_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + double *dmax = NULL; + npy_intp dmax_Dims[1] = {-1}; + const int dmax_Rank = 1; + PyArrayObject *capi_dmax_as_array = NULL; + int capi_dmax_intent = 0; + PyObject *dmax_capi = Py_None; + int *sc_size = NULL; + npy_intp sc_size_Dims[1] = {-1}; + const int sc_size_Rank = 1; + PyArrayObject *capi_sc_size_as_array = NULL; + int capi_sc_size_intent = 0; + PyObject *sc_size_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr3_list = NULL; + npy_intp xr3_list_Dims[2] = {-1, -1}; + const int xr3_list_Rank = 2; + PyArrayObject *capi_xr3_list_as_array = NULL; + int capi_xr3_list_intent = 0; + PyObject *xr3_list_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[4] = {-1, -1, -1, -1}; + const int weight_Rank = 4; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + int *xr2 = NULL; + npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr2_Rank = 6; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + int *xr3 = NULL; + npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr3_Rank = 6; + PyArrayObject *capi_xr3_as_array = NULL; + int capi_xr3_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"far","tol","dmax","sc_size","xr2_list","xr3_list","alat","tau","tensor","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOO|OO:thermal_conductivity.third_order_centering.analysis",\ + capi_kwlist,&far_capi,&tol_capi,&dmax_capi,&sc_size_capi,&xr2_list_capi,&xr3_list_capi,&alat_capi,&tau_capi,&tensor_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.analysis() 1st argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable dmax */ + ; + capi_dmax_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 3rd argument `dmax`"; + capi_dmax_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dmax_Dims,dmax_Rank, capi_dmax_intent,dmax_capi,capi_errmess); + if (capi_dmax_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dmax = (double *)(PyArray_DATA(capi_dmax_as_array)); + + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 7th argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 5th argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"thermal_conductivity.third_order_centering.analysis() 2nd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable sc_size */ + sc_size_Dims[0]=3; + capi_sc_size_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 4th argument `sc_size`"; + capi_sc_size_as_array = ndarray_from_pyobj( NPY_INT,1,sc_size_Dims,sc_size_Rank, capi_sc_size_intent,sc_size_capi,capi_errmess); + if (capi_sc_size_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sc_size = (int *)(PyArray_DATA(capi_sc_size_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(dmax, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.analysis() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(dmax, 0) == nat,"shape(dmax, 0) == nat","1st keyword nat","analysis:nat=%d",nat) { + /* Processing variable tau */ + tau_Dims[0]=nat,tau_Dims[1]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 8th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_centering.analysis() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","analysis:n_blocks=%d",n_blocks) { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks; + capi_weight_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the hidden `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,Py_None,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks; + capi_xr2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the hidden `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,Py_None,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + /* Processing variable xr3 */ + xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks; + capi_xr3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the hidden `xr3`"; + capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,Py_None,capi_errmess); + if (capi_xr3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); + + /* Processing variable xr3_list */ + xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; + capi_xr3_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 6th argument `xr3_list`"; + capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); + if (capi_xr3_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); + + /* Processing variable tensor */ + tensor_Dims[0]=3 * nat,tensor_Dims[1]=3 * nat,tensor_Dims[2]=3 * nat,tensor_Dims[3]=n_blocks; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 9th argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&far,&tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,weight,xr2,xr3,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNN",capi_weight_as_array,capi_xr2_as_array,capi_xr3_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ + if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { + Py_XDECREF(capi_xr3_list_as_array); } + } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ + /* End of cleaning variable xr3_list */ + } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ + /* End of cleaning variable xr3 */ + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*CHECKSCALAR(shape(dmax, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_sc_size_as_array!=sc_size_capi) { + Py_XDECREF(capi_sc_size_as_array); } + } /* if (capi_sc_size_as_array == NULL) ... else of sc_size */ + /* End of cleaning variable sc_size */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + if((PyObject *)capi_dmax_as_array!=dmax_capi) { + Py_XDECREF(capi_dmax_as_array); } + } /* if (capi_dmax_as_array == NULL) ... else of dmax */ + /* End of cleaning variable dmax */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of analysis ******************************/ + +/*********************************** center ***********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_center[] = "\ +centered = center(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_blocks,n_blocks_old])\n\nWrapper for ``center``.\ +\n\nParameters\n----------\n" +"original : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks_old)\n" +"weight : input rank-4 array('i') with bounds (nat,nat,nat,n_blocks_old)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" +"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr3 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" +"far : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(original, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"n_blocks_old : input int, optional\n Default: shape(original, 3)\n" +"\nReturns\n-------\n" +"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_center(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,int*,int*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *original = NULL; + npy_intp original_Dims[4] = {-1, -1, -1, -1}; + const int original_Rank = 4; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[4] = {-1, -1, -1, -1}; + const int weight_Rank = 4; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + PyObject *weight_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr2_Rank = 6; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr3_list = NULL; + npy_intp xr3_list_Dims[2] = {-1, -1}; + const int xr3_list_Rank = 2; + PyArrayObject *capi_xr3_list_as_array = NULL; + int capi_xr3_list_intent = 0; + PyObject *xr3_list_capi = Py_None; + int *xr3 = NULL; + npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr3_Rank = 6; + PyArrayObject *capi_xr3_as_array = NULL; + int capi_xr3_intent = 0; + PyObject *xr3_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[4] = {-1, -1, -1, -1}; + const int centered_Rank = 4; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int far = 0; + PyObject *far_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int n_blocks_old = 0; + PyObject *n_blocks_old_capi = Py_None; + static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_blocks","n_blocks_old",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OOO:thermal_conductivity.third_order_centering.center",\ + capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_blocks_capi,&n_blocks_old_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.center() 7th argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 3rd argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable original */ + ; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 1st argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(original, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.center() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_centering.center() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","center:n_blocks=%d",n_blocks) { + /* Processing variable xr3_list */ + xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; + capi_xr3_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 5th argument `xr3_list`"; + capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); + if (capi_xr3_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); + + /* Processing variable n_blocks_old */ + if (n_blocks_old_capi == Py_None) n_blocks_old = shape(original, 3); else + f2py_success = int_from_pyobj(&n_blocks_old,n_blocks_old_capi,"thermal_conductivity.third_order_centering.center() 3rd keyword (n_blocks_old) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 3) == n_blocks_old,"shape(original, 3) == n_blocks_old","3rd keyword n_blocks_old","center:n_blocks_old=%d",n_blocks_old) { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks_old; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 4th argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","4th argument xr2") { + /* Processing variable xr3 */ + xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks_old; + capi_xr3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 6th argument `xr3`"; + capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); + if (capi_xr3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); + + CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","6th argument xr3") { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks_old; + capi_weight_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 2nd argument `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,&nat,centered,&far,&n_blocks,&n_blocks_old); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_centered_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_weight_as_array!=weight_capi) { + Py_XDECREF(capi_weight_as_array); } + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ + if((PyObject *)capi_xr3_as_array!=xr3_capi) { + Py_XDECREF(capi_xr3_as_array); } + } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ + /* End of cleaning variable xr3 */ + } /*CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKSCALAR(shape(original, 3) == n_blocks_old)*/ + } /*if (f2py_success) of n_blocks_old*/ + /* End of cleaning variable n_blocks_old */ + if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { + Py_XDECREF(capi_xr3_list_as_array); } + } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ + /* End of cleaning variable xr3_list */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of center *******************************/ + +/******************************* center_sparse *******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_center_sparse[] = "\ +centered,n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list = center_sparse(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_sup,n_blocks])\n\nWrapper for ``center_sparse``.\ +\n\nParameters\n----------\n" +"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup,n_sup)\n" +"weight : input rank-5 array('i') with bounds (nat,nat,n_sup,nat,n_sup)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" +"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr3 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" +"far : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(original, 0) / 3\n" +"n_sup : input int, optional\n Default: shape(original, 3)\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"\nReturns\n-------\n" +"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"n_sparse_blocks : int\n" +"xr2_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" +"xr3_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" +"atom_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" +"r_blocks_sparse_list : rank-1 array('i') with bounds (n_blocks * nat * nat * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_center_sparse(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,int*,double*,int*,int*,int*,int*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *original = NULL; + npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; + const int original_Rank = 5; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[5] = {-1, -1, -1, -1, -1}; + const int weight_Rank = 5; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + PyObject *weight_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int xr2_Rank = 7; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr3_list = NULL; + npy_intp xr3_list_Dims[2] = {-1, -1}; + const int xr3_list_Rank = 2; + PyArrayObject *capi_xr3_list_as_array = NULL; + int capi_xr3_list_intent = 0; + PyObject *xr3_list_capi = Py_None; + int *xr3 = NULL; + npy_intp xr3_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int xr3_Rank = 7; + PyArrayObject *capi_xr3_as_array = NULL; + int capi_xr3_intent = 0; + PyObject *xr3_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[4] = {-1, -1, -1, -1}; + const int centered_Rank = 4; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int n_sparse_blocks = 0; + int *xr2_sparse_list = NULL; + npy_intp xr2_sparse_list_Dims[2] = {-1, -1}; + const int xr2_sparse_list_Rank = 2; + PyArrayObject *capi_xr2_sparse_list_as_array = NULL; + int capi_xr2_sparse_list_intent = 0; + int *xr3_sparse_list = NULL; + npy_intp xr3_sparse_list_Dims[2] = {-1, -1}; + const int xr3_sparse_list_Rank = 2; + PyArrayObject *capi_xr3_sparse_list_as_array = NULL; + int capi_xr3_sparse_list_intent = 0; + int *atom_sparse_list = NULL; + npy_intp atom_sparse_list_Dims[2] = {-1, -1}; + const int atom_sparse_list_Rank = 2; + PyArrayObject *capi_atom_sparse_list_as_array = NULL; + int capi_atom_sparse_list_intent = 0; + int *r_blocks_sparse_list = NULL; + npy_intp r_blocks_sparse_list_Dims[1] = {-1}; + const int r_blocks_sparse_list_Rank = 1; + PyArrayObject *capi_r_blocks_sparse_list_as_array = NULL; + int capi_r_blocks_sparse_list_intent = 0; + int far = 0; + PyObject *far_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_sup = 0; + PyObject *n_sup_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_sup","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OOO:thermal_conductivity.third_order_centering.center_sparse",\ + capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_sup_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.center_sparse() 7th argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 3rd argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable original */ + ; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 1st argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + /* Processing variable n_sparse_blocks */ + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(original, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.center_sparse() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center_sparse:nat=%d",nat) { + /* Processing variable n_sup */ + if (n_sup_capi == Py_None) n_sup = shape(original, 3); else + f2py_success = int_from_pyobj(&n_sup,n_sup_capi,"thermal_conductivity.third_order_centering.center_sparse() 2nd keyword (n_sup) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 3) == n_sup,"shape(original, 3) == n_sup","2nd keyword n_sup","center_sparse:n_sup=%d",n_sup) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_centering.center_sparse() 3rd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","3rd keyword n_blocks","center_sparse:n_blocks=%d",n_blocks) { + /* Processing variable xr3_list */ + xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; + capi_xr3_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 5th argument `xr3_list`"; + capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); + if (capi_xr3_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_sup,xr2_Dims[5]=nat,xr2_Dims[6]=n_sup; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 4th argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","4th argument xr2") { + /* Processing variable xr3 */ + xr3_Dims[0]=3,xr3_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=n_sup,xr3_Dims[5]=nat,xr3_Dims[6]=n_sup; + capi_xr3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 6th argument `xr3`"; + capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); + if (capi_xr3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); + + CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","6th argument xr3") { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_sup,weight_Dims[3]=nat,weight_Dims[4]=n_sup; + capi_weight_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 2nd argument `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable xr2_sparse_list */ + xr2_sparse_list_Dims[0]=3,xr2_sparse_list_Dims[1]=n_blocks * nat * nat * nat; + capi_xr2_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `xr2_sparse_list`"; + capi_xr2_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_sparse_list_Dims,xr2_sparse_list_Rank, capi_xr2_sparse_list_intent,Py_None,capi_errmess); + if (capi_xr2_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_sparse_list = (int *)(PyArray_DATA(capi_xr2_sparse_list_as_array)); + + /* Processing variable xr3_sparse_list */ + xr3_sparse_list_Dims[0]=3,xr3_sparse_list_Dims[1]=n_blocks * nat * nat * nat; + capi_xr3_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `xr3_sparse_list`"; + capi_xr3_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_sparse_list_Dims,xr3_sparse_list_Rank, capi_xr3_sparse_list_intent,Py_None,capi_errmess); + if (capi_xr3_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_sparse_list = (int *)(PyArray_DATA(capi_xr3_sparse_list_as_array)); + + /* Processing variable atom_sparse_list */ + atom_sparse_list_Dims[0]=3,atom_sparse_list_Dims[1]=n_blocks * nat * nat * nat; + capi_atom_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `atom_sparse_list`"; + capi_atom_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,atom_sparse_list_Dims,atom_sparse_list_Rank, capi_atom_sparse_list_intent,Py_None,capi_errmess); + if (capi_atom_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + atom_sparse_list = (int *)(PyArray_DATA(capi_atom_sparse_list_as_array)); + + /* Processing variable r_blocks_sparse_list */ + r_blocks_sparse_list_Dims[0]=n_blocks * nat * nat * nat; + capi_r_blocks_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `r_blocks_sparse_list`"; + capi_r_blocks_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,r_blocks_sparse_list_Dims,r_blocks_sparse_list_Rank, capi_r_blocks_sparse_list_intent,Py_None,capi_errmess); + if (capi_r_blocks_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_blocks_sparse_list = (int *)(PyArray_DATA(capi_r_blocks_sparse_list_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,centered,&n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list,&far,&nat,&n_sup,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NiNNNN",capi_centered_as_array,n_sparse_blocks,capi_xr2_sparse_list_as_array,capi_xr3_sparse_list_as_array,capi_atom_sparse_list_as_array,capi_r_blocks_sparse_list_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_r_blocks_sparse_list_as_array == NULL) ... else of r_blocks_sparse_list */ + /* End of cleaning variable r_blocks_sparse_list */ + } /* if (capi_atom_sparse_list_as_array == NULL) ... else of atom_sparse_list */ + /* End of cleaning variable atom_sparse_list */ + } /* if (capi_xr3_sparse_list_as_array == NULL) ... else of xr3_sparse_list */ + /* End of cleaning variable xr3_sparse_list */ + } /* if (capi_xr2_sparse_list_as_array == NULL) ... else of xr2_sparse_list */ + /* End of cleaning variable xr2_sparse_list */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + if((PyObject *)capi_weight_as_array!=weight_capi) { + Py_XDECREF(capi_weight_as_array); } + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ + if((PyObject *)capi_xr3_as_array!=xr3_capi) { + Py_XDECREF(capi_xr3_as_array); } + } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ + /* End of cleaning variable xr3 */ + } /*CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { + Py_XDECREF(capi_xr3_list_as_array); } + } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ + /* End of cleaning variable xr3_list */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(original, 3) == n_sup)*/ + } /*if (f2py_success) of n_sup*/ + /* End of cleaning variable n_sup */ + } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + /* End of cleaning variable n_sparse_blocks */ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of center_sparse ****************************/ + +/********************************* pre_center *********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_pre_center[] = "\ +centered,lat_min,lat_max = pre_center(far,nq1,nq2,nq3,tol,alat,tau,original,[nat])\n\nWrapper for ``pre_center``.\ +\n\nParameters\n----------\n" +"far : input int\n" +"nq1 : input int\n" +"nq2 : input int\n" +"nq3 : input int\n" +"tol : input float\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"tau : input rank-2 array('d') with bounds (nat,3)\n" +"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,nq1 * nq2 * nq3,nq1 * nq2 * nq3)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 0)\n" +"\nReturns\n-------\n" +"centered : rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3)\n" +"lat_min : rank-1 array('i') with bounds (3)\n" +"lat_max : rank-1 array('i') with bounds (3)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_pre_center(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,int*,double*,double*,double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int far = 0; + PyObject *far_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nq1 = 0; + PyObject *nq1_capi = Py_None; + int nq2 = 0; + PyObject *nq2_capi = Py_None; + int nq3 = 0; + PyObject *nq3_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *original = NULL; + npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; + const int original_Rank = 5; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[5] = {-1, -1, -1, -1, -1}; + const int centered_Rank = 5; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int *lat_min = NULL; + npy_intp lat_min_Dims[1] = {-1}; + const int lat_min_Rank = 1; + PyArrayObject *capi_lat_min_as_array = NULL; + int capi_lat_min_intent = 0; + int *lat_max = NULL; + npy_intp lat_max_Dims[1] = {-1}; + const int lat_max_Rank = 1; + PyArrayObject *capi_lat_max_as_array = NULL; + int capi_lat_max_intent = 0; + static char *capi_kwlist[] = {"far","nq1","nq2","nq3","tol","alat","tau","original","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|O:thermal_conductivity.third_order_centering.pre_center",\ + capi_kwlist,&far_capi,&nq1_capi,&nq2_capi,&nq3_capi,&tol_capi,&alat_capi,&tau_capi,&original_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nq1 */ + f2py_success = int_from_pyobj(&nq1,nq1_capi,"thermal_conductivity.third_order_centering.pre_center() 2nd argument (nq1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nq2 */ + f2py_success = int_from_pyobj(&nq2,nq2_capi,"thermal_conductivity.third_order_centering.pre_center() 3rd argument (nq2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nq3 */ + f2py_success = int_from_pyobj(&nq3,nq3_capi,"thermal_conductivity.third_order_centering.pre_center() 4th argument (nq3) can't be converted to int"); + if (f2py_success) { + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the 6th argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable tau */ + tau_Dims[1]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the 7th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.pre_center() 1st argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"thermal_conductivity.third_order_centering.pre_center() 5th argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable lat_min */ + lat_min_Dims[0]=3; + capi_lat_min_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the hidden `lat_min`"; + capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,Py_None,capi_errmess); + if (capi_lat_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); + + /* Processing variable lat_max */ + lat_max_Dims[0]=3; + capi_lat_max_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the hidden `lat_max`"; + capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,Py_None,capi_errmess); + if (capi_lat_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.pre_center() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 0) == nat,"shape(tau, 0) == nat","1st keyword nat","pre_center:nat=%d",nat) { + /* Processing variable original */ + original_Dims[0]=3 * nat,original_Dims[1]=3 * nat,original_Dims[2]=3 * nat,original_Dims[3]=nq1 * nq2 * nq3,original_Dims[4]=nq1 * nq2 * nq3; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the 8th argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { + CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { + CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,centered_Dims[4]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&far,&nat,&nq1,&nq2,&nq3,&tol,alat,tau,original,centered,lat_min,lat_max); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNN",capi_centered_as_array,capi_lat_min_as_array,capi_lat_max_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ + } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ + } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + } /*CHECKSCALAR(shape(tau, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ + /* End of cleaning variable lat_max */ + } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ + /* End of cleaning variable lat_min */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + } /*if (f2py_success) of nq3*/ + /* End of cleaning variable nq3 */ + } /*if (f2py_success) of nq2*/ + /* End of cleaning variable nq2 */ + } /*if (f2py_success) of nq1*/ + /* End of cleaning variable nq1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of pre_center *****************************/ + +/*********************************** assign ***********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_assign[] = "\ +centered,x2,x3,r2,r3 = assign(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,n_sup_ws,[nat,n_sup_ws_prev])\n\nWrapper for ``assign``.\ +\n\nParameters\n----------\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"lat_min_prev : input rank-1 array('i') with bounds (3)\n" +"lat_max_prev : input rank-1 array('i') with bounds (3)\n" +"centered_prev : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws_prev,n_sup_ws_prev)\n" +"lat_min : input rank-1 array('i') with bounds (3)\n" +"lat_max : input rank-1 array('i') with bounds (3)\n" +"n_sup_ws : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(centered_prev, 0) / 3\n" +"n_sup_ws_prev : input int, optional\n Default: shape(centered_prev, 3)\n" +"\nReturns\n-------\n" +"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws * n_sup_ws)\n" +"x2 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" +"x3 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" +"r2 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)\n" +"r3 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_assign(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,double*,int*,int*,int*,int*,int*,double*,int*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + int *lat_min_prev = NULL; + npy_intp lat_min_prev_Dims[1] = {-1}; + const int lat_min_prev_Rank = 1; + PyArrayObject *capi_lat_min_prev_as_array = NULL; + int capi_lat_min_prev_intent = 0; + PyObject *lat_min_prev_capi = Py_None; + int *lat_max_prev = NULL; + npy_intp lat_max_prev_Dims[1] = {-1}; + const int lat_max_prev_Rank = 1; + PyArrayObject *capi_lat_max_prev_as_array = NULL; + int capi_lat_max_prev_intent = 0; + PyObject *lat_max_prev_capi = Py_None; + double *centered_prev = NULL; + npy_intp centered_prev_Dims[5] = {-1, -1, -1, -1, -1}; + const int centered_prev_Rank = 5; + PyArrayObject *capi_centered_prev_as_array = NULL; + int capi_centered_prev_intent = 0; + PyObject *centered_prev_capi = Py_None; + int *lat_min = NULL; + npy_intp lat_min_Dims[1] = {-1}; + const int lat_min_Rank = 1; + PyArrayObject *capi_lat_min_as_array = NULL; + int capi_lat_min_intent = 0; + PyObject *lat_min_capi = Py_None; + int *lat_max = NULL; + npy_intp lat_max_Dims[1] = {-1}; + const int lat_max_Rank = 1; + PyArrayObject *capi_lat_max_as_array = NULL; + int capi_lat_max_intent = 0; + PyObject *lat_max_capi = Py_None; + int n_sup_ws = 0; + PyObject *n_sup_ws_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_sup_ws_prev = 0; + PyObject *n_sup_ws_prev_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[4] = {-1, -1, -1, -1}; + const int centered_Rank = 4; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int *x2 = NULL; + npy_intp x2_Dims[2] = {-1, -1}; + const int x2_Rank = 2; + PyArrayObject *capi_x2_as_array = NULL; + int capi_x2_intent = 0; + int *x3 = NULL; + npy_intp x3_Dims[2] = {-1, -1}; + const int x3_Rank = 2; + PyArrayObject *capi_x3_as_array = NULL; + int capi_x3_intent = 0; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + static char *capi_kwlist[] = {"alat","lat_min_prev","lat_max_prev","centered_prev","lat_min","lat_max","n_sup_ws","nat","n_sup_ws_prev",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OO:thermal_conductivity.third_order_centering.assign",\ + capi_kwlist,&alat_capi,&lat_min_prev_capi,&lat_max_prev_capi,¢ered_prev_capi,&lat_min_capi,&lat_max_capi,&n_sup_ws_capi,&nat_capi,&n_sup_ws_prev_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable n_sup_ws */ + f2py_success = int_from_pyobj(&n_sup_ws,n_sup_ws_capi,"thermal_conductivity.third_order_centering.assign() 7th argument (n_sup_ws) can't be converted to int"); + if (f2py_success) { + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 1st argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable lat_min_prev */ + lat_min_prev_Dims[0]=3; + capi_lat_min_prev_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 2nd argument `lat_min_prev`"; + capi_lat_min_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_prev_Dims,lat_min_prev_Rank, capi_lat_min_prev_intent,lat_min_prev_capi,capi_errmess); + if (capi_lat_min_prev_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_min_prev = (int *)(PyArray_DATA(capi_lat_min_prev_as_array)); + + /* Processing variable lat_max_prev */ + lat_max_prev_Dims[0]=3; + capi_lat_max_prev_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 3rd argument `lat_max_prev`"; + capi_lat_max_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_prev_Dims,lat_max_prev_Rank, capi_lat_max_prev_intent,lat_max_prev_capi,capi_errmess); + if (capi_lat_max_prev_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_max_prev = (int *)(PyArray_DATA(capi_lat_max_prev_as_array)); + + /* Processing variable lat_min */ + lat_min_Dims[0]=3; + capi_lat_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 5th argument `lat_min`"; + capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,lat_min_capi,capi_errmess); + if (capi_lat_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); + + /* Processing variable lat_max */ + lat_max_Dims[0]=3; + capi_lat_max_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 6th argument `lat_max`"; + capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,lat_max_capi,capi_errmess); + if (capi_lat_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); + + /* Processing variable centered_prev */ + ; + capi_centered_prev_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 4th argument `centered_prev`"; + capi_centered_prev_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_prev_Dims,centered_prev_Rank, capi_centered_prev_intent,centered_prev_capi,capi_errmess); + if (capi_centered_prev_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered_prev = (double *)(PyArray_DATA(capi_centered_prev_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(centered_prev, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.assign() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(centered_prev, 0) == 3 * nat,"shape(centered_prev, 0) == 3 * nat","1st keyword nat","assign:nat=%d",nat) { + /* Processing variable n_sup_ws_prev */ + if (n_sup_ws_prev_capi == Py_None) n_sup_ws_prev = shape(centered_prev, 3); else + f2py_success = int_from_pyobj(&n_sup_ws_prev,n_sup_ws_prev_capi,"thermal_conductivity.third_order_centering.assign() 2nd keyword (n_sup_ws_prev) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev,"shape(centered_prev, 3) == n_sup_ws_prev","2nd keyword n_sup_ws_prev","assign:n_sup_ws_prev=%d",n_sup_ws_prev) { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_sup_ws * n_sup_ws; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable x2 */ + x2_Dims[0]=3,x2_Dims[1]=n_sup_ws * n_sup_ws; + capi_x2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `x2`"; + capi_x2_as_array = ndarray_from_pyobj( NPY_INT,1,x2_Dims,x2_Rank, capi_x2_intent,Py_None,capi_errmess); + if (capi_x2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x2 = (int *)(PyArray_DATA(capi_x2_as_array)); + + /* Processing variable x3 */ + x3_Dims[0]=3,x3_Dims[1]=n_sup_ws * n_sup_ws; + capi_x3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `x3`"; + capi_x3_as_array = ndarray_from_pyobj( NPY_INT,1,x3_Dims,x3_Rank, capi_x3_intent,Py_None,capi_errmess); + if (capi_x3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x3 = (int *)(PyArray_DATA(capi_x3_as_array)); + + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_sup_ws * n_sup_ws; + capi_r2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,Py_None,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_sup_ws * n_sup_ws; + capi_r3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,Py_None,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,&n_sup_ws,&nat,&n_sup_ws_prev,centered,x2,x3,r2,r3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNNNN",capi_centered_as_array,capi_x2_as_array,capi_x3_as_array,capi_r2_as_array,capi_r3_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /* if (capi_x3_as_array == NULL) ... else of x3 */ + /* End of cleaning variable x3 */ + } /* if (capi_x2_as_array == NULL) ... else of x2 */ + /* End of cleaning variable x2 */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev)*/ + } /*if (f2py_success) of n_sup_ws_prev*/ + /* End of cleaning variable n_sup_ws_prev */ + } /*CHECKSCALAR(shape(centered_prev, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_centered_prev_as_array!=centered_prev_capi) { + Py_XDECREF(capi_centered_prev_as_array); } + } /* if (capi_centered_prev_as_array == NULL) ... else of centered_prev */ + /* End of cleaning variable centered_prev */ + if((PyObject *)capi_lat_max_as_array!=lat_max_capi) { + Py_XDECREF(capi_lat_max_as_array); } + } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ + /* End of cleaning variable lat_max */ + if((PyObject *)capi_lat_min_as_array!=lat_min_capi) { + Py_XDECREF(capi_lat_min_as_array); } + } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ + /* End of cleaning variable lat_min */ + if((PyObject *)capi_lat_max_prev_as_array!=lat_max_prev_capi) { + Py_XDECREF(capi_lat_max_prev_as_array); } + } /* if (capi_lat_max_prev_as_array == NULL) ... else of lat_max_prev */ + /* End of cleaning variable lat_max_prev */ + if((PyObject *)capi_lat_min_prev_as_array!=lat_min_prev_capi) { + Py_XDECREF(capi_lat_min_prev_as_array); } + } /* if (capi_lat_min_prev_as_array == NULL) ... else of lat_min_prev */ + /* End of cleaning variable lat_min_prev */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + } /*if (f2py_success) of n_sup_ws*/ + /* End of cleaning variable n_sup_ws */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of assign *******************************/ + +/******************************** within_dmax ********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_within_dmax[] = "\ +within_dmax = within_dmax(v1,v2,v3,d1,d2,d3,tol)\n\nWrapper for ``within_dmax``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"v3 : input rank-1 array('d') with bounds (3)\n" +"d1 : input float\n" +"d2 : input float\n" +"d3 : input float\n" +"tol : input float\n" +"\nReturns\n-------\n" +"within_dmax : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_within_dmax(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int within_dmaxf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + double *v3 = NULL; + npy_intp v3_Dims[1] = {-1}; + const int v3_Rank = 1; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + double d1 = 0; + PyObject *d1_capi = Py_None; + double d2 = 0; + PyObject *d2_capi = Py_None; + double d3 = 0; + PyObject *d3_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2","v3","d1","d2","d3","tol",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|:thermal_conductivity.third_order_centering.within_dmax",\ + capi_kwlist,&v1_capi,&v2_capi,&v3_capi,&d1_capi,&d2_capi,&d3_capi,&tol_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.within_dmax: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.within_dmax: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable v3 */ + v3_Dims[0]=3; + capi_v3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.within_dmax: failed to create array from the 3rd argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable d1 */ + f2py_success = double_from_pyobj(&d1,d1_capi,"thermal_conductivity.third_order_centering.within_dmax() 4th argument (d1) can't be converted to double"); + if (f2py_success) { + /* Processing variable d2 */ + f2py_success = double_from_pyobj(&d2,d2_capi,"thermal_conductivity.third_order_centering.within_dmax() 5th argument (d2) can't be converted to double"); + if (f2py_success) { + /* Processing variable d3 */ + f2py_success = double_from_pyobj(&d3,d3_capi,"thermal_conductivity.third_order_centering.within_dmax() 6th argument (d3) can't be converted to double"); + if (f2py_success) { + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"thermal_conductivity.third_order_centering.within_dmax() 7th argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable within_dmaxf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&within_dmaxf2pywrap,v1,v2,v3,&d1,&d2,&d3,&tol); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",within_dmaxf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable within_dmaxf2pywrap */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + } /*if (f2py_success) of d3*/ + /* End of cleaning variable d3 */ + } /*if (f2py_success) of d2*/ + /* End of cleaning variable d2 */ + } /*if (f2py_success) of d1*/ + /* End of cleaning variable d1 */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of within_dmax *****************************/ + +/***************************** compute_perimeter *****************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter[] = "\ +compute_perimeter = compute_perimeter(v1,v2,v3)\n\nWrapper for ``compute_perimeter``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"v3 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"compute_perimeter : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double compute_perimeterf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + double *v3 = NULL; + npy_intp v3_Dims[1] = {-1}; + const int v3_Rank = 1; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2","v3",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.compute_perimeter",\ + capi_kwlist,&v1_capi,&v2_capi,&v3_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.compute_perimeter: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.compute_perimeter: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable v3 */ + v3_Dims[0]=3; + capi_v3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.compute_perimeter: failed to create array from the 3rd argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable compute_perimeterf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&compute_perimeterf2pywrap,v1,v2,v3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",compute_perimeterf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable compute_perimeterf2pywrap */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of compute_perimeter **************************/ + +/****************************** three_to_one_len ******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len[] = "\ +three_to_one_len = three_to_one_len(v,v_min,v_len)\n\nWrapper for ``three_to_one_len``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_len : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"three_to_one_len : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int three_to_one_lenf2pywrap = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_len = NULL; + npy_intp v_len_Dims[1] = {-1}; + const int v_len_Rank = 1; + PyArrayObject *capi_v_len_as_array = NULL; + int capi_v_len_intent = 0; + PyObject *v_len_capi = Py_None; + static char *capi_kwlist[] = {"v","v_min","v_len",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.three_to_one_len",\ + capi_kwlist,&v_capi,&v_min_capi,&v_len_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one_len: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one_len: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_len */ + v_len_Dims[0]=3; + capi_v_len_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one_len: failed to create array from the 3rd argument `v_len`"; + capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); + if (capi_v_len_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); + + /* Processing variable three_to_one_lenf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&three_to_one_lenf2pywrap,v,v_min,v_len); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",three_to_one_lenf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable three_to_one_lenf2pywrap */ + if((PyObject *)capi_v_len_as_array!=v_len_capi) { + Py_XDECREF(capi_v_len_as_array); } + } /* if (capi_v_len_as_array == NULL) ... else of v_len */ + /* End of cleaning variable v_len */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of three_to_one_len **************************/ + +/******************************** three_to_one ********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one[] = "\ +three_to_one = three_to_one(v,v_min,v_max)\n\nWrapper for ``three_to_one``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_max : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"three_to_one : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_three_to_one(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int three_to_onef2pywrap = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_max = NULL; + npy_intp v_max_Dims[1] = {-1}; + const int v_max_Rank = 1; + PyArrayObject *capi_v_max_as_array = NULL; + int capi_v_max_intent = 0; + PyObject *v_max_capi = Py_None; + static char *capi_kwlist[] = {"v","v_min","v_max",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.three_to_one",\ + capi_kwlist,&v_capi,&v_min_capi,&v_max_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_max */ + v_max_Dims[0]=3; + capi_v_max_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one: failed to create array from the 3rd argument `v_max`"; + capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); + if (capi_v_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); + + /* Processing variable three_to_onef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&three_to_onef2pywrap,v,v_min,v_max); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",three_to_onef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable three_to_onef2pywrap */ + if((PyObject *)capi_v_max_as_array!=v_max_capi) { + Py_XDECREF(capi_v_max_as_array); } + } /* if (capi_v_max_as_array == NULL) ... else of v_max */ + /* End of cleaning variable v_max */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of three_to_one ****************************/ + +/****************************** one_to_three_len ******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len[] = "\ +one_to_three_len = one_to_three_len(j,v_min,v_len)\n\nWrapper for ``one_to_three_len``.\ +\n\nParameters\n----------\n" +"j : input int\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_len : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"one_to_three_len : rank-1 array('i') with bounds (3) and one_to_three_lenf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *one_to_three_lenf2pywrap = NULL; + npy_intp one_to_three_lenf2pywrap_Dims[1] = {-1}; + const int one_to_three_lenf2pywrap_Rank = 1; + PyArrayObject *capi_one_to_three_lenf2pywrap_as_array = NULL; + int capi_one_to_three_lenf2pywrap_intent = 0; + int j = 0; + PyObject *j_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_len = NULL; + npy_intp v_len_Dims[1] = {-1}; + const int v_len_Rank = 1; + PyArrayObject *capi_v_len_as_array = NULL; + int capi_v_len_intent = 0; + PyObject *v_len_capi = Py_None; + static char *capi_kwlist[] = {"j","v_min","v_len",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.one_to_three_len",\ + capi_kwlist,&j_capi,&v_min_capi,&v_len_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable j */ + f2py_success = int_from_pyobj(&j,j_capi,"thermal_conductivity.third_order_centering.one_to_three_len() 1st argument (j) can't be converted to int"); + if (f2py_success) { + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three_len: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_len */ + v_len_Dims[0]=3; + capi_v_len_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three_len: failed to create array from the 3rd argument `v_len`"; + capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); + if (capi_v_len_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); + + /* Processing variable one_to_three_lenf2pywrap */ + one_to_three_lenf2pywrap_Dims[0]=3; + capi_one_to_three_lenf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three_len: failed to create array from the hidden `one_to_three_lenf2pywrap`"; + capi_one_to_three_lenf2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_three_lenf2pywrap_Dims,one_to_three_lenf2pywrap_Rank, capi_one_to_three_lenf2pywrap_intent,Py_None,capi_errmess); + if (capi_one_to_three_lenf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + one_to_three_lenf2pywrap = (int *)(PyArray_DATA(capi_one_to_three_lenf2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(one_to_three_lenf2pywrap,&j,v_min,v_len); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_one_to_three_lenf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_one_to_three_lenf2pywrap_as_array == NULL) ... else of one_to_three_lenf2pywrap */ + /* End of cleaning variable one_to_three_lenf2pywrap */ + if((PyObject *)capi_v_len_as_array!=v_len_capi) { + Py_XDECREF(capi_v_len_as_array); } + } /* if (capi_v_len_as_array == NULL) ... else of v_len */ + /* End of cleaning variable v_len */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + } /*if (f2py_success) of j*/ + /* End of cleaning variable j */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of one_to_three_len **************************/ + +/******************************** one_to_three ********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three[] = "\ +one_to_three = one_to_three(j,v_min,v_max)\n\nWrapper for ``one_to_three``.\ +\n\nParameters\n----------\n" +"j : input int\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_max : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"one_to_three : rank-1 array('i') with bounds (3) and one_to_threef2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_one_to_three(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *one_to_threef2pywrap = NULL; + npy_intp one_to_threef2pywrap_Dims[1] = {-1}; + const int one_to_threef2pywrap_Rank = 1; + PyArrayObject *capi_one_to_threef2pywrap_as_array = NULL; + int capi_one_to_threef2pywrap_intent = 0; + int j = 0; + PyObject *j_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_max = NULL; + npy_intp v_max_Dims[1] = {-1}; + const int v_max_Rank = 1; + PyArrayObject *capi_v_max_as_array = NULL; + int capi_v_max_intent = 0; + PyObject *v_max_capi = Py_None; + static char *capi_kwlist[] = {"j","v_min","v_max",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.one_to_three",\ + capi_kwlist,&j_capi,&v_min_capi,&v_max_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable j */ + f2py_success = int_from_pyobj(&j,j_capi,"thermal_conductivity.third_order_centering.one_to_three() 1st argument (j) can't be converted to int"); + if (f2py_success) { + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_max */ + v_max_Dims[0]=3; + capi_v_max_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three: failed to create array from the 3rd argument `v_max`"; + capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); + if (capi_v_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); + + /* Processing variable one_to_threef2pywrap */ + one_to_threef2pywrap_Dims[0]=3; + capi_one_to_threef2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three: failed to create array from the hidden `one_to_threef2pywrap`"; + capi_one_to_threef2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_threef2pywrap_Dims,one_to_threef2pywrap_Rank, capi_one_to_threef2pywrap_intent,Py_None,capi_errmess); + if (capi_one_to_threef2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + one_to_threef2pywrap = (int *)(PyArray_DATA(capi_one_to_threef2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(one_to_threef2pywrap,&j,v_min,v_max); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_one_to_threef2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_one_to_threef2pywrap_as_array == NULL) ... else of one_to_threef2pywrap */ + /* End of cleaning variable one_to_threef2pywrap */ + if((PyObject *)capi_v_max_as_array!=v_max_capi) { + Py_XDECREF(capi_v_max_as_array); } + } /* if (capi_v_max_as_array == NULL) ... else of v_max */ + /* End of cleaning variable v_max */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + } /*if (f2py_success) of j*/ + /* End of cleaning variable j */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of one_to_three ****************************/ + +/******************************* min_el_wise_2 *******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2[] = "\ +min_el_wise_2 = min_el_wise_2(a,b)\n\nWrapper for ``min_el_wise_2``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"min_el_wise_2 : rank-1 array('i') with bounds (3) and min_el_wise_2f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *min_el_wise_2f2pywrap = NULL; + npy_intp min_el_wise_2f2pywrap_Dims[1] = {-1}; + const int min_el_wise_2f2pywrap_Rank = 1; + PyArrayObject *capi_min_el_wise_2f2pywrap_as_array = NULL; + int capi_min_el_wise_2f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + static char *capi_kwlist[] = {"a","b",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.third_order_centering.min_el_wise_2",\ + capi_kwlist,&a_capi,&b_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_2: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_2: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable min_el_wise_2f2pywrap */ + min_el_wise_2f2pywrap_Dims[0]=3; + capi_min_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_2: failed to create array from the hidden `min_el_wise_2f2pywrap`"; + capi_min_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_2f2pywrap_Dims,min_el_wise_2f2pywrap_Rank, capi_min_el_wise_2f2pywrap_intent,Py_None,capi_errmess); + if (capi_min_el_wise_2f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + min_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_2f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(min_el_wise_2f2pywrap,a,b); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_2f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_min_el_wise_2f2pywrap_as_array == NULL) ... else of min_el_wise_2f2pywrap */ + /* End of cleaning variable min_el_wise_2f2pywrap */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of min_el_wise_2 ****************************/ + +/******************************* max_el_wise_2 *******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2[] = "\ +max_el_wise_2 = max_el_wise_2(a,b)\n\nWrapper for ``max_el_wise_2``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"max_el_wise_2 : rank-1 array('i') with bounds (3) and max_el_wise_2f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *max_el_wise_2f2pywrap = NULL; + npy_intp max_el_wise_2f2pywrap_Dims[1] = {-1}; + const int max_el_wise_2f2pywrap_Rank = 1; + PyArrayObject *capi_max_el_wise_2f2pywrap_as_array = NULL; + int capi_max_el_wise_2f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + static char *capi_kwlist[] = {"a","b",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.third_order_centering.max_el_wise_2",\ + capi_kwlist,&a_capi,&b_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_2: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_2: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable max_el_wise_2f2pywrap */ + max_el_wise_2f2pywrap_Dims[0]=3; + capi_max_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_2: failed to create array from the hidden `max_el_wise_2f2pywrap`"; + capi_max_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_2f2pywrap_Dims,max_el_wise_2f2pywrap_Rank, capi_max_el_wise_2f2pywrap_intent,Py_None,capi_errmess); + if (capi_max_el_wise_2f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + max_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_2f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(max_el_wise_2f2pywrap,a,b); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_2f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_max_el_wise_2f2pywrap_as_array == NULL) ... else of max_el_wise_2f2pywrap */ + /* End of cleaning variable max_el_wise_2f2pywrap */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of max_el_wise_2 ****************************/ + +/******************************* min_el_wise_3 *******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3[] = "\ +min_el_wise_3 = min_el_wise_3(a,b,c)\n\nWrapper for ``min_el_wise_3``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"c : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"min_el_wise_3 : rank-1 array('i') with bounds (3) and min_el_wise_3f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *min_el_wise_3f2pywrap = NULL; + npy_intp min_el_wise_3f2pywrap_Dims[1] = {-1}; + const int min_el_wise_3f2pywrap_Rank = 1; + PyArrayObject *capi_min_el_wise_3f2pywrap_as_array = NULL; + int capi_min_el_wise_3f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + int *c = NULL; + npy_intp c_Dims[1] = {-1}; + const int c_Rank = 1; + PyArrayObject *capi_c_as_array = NULL; + int capi_c_intent = 0; + PyObject *c_capi = Py_None; + static char *capi_kwlist[] = {"a","b","c",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.min_el_wise_3",\ + capi_kwlist,&a_capi,&b_capi,&c_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable c */ + c_Dims[0]=3; + capi_c_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the 3rd argument `c`"; + capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); + if (capi_c_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + c = (int *)(PyArray_DATA(capi_c_as_array)); + + /* Processing variable min_el_wise_3f2pywrap */ + min_el_wise_3f2pywrap_Dims[0]=3; + capi_min_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the hidden `min_el_wise_3f2pywrap`"; + capi_min_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_3f2pywrap_Dims,min_el_wise_3f2pywrap_Rank, capi_min_el_wise_3f2pywrap_intent,Py_None,capi_errmess); + if (capi_min_el_wise_3f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + min_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_3f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(min_el_wise_3f2pywrap,a,b,c); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_3f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_min_el_wise_3f2pywrap_as_array == NULL) ... else of min_el_wise_3f2pywrap */ + /* End of cleaning variable min_el_wise_3f2pywrap */ + if((PyObject *)capi_c_as_array!=c_capi) { + Py_XDECREF(capi_c_as_array); } + } /* if (capi_c_as_array == NULL) ... else of c */ + /* End of cleaning variable c */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of min_el_wise_3 ****************************/ + +/******************************* max_el_wise_3 *******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3[] = "\ +max_el_wise_3 = max_el_wise_3(a,b,c)\n\nWrapper for ``max_el_wise_3``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"c : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"max_el_wise_3 : rank-1 array('i') with bounds (3) and max_el_wise_3f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *max_el_wise_3f2pywrap = NULL; + npy_intp max_el_wise_3f2pywrap_Dims[1] = {-1}; + const int max_el_wise_3f2pywrap_Rank = 1; + PyArrayObject *capi_max_el_wise_3f2pywrap_as_array = NULL; + int capi_max_el_wise_3f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + int *c = NULL; + npy_intp c_Dims[1] = {-1}; + const int c_Rank = 1; + PyArrayObject *capi_c_as_array = NULL; + int capi_c_intent = 0; + PyObject *c_capi = Py_None; + static char *capi_kwlist[] = {"a","b","c",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thermal_conductivity.third_order_centering.max_el_wise_3",\ + capi_kwlist,&a_capi,&b_capi,&c_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable c */ + c_Dims[0]=3; + capi_c_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the 3rd argument `c`"; + capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); + if (capi_c_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + c = (int *)(PyArray_DATA(capi_c_as_array)); + + /* Processing variable max_el_wise_3f2pywrap */ + max_el_wise_3f2pywrap_Dims[0]=3; + capi_max_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the hidden `max_el_wise_3f2pywrap`"; + capi_max_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_3f2pywrap_Dims,max_el_wise_3f2pywrap_Rank, capi_max_el_wise_3f2pywrap_intent,Py_None,capi_errmess); + if (capi_max_el_wise_3f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + max_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_3f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(max_el_wise_3f2pywrap,a,b,c); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_3f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_max_el_wise_3f2pywrap_as_array == NULL) ... else of max_el_wise_3f2pywrap */ + /* End of cleaning variable max_el_wise_3f2pywrap */ + if((PyObject *)capi_c_as_array!=c_capi) { + Py_XDECREF(capi_c_as_array); } + } /* if (capi_c_as_array == NULL) ... else of c */ + /* End of cleaning variable c */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of max_el_wise_3 ****************************/ + +/******************************* cryst_to_cart *******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart[] = "\ +cryst_to_cart = cryst_to_cart(v,alat)\n\nWrapper for ``cryst_to_cart``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"cryst_to_cart : rank-1 array('d') with bounds (3) and cryst_to_cartf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *cryst_to_cartf2pywrap = NULL; + npy_intp cryst_to_cartf2pywrap_Dims[1] = {-1}; + const int cryst_to_cartf2pywrap_Rank = 1; + PyArrayObject *capi_cryst_to_cartf2pywrap_as_array = NULL; + int capi_cryst_to_cartf2pywrap_intent = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + static char *capi_kwlist[] = {"v","alat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.third_order_centering.cryst_to_cart",\ + capi_kwlist,&v_capi,&alat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.cryst_to_cart: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.cryst_to_cart: failed to create array from the 2nd argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable cryst_to_cartf2pywrap */ + cryst_to_cartf2pywrap_Dims[0]=3; + capi_cryst_to_cartf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.cryst_to_cart: failed to create array from the hidden `cryst_to_cartf2pywrap`"; + capi_cryst_to_cartf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cryst_to_cartf2pywrap_Dims,cryst_to_cartf2pywrap_Rank, capi_cryst_to_cartf2pywrap_intent,Py_None,capi_errmess); + if (capi_cryst_to_cartf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + cryst_to_cartf2pywrap = (double *)(PyArray_DATA(capi_cryst_to_cartf2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(cryst_to_cartf2pywrap,v,alat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_cryst_to_cartf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_cryst_to_cartf2pywrap_as_array == NULL) ... else of cryst_to_cartf2pywrap */ + /* End of cleaning variable cryst_to_cartf2pywrap */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of cryst_to_cart ****************************/ + +/******************************** interpol_v2 ********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v2[] = "\ +fc_interp = interpol_v2(fc,r2,r3,pos,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v2``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" +"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"q2 : input rank-1 array('d') with bounds (3)\n" +"q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(fc, 0)\n" +"nat : input int, optional\n Default: shape(fc, 1) / 3\n" +"\nReturns\n-------\n" +"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_interpol_v2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + PyObject *r3_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *q2 = NULL; + npy_intp q2_Dims[1] = {-1}; + const int q2_Rank = 1; + PyArrayObject *capi_q2_as_array = NULL; + int capi_q2_intent = 0; + PyObject *q2_capi = Py_None; + double *q3 = NULL; + npy_intp q3_Dims[1] = {-1}; + const int q3_Rank = 1; + PyArrayObject *capi_q3_as_array = NULL; + int capi_q3_intent = 0; + PyObject *q3_capi = Py_None; + complex_double *fc_interp = NULL; + npy_intp fc_interp_Dims[3] = {-1, -1, -1}; + const int fc_interp_Rank = 3; + PyArrayObject *capi_fc_interp_as_array = NULL; + int capi_fc_interp_intent = 0; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"fc","r2","r3","pos","q2","q3","n_blocks","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thermal_conductivity.third_order_cond.interpol_v2",\ + capi_kwlist,&fc_capi,&r2_capi,&r3_capi,&pos_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable q2 */ + q2_Dims[0]=3; + capi_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 5th argument `q2`"; + capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); + if (capi_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q2 = (double *)(PyArray_DATA(capi_q2_as_array)); + + /* Processing variable q3 */ + q3_Dims[0]=3; + capi_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 6th argument `q3`"; + capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); + if (capi_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q3 = (double *)(PyArray_DATA(capi_q3_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.interpol_v2() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v2:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_cond.interpol_v2() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v2:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 2nd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_blocks; + capi_r3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 3rd argument `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 4th argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable fc_interp */ + fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; + capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the hidden `fc_interp`"; + capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); + if (capi_fc_interp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r2,r3,pos,q2,q3,fc_interp,&n_blocks,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ + /* End of cleaning variable fc_interp */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r3_as_array!=r3_capi) { + Py_XDECREF(capi_r3_as_array); } + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_q3_as_array!=q3_capi) { + Py_XDECREF(capi_q3_as_array); } + } /* if (capi_q3_as_array == NULL) ... else of q3 */ + /* End of cleaning variable q3 */ + if((PyObject *)capi_q2_as_array!=q2_capi) { + Py_XDECREF(capi_q2_as_array); } + } /* if (capi_q2_as_array == NULL) ... else of q2 */ + /* End of cleaning variable q2 */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of interpol_v2 *****************************/ + +/******************************** interpol_v3 ********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v3[] = "\ +fc_interp = interpol_v3(fc,pos,r2,r3,q1,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v3``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"q1 : input rank-1 array('d') with bounds (3)\n" +"q2 : input rank-1 array('d') with bounds (3)\n" +"q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(fc, 0)\n" +"nat : input int, optional\n Default: shape(fc, 1) / 3\n" +"\nReturns\n-------\n" +"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_interpol_v3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + PyObject *r3_capi = Py_None; + double *q1 = NULL; + npy_intp q1_Dims[1] = {-1}; + const int q1_Rank = 1; + PyArrayObject *capi_q1_as_array = NULL; + int capi_q1_intent = 0; + PyObject *q1_capi = Py_None; + double *q2 = NULL; + npy_intp q2_Dims[1] = {-1}; + const int q2_Rank = 1; + PyArrayObject *capi_q2_as_array = NULL; + int capi_q2_intent = 0; + PyObject *q2_capi = Py_None; + double *q3 = NULL; + npy_intp q3_Dims[1] = {-1}; + const int q3_Rank = 1; + PyArrayObject *capi_q3_as_array = NULL; + int capi_q3_intent = 0; + PyObject *q3_capi = Py_None; + complex_double *fc_interp = NULL; + npy_intp fc_interp_Dims[3] = {-1, -1, -1}; + const int fc_interp_Rank = 3; + PyArrayObject *capi_fc_interp_as_array = NULL; + int capi_fc_interp_intent = 0; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"fc","pos","r2","r3","q1","q2","q3","n_blocks","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OO:thermal_conductivity.third_order_cond.interpol_v3",\ + capi_kwlist,&fc_capi,&pos_capi,&r2_capi,&r3_capi,&q1_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable q2 */ + q2_Dims[0]=3; + capi_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 6th argument `q2`"; + capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); + if (capi_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q2 = (double *)(PyArray_DATA(capi_q2_as_array)); + + /* Processing variable q3 */ + q3_Dims[0]=3; + capi_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 7th argument `q3`"; + capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); + if (capi_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q3 = (double *)(PyArray_DATA(capi_q3_as_array)); + + /* Processing variable q1 */ + q1_Dims[0]=3; + capi_q1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 5th argument `q1`"; + capi_q1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q1_Dims,q1_Rank, capi_q1_intent,q1_capi,capi_errmess); + if (capi_q1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q1 = (double *)(PyArray_DATA(capi_q1_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.interpol_v3() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v3:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_cond.interpol_v3() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v3:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 3rd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_blocks; + capi_r3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 4th argument `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 2nd argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable fc_interp */ + fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; + capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the hidden `fc_interp`"; + capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); + if (capi_fc_interp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,pos,r2,r3,q1,q2,q3,fc_interp,&n_blocks,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ + /* End of cleaning variable fc_interp */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r3_as_array!=r3_capi) { + Py_XDECREF(capi_r3_as_array); } + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_q1_as_array!=q1_capi) { + Py_XDECREF(capi_q1_as_array); } + } /* if (capi_q1_as_array == NULL) ... else of q1 */ + /* End of cleaning variable q1 */ + if((PyObject *)capi_q3_as_array!=q3_capi) { + Py_XDECREF(capi_q3_as_array); } + } /* if (capi_q3_as_array == NULL) ... else of q3 */ + /* End of cleaning variable q3 */ + if((PyObject *)capi_q2_as_array!=q2_capi) { + Py_XDECREF(capi_q2_as_array); } + } /* if (capi_q2_as_array == NULL) ... else of q2 */ + /* End of cleaning variable q2 */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of interpol_v3 *****************************/ + +/********************* compute_full_dynamic_bubble_single *********************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single[] = "\ +bubble = compute_full_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_full_dynamic_bubble_single``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (n_mod)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"n_mod : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-3 array('D') with bounds (ne,n_mod,n_mod)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[3] = {-1, -1, -1}; + const int bubble_Rank = 3; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_full_dynamic_bubble_single:ne=%d",ne) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_full_dynamic_bubble_single:n_mod=%d",n_mod) { + /* Processing variable bubble */ + bubble_Dims[0]=ne,bubble_Dims[1]=n_mod,bubble_Dims[2]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=n_mod,freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************** end of compute_full_dynamic_bubble_single *****************/ + +/********************* compute_diag_dynamic_bubble_single *********************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single[] = "\ +bubble = compute_diag_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_diag_dynamic_bubble_single``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (n_mod)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"n_mod : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-2 array('D') with bounds (ne,n_mod)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[2] = {-1, -1}; + const int bubble_Rank = 2; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_diag_dynamic_bubble_single:n_mod=%d",n_mod) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_diag_dynamic_bubble_single:ne=%d",ne) { + /* Processing variable bubble */ + bubble_Dims[0]=ne,bubble_Dims[1]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=n_mod,freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************** end of compute_diag_dynamic_bubble_single *****************/ + +/*********************** compute_perturb_selfnrg_single ***********************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single[] = "\ +selfnrg = compute_perturb_selfnrg_single(sigma,t,freq,is_gamma,d3,gaussian,classical,[n_mod])\n\nWrapper for ``compute_perturb_selfnrg_single``.\ +\n\nParameters\n----------\n" +"sigma : input rank-1 array('d') with bounds (n_mod)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"selfnrg : rank-1 array('D') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,complex_double*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[1] = {-1}; + const int selfnrg_Rank = 1; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + static char *capi_kwlist[] = {"sigma","t","freq","is_gamma","d3","gaussian","classical","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single",\ + capi_kwlist,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 1st argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 4th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","1st keyword n_mod","compute_perturb_selfnrg_single:n_mod=%d",n_mod) { + /* Processing variable selfnrg */ + selfnrg_Dims[0]=n_mod; + capi_selfnrg_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the hidden `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,Py_None,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=n_mod,freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 3rd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 5th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(sigma,&t,freq,is_gamma,d3,&n_mod,&gaussian,&classical,selfnrg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_selfnrg_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************* end of compute_perturb_selfnrg_single *******************/ + +/*********************** compute_spectralf_diag_single ***********************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single[] = "\ +spectralf = compute_spectralf_diag_single(sigma,ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``compute_spectralf_diag_single``.\ +\n\nParameters\n----------\n" +"sigma : input rank-1 array('d') with bounds (3 * nat)\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" +"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(sigma, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,complex_double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *d2_freq = NULL; + npy_intp d2_freq_Dims[1] = {-1}; + const int d2_freq_Rank = 1; + PyArrayObject *capi_d2_freq_as_array = NULL; + int capi_d2_freq_intent = 0; + PyObject *d2_freq_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[2] = {-1, -1}; + const int selfnrg_Rank = 2; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + PyObject *selfnrg_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *spectralf = NULL; + npy_intp spectralf_Dims[2] = {-1, -1}; + const int spectralf_Rank = 2; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + static char *capi_kwlist[] = {"sigma","ener","d2_freq","selfnrg","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|OO:thermal_conductivity.third_order_cond.compute_spectralf_diag_single",\ + capi_kwlist,&sigma_capi,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 2nd argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 1st argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.compute_spectralf_diag_single() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf_diag_single:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(sigma, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.compute_spectralf_diag_single() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == 3 * nat,"shape(sigma, 0) == 3 * nat","1st keyword nat","compute_spectralf_diag_single:nat=%d",nat) { + /* Processing variable d2_freq */ + d2_freq_Dims[0]=3 * nat; + capi_d2_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 3rd argument `d2_freq`"; + capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); + if (capi_d2_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); + + /* Processing variable selfnrg */ + selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; + capi_selfnrg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 4th argument `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(sigma,ener,d2_freq,selfnrg,&nat,&ne,spectralf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { + Py_XDECREF(capi_selfnrg_as_array); } + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { + Py_XDECREF(capi_d2_freq_as_array); } + } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ + /* End of cleaning variable d2_freq */ + } /*CHECKSCALAR(shape(sigma, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of compute_spectralf_diag_single ********************/ + +/*************************** lambda_dynamic_single ***************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single[] = "\ +lambda_out = lambda_dynamic_single(energies,sigma,t,static_limit,w_q2,w_q3,gaussian,[ne])\n\nWrapper for ``lambda_dynamic_single``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input float\n" +"t : input float\n" +"static_limit : input int\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"gaussian : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"\nReturns\n-------\n" +"lambda_out : rank-1 array('D') with bounds (ne)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,int*,double*,double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double sigma = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int static_limit = 0; + PyObject *static_limit_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + complex_double *lambda_out = NULL; + npy_intp lambda_out_Dims[1] = {-1}; + const int lambda_out_Rank = 1; + PyArrayObject *capi_lambda_out_as_array = NULL; + int capi_lambda_out_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","static_limit","w_q2","w_q3","gaussian","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:thermal_conductivity.third_order_cond.lambda_dynamic_single",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&static_limit_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable static_limit */ + static_limit = (int)PyObject_IsTrue(static_limit_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + f2py_success = double_from_pyobj(&sigma,sigma_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_single() 2nd argument (sigma) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_single() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the 5th argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the 6th argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_single() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","lambda_dynamic_single:ne=%d",ne) { + /* Processing variable lambda_out */ + lambda_out_Dims[0]=ne; + capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the hidden `lambda_out`"; + capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); + if (capi_lambda_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,energies,&sigma,&t,&static_limit,w_q2,w_q3,&gaussian,lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ + /* End of cleaning variable lambda_out */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of sigma*/ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of static_limit*/ + /* End of cleaning variable static_limit */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of lambda_dynamic_single ************************/ + +/************************ lambda_dynamic_value_single ************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single[] = "\ +lambda_out = lambda_dynamic_value_single(n_mod,value,sigma,t,w_q2,w_q3,gaussian)\n\nWrapper for ``lambda_dynamic_value_single``.\ +\n\nParameters\n----------\n" +"n_mod : input int\n" +"value : input float\n" +"sigma : input float\n" +"t : input float\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"gaussian : input int\n" +"\nReturns\n-------\n" +"lambda_out : complex"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,double*,double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double value = 0; + PyObject *value_capi = Py_None; + double sigma = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + complex_double lambda_out; + PyObject *lambda_out_capi = Py_None; + static char *capi_kwlist[] = {"n_mod","value","sigma","t","w_q2","w_q3","gaussian",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|:thermal_conductivity.third_order_cond.lambda_dynamic_value_single",\ + capi_kwlist,&n_mod_capi,&value_capi,&sigma_capi,&t_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable lambda_out */ + /* Processing variable n_mod */ + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 1st argument (n_mod) can't be converted to int"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable sigma */ + f2py_success = double_from_pyobj(&sigma,sigma_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 3rd argument (sigma) can't be converted to double"); + if (f2py_success) { + /* Processing variable value */ + f2py_success = double_from_pyobj(&value,value_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 2nd argument (value) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 4th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_value_single: failed to create array from the 5th argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_value_single: failed to create array from the 6th argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&n_mod,&value,&sigma,&t,w_q2,w_q3,&gaussian,&lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ + lambda_out_capi = pyobj_from_complex_double1(lambda_out); +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",lambda_out_capi); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of value*/ + /* End of cleaning variable value */ + } /*if (f2py_success) of sigma*/ + /* End of cleaning variable sigma */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + /* End of cleaning variable lambda_out */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of lambda_dynamic_value_single *********************/ + +/************************ calculate_spectral_function ************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function[] = "\ +spectralf = calculate_spectral_function(ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``calculate_spectral_function``.\ +\n\nParameters\n----------\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" +"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(d2_freq, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *d2_freq = NULL; + npy_intp d2_freq_Dims[1] = {-1}; + const int d2_freq_Rank = 1; + PyArrayObject *capi_d2_freq_as_array = NULL; + int capi_d2_freq_intent = 0; + PyObject *d2_freq_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[2] = {-1, -1}; + const int selfnrg_Rank = 2; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + PyObject *selfnrg_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *spectralf = NULL; + npy_intp spectralf_Dims[2] = {-1, -1}; + const int spectralf_Rank = 2; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + static char *capi_kwlist[] = {"ener","d2_freq","selfnrg","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thermal_conductivity.third_order_cond.calculate_spectral_function",\ + capi_kwlist,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the 1st argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable d2_freq */ + ; + capi_d2_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the 2nd argument `d2_freq`"; + capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); + if (capi_d2_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(d2_freq, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(d2_freq, 0) == 3 * nat,"shape(d2_freq, 0) == 3 * nat","1st keyword nat","calculate_spectral_function:nat=%d",nat) { + /* Processing variable selfnrg */ + selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; + capi_selfnrg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the 3rd argument `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ener,d2_freq,selfnrg,&nat,&ne,spectralf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { + Py_XDECREF(capi_selfnrg_as_array); } + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + } /*CHECKSCALAR(shape(d2_freq, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { + Py_XDECREF(capi_d2_freq_as_array); } + } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ + /* End of cleaning variable d2_freq */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of calculate_spectral_function *********************/ + +/****************** calculate_spectral_function_mode_mixing ******************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing[] = "\ +spectralf = calculate_spectral_function_mode_mixing(ener,smear,wq,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_mode_mixing``.\ +\n\nParameters\n----------\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"wq : input rank-1 array('d') with bounds (3 * nat)\n" +"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" +"notransl : input int\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(smear, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,complex_double*,int*,complex_double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double *wq = NULL; + npy_intp wq_Dims[1] = {-1}; + const int wq_Rank = 1; + PyArrayObject *capi_wq_as_array = NULL; + int capi_wq_intent = 0; + PyObject *wq_capi = Py_None; + complex_double *pi = NULL; + npy_intp pi_Dims[3] = {-1, -1, -1}; + const int pi_Rank = 3; + PyArrayObject *capi_pi_as_array = NULL; + int capi_pi_intent = 0; + PyObject *pi_capi = Py_None; + int notransl = 0; + PyObject *notransl_capi = Py_None; + complex_double *spectralf = NULL; + npy_intp spectralf_Dims[3] = {-1, -1, -1}; + const int spectralf_Rank = 3; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + static char *capi_kwlist[] = {"ener","smear","wq","pi","notransl","mass","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing",\ + capi_kwlist,&ener_capi,&smear_capi,&wq_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 1st argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable smear */ + ; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 2nd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable notransl */ + notransl = (int)PyObject_IsTrue(notransl_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_mode_mixing:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_mode_mixing:nat=%d",nat) { + /* Processing variable wq */ + wq_Dims[0]=3 * nat; + capi_wq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 3rd argument `wq`"; + capi_wq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,wq_Dims,wq_Rank, capi_wq_intent,wq_capi,capi_errmess); + if (capi_wq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + wq = (double *)(PyArray_DATA(capi_wq_as_array)); + + /* Processing variable pi */ + pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; + capi_pi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 4th argument `pi`"; + capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); + if (capi_pi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); + + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 6th argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ener,smear,wq,pi,¬ransl,spectralf,mass,&nat,&ne); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_pi_as_array!=pi_capi) { + Py_XDECREF(capi_pi_as_array); } + } /* if (capi_pi_as_array == NULL) ... else of pi */ + /* End of cleaning variable pi */ + if((PyObject *)capi_wq_as_array!=wq_capi) { + Py_XDECREF(capi_wq_as_array); } + } /* if (capi_wq_as_array == NULL) ... else of wq */ + /* End of cleaning variable wq */ + } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of notransl*/ + /* End of cleaning variable notransl */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************** end of calculate_spectral_function_mode_mixing ***************/ + +/******************* calculate_spectral_function_cartesian *******************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian[] = "\ +spectralf = calculate_spectral_function_cartesian(ener,smear,d2,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_cartesian``.\ +\n\nParameters\n----------\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"d2 : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" +"notransl : input int\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(smear, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,complex_double*,int*,complex_double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + complex_double *d2 = NULL; + npy_intp d2_Dims[2] = {-1, -1}; + const int d2_Rank = 2; + PyArrayObject *capi_d2_as_array = NULL; + int capi_d2_intent = 0; + PyObject *d2_capi = Py_None; + complex_double *pi = NULL; + npy_intp pi_Dims[3] = {-1, -1, -1}; + const int pi_Rank = 3; + PyArrayObject *capi_pi_as_array = NULL; + int capi_pi_intent = 0; + PyObject *pi_capi = Py_None; + int notransl = 0; + PyObject *notransl_capi = Py_None; + complex_double *spectralf = NULL; + npy_intp spectralf_Dims[3] = {-1, -1, -1}; + const int spectralf_Rank = 3; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + static char *capi_kwlist[] = {"ener","smear","d2","pi","notransl","mass","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian",\ + capi_kwlist,&ener_capi,&smear_capi,&d2_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 1st argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable smear */ + ; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 2nd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable notransl */ + notransl = (int)PyObject_IsTrue(notransl_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_cartesian:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_cartesian:nat=%d",nat) { + /* Processing variable d2 */ + d2_Dims[0]=3 * nat,d2_Dims[1]=3 * nat; + capi_d2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 3rd argument `d2`"; + capi_d2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d2_Dims,d2_Rank, capi_d2_intent,d2_capi,capi_errmess); + if (capi_d2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2 = (complex_double *)(PyArray_DATA(capi_d2_as_array)); + + /* Processing variable pi */ + pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; + capi_pi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 4th argument `pi`"; + capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); + if (capi_pi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); + + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 6th argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ener,smear,d2,pi,¬ransl,spectralf,mass,&nat,&ne); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_pi_as_array!=pi_capi) { + Py_XDECREF(capi_pi_as_array); } + } /* if (capi_pi_as_array == NULL) ... else of pi */ + /* End of cleaning variable pi */ + if((PyObject *)capi_d2_as_array!=d2_capi) { + Py_XDECREF(capi_d2_as_array); } + } /* if (capi_d2_as_array == NULL) ... else of d2 */ + /* End of cleaning variable d2 */ + } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of notransl*/ + /* End of cleaning variable notransl */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************** end of calculate_spectral_function_cartesian ****************/ + +/********************************* bose_freq *********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_bose_freq[] = "\ +bose = bose_freq(t,freq,[n_mod])\n\nWrapper for ``bose_freq``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"freq : input rank-1 array('d') with bounds (n_mod)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bose : rank-1 array('d') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_bose_freq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + double *bose = NULL; + npy_intp bose_Dims[1] = {-1}; + const int bose_Rank = 1; + PyArrayObject *capi_bose_as_array = NULL; + int capi_bose_intent = 0; + static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thermal_conductivity.third_order_cond.bose_freq",\ + capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.bose_freq() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + ; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.bose_freq: failed to create array from the 2nd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.bose_freq() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","bose_freq:n_mod=%d",n_mod) { + /* Processing variable bose */ + bose_Dims[0]=n_mod; + capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.bose_freq: failed to create array from the hidden `bose`"; + capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); + if (capi_bose_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bose = (double *)(PyArray_DATA(capi_bose_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,&n_mod,freq,bose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_bose_as_array == NULL) ... else of bose */ + /* End of cleaning variable bose */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of bose_freq ******************************/ + +/********************************** eq_freq **********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_eq_freq[] = "\ +bose = eq_freq(t,freq,[n_mod])\n\nWrapper for ``eq_freq``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"freq : input rank-1 array('d') with bounds (n_mod)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bose : rank-1 array('d') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_eq_freq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + double *bose = NULL; + npy_intp bose_Dims[1] = {-1}; + const int bose_Rank = 1; + PyArrayObject *capi_bose_as_array = NULL; + int capi_bose_intent = 0; + static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thermal_conductivity.third_order_cond.eq_freq",\ + capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.eq_freq() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + ; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eq_freq: failed to create array from the 2nd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.eq_freq() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","eq_freq:n_mod=%d",n_mod) { + /* Processing variable bose */ + bose_Dims[0]=n_mod; + capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eq_freq: failed to create array from the hidden `bose`"; + capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); + if (capi_bose_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bose = (double *)(PyArray_DATA(capi_bose_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,&n_mod,freq,bose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_bose_as_array == NULL) ... else of bose */ + /* End of cleaning variable bose */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of eq_freq *******************************/ + +/*********************************** f_bose ***********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_f_bose[] = "\ +f_bose = f_bose(freq,t)\n\nWrapper for ``f_bose``.\ +\n\nParameters\n----------\n" +"freq : input float\n" +"t : input float\n" +"\nReturns\n-------\n" +"f_bose : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_f_bose(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double f_bosef2pywrap = 0; + double freq = 0; + PyObject *freq_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + static char *capi_kwlist[] = {"freq","t",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.third_order_cond.f_bose",\ + capi_kwlist,&freq_capi,&t_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable freq */ + f2py_success = double_from_pyobj(&freq,freq_capi,"thermal_conductivity.third_order_cond.f_bose() 1st argument (freq) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.f_bose() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable f_bosef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&f_bosef2pywrap,&freq,&t); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",f_bosef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f_bosef2pywrap */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of freq*/ + /* End of cleaning variable freq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of f_bose *******************************/ + +/********************************** df_bose **********************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_df_bose[] = "\ +df_bose = df_bose(freq,t)\n\nWrapper for ``df_bose``.\ +\n\nParameters\n----------\n" +"freq : input float\n" +"t : input float\n" +"\nReturns\n-------\n" +"df_bose : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_df_bose(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double df_bosef2pywrap = 0; + double freq = 0; + PyObject *freq_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + static char *capi_kwlist[] = {"freq","t",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.third_order_cond.df_bose",\ + capi_kwlist,&freq_capi,&t_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable freq */ + f2py_success = double_from_pyobj(&freq,freq_capi,"thermal_conductivity.third_order_cond.df_bose() 1st argument (freq) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.df_bose() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable df_bosef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&df_bosef2pywrap,&freq,&t); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",df_bosef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable df_bosef2pywrap */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of freq*/ + /* End of cleaning variable freq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of df_bose *******************************/ + +/***************************** gaussian_function *****************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_gaussian_function[] = "\ +gaussian_function = gaussian_function(x,sigma)\n\nWrapper for ``gaussian_function``.\ +\n\nParameters\n----------\n" +"x : input float\n" +"sigma : input float\n" +"\nReturns\n-------\n" +"gaussian_function : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_gaussian_function(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double gaussian_functionf2pywrap = 0; + double x = 0; + PyObject *x_capi = Py_None; + double sigma = 0; + PyObject *sigma_capi = Py_None; + static char *capi_kwlist[] = {"x","sigma",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thermal_conductivity.third_order_cond.gaussian_function",\ + capi_kwlist,&x_capi,&sigma_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + f2py_success = double_from_pyobj(&x,x_capi,"thermal_conductivity.third_order_cond.gaussian_function() 1st argument (x) can't be converted to double"); + if (f2py_success) { + /* Processing variable sigma */ + f2py_success = double_from_pyobj(&sigma,sigma_capi,"thermal_conductivity.third_order_cond.gaussian_function() 2nd argument (sigma) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian_functionf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&gaussian_functionf2pywrap,&x,&sigma); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",gaussian_functionf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable gaussian_functionf2pywrap */ + } /*if (f2py_success) of sigma*/ + /* End of cleaning variable sigma */ + } /*if (f2py_success) of x*/ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of gaussian_function **************************/ + +/****************************** eliminate_transl ******************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl[] = "\ +eliminate_transl(a,mass,[nat])\n\nWrapper for ``eliminate_transl``.\ +\n\nParameters\n----------\n" +"a : in/output rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(a, 0) / 3"; +/* */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"a","mass","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thermal_conductivity.third_order_cond.eliminate_transl",\ + capi_kwlist,&a_capi,&mass_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eliminate_transl: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (complex_double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(a, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.eliminate_transl() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(a, 0) == 3 * nat,"shape(a, 0) == 3 * nat","1st keyword nat","eliminate_transl:nat=%d",nat) { + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eliminate_transl: failed to create array from the 2nd argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(a,mass,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /*CHECKSCALAR(shape(a, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of eliminate_transl **************************/ + +/************************************ cinv ************************************/ +static char doc_f2py_rout_thermal_conductivity_third_order_cond_cinv[] = "\ +ainv = cinv(a)\n\nWrapper for ``cinv``.\ +\n\nParameters\n----------\n" +"a : input rank-2 array('D') with bounds (f2py_a_d0,f2py_a_d1)\n" +"\nReturns\n-------\n" +"ainv : rank-2 array('D') with bounds (size(a, 1),size(a, 2)) and cinvf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thermal_conductivity_third_order_cond_cinv(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *cinvf2pywrap = NULL; + npy_intp cinvf2pywrap_Dims[2] = {-1, -1}; + const int cinvf2pywrap_Rank = 2; + PyArrayObject *capi_cinvf2pywrap_as_array = NULL; + int capi_cinvf2pywrap_intent = 0; + complex_double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int f2py_a_d0 = 0; + int f2py_a_d1 = 0; + static char *capi_kwlist[] = {"a",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thermal_conductivity.third_order_cond.cinv",\ + capi_kwlist,&a_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.cinv: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (complex_double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable cinvf2pywrap */ + cinvf2pywrap_Dims[0]=size(a, 1),cinvf2pywrap_Dims[1]=size(a, 2); + capi_cinvf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.cinv: failed to create array from the hidden `cinvf2pywrap`"; + capi_cinvf2pywrap_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,cinvf2pywrap_Dims,cinvf2pywrap_Rank, capi_cinvf2pywrap_intent,Py_None,capi_errmess); + if (capi_cinvf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thermal_conductivity_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + cinvf2pywrap = (complex_double *)(PyArray_DATA(capi_cinvf2pywrap_as_array)); + + /* Processing variable f2py_a_d0 */ + f2py_a_d0 = shape(a, 0); + /* Processing variable f2py_a_d1 */ + f2py_a_d1 = shape(a, 1); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(cinvf2pywrap,a,&f2py_a_d0,&f2py_a_d1); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_cinvf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_a_d1 */ + /* End of cleaning variable f2py_a_d0 */ + } /* if (capi_cinvf2pywrap_as_array == NULL) ... else of cinvf2pywrap */ + /* End of cleaning variable cinvf2pywrap */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of cinv ********************************/ +/*eof body*/ + +/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ + +static FortranDataDef f2py_get_lf_def[] = { + {"calculate_lineshapes",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes}, + {"calculate_lineshapes_mode_mixing",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing}, + {"calculate_lineshapes_cartesian",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian}, + {"calculate_lifetimes_selfconsistently",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently}, + {"solve_selfconsistent_equation",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation,doc_f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation}, + {"calculate_correlation_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function,doc_f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function}, + {"calculate_lifetimes_perturbative",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative}, + {"calculate_lifetimes",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes}, + {"calculate_self_energy_la",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la,doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la}, + {"calculate_self_energy_p",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p,doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p}, + {"calculate_self_energy_full",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full,doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full}, + {"check_if_gamma",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_check_if_gamma,doc_f2py_rout_thermal_conductivity_get_lf_check_if_gamma}, + {"vec_dot_mat",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_vec_dot_mat,doc_f2py_rout_thermal_conductivity_get_lf_vec_dot_mat}, + {"calculate_real_part_via_kramers_kronig",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig,doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig}, + {"calculate_real_part_via_kramers_kronig_2d",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d,doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d}, + {"hilbert_transform_via_fft",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft,doc_f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft}, + {"ht",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_ht,doc_f2py_rout_thermal_conductivity_get_lf_ht}, + {"cfft",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_cfft,doc_f2py_rout_thermal_conductivity_get_lf_cfft}, + {"inv",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_inv,doc_f2py_rout_thermal_conductivity_get_lf_inv}, + {"interpolate_fc2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_interpolate_fc2,doc_f2py_rout_thermal_conductivity_get_lf_interpolate_fc2}, + {NULL} +}; + +static void f2py_setup_get_lf(char *calculate_lineshapes,char *calculate_lineshapes_mode_mixing,char *calculate_lineshapes_cartesian,char *calculate_lifetimes_selfconsistently,char *solve_selfconsistent_equation,char *calculate_correlation_function,char *calculate_lifetimes_perturbative,char *calculate_lifetimes,char *calculate_self_energy_la,char *calculate_self_energy_p,char *calculate_self_energy_full,char *check_if_gamma,char *vec_dot_mat,char *calculate_real_part_via_kramers_kronig,char *calculate_real_part_via_kramers_kronig_2d,char *hilbert_transform_via_fft,char *ht,char *cfft,char *inv,char *interpolate_fc2) { + int i_f2py=0; + f2py_get_lf_def[i_f2py++].data = calculate_lineshapes; + f2py_get_lf_def[i_f2py++].data = calculate_lineshapes_mode_mixing; + f2py_get_lf_def[i_f2py++].data = calculate_lineshapes_cartesian; + f2py_get_lf_def[i_f2py++].data = calculate_lifetimes_selfconsistently; + f2py_get_lf_def[i_f2py++].data = solve_selfconsistent_equation; + f2py_get_lf_def[i_f2py++].data = calculate_correlation_function; + f2py_get_lf_def[i_f2py++].data = calculate_lifetimes_perturbative; + f2py_get_lf_def[i_f2py++].data = calculate_lifetimes; + f2py_get_lf_def[i_f2py++].data = calculate_self_energy_la; + f2py_get_lf_def[i_f2py++].data = calculate_self_energy_p; + f2py_get_lf_def[i_f2py++].data = calculate_self_energy_full; + f2py_get_lf_def[i_f2py++].data = check_if_gamma; + f2py_get_lf_def[i_f2py++].data = vec_dot_mat; + f2py_get_lf_def[i_f2py++].data = calculate_real_part_via_kramers_kronig; + f2py_get_lf_def[i_f2py++].data = calculate_real_part_via_kramers_kronig_2d; + f2py_get_lf_def[i_f2py++].data = hilbert_transform_via_fft; + f2py_get_lf_def[i_f2py++].data = ht; + f2py_get_lf_def[i_f2py++].data = cfft; + f2py_get_lf_def[i_f2py++].data = inv; + f2py_get_lf_def[i_f2py++].data = interpolate_fc2; +} +extern void F_FUNC_US(f2pyinitget_lf,F2PYINITGET_LF)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_get_lf(void) { + F_FUNC_US(f2pyinitget_lf,F2PYINITGET_LF)(f2py_setup_get_lf); +} + + +static FortranDataDef f2py_scattering_grids_def[] = { + {"get_scattering_q_grid",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid,doc_f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid}, + {"same_vector",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_scattering_grids_same_vector,doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector}, + {"same_vector_nopbc",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc,doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc}, + {NULL} +}; + +static void f2py_setup_scattering_grids(char *get_scattering_q_grid,char *same_vector,char *same_vector_nopbc) { + int i_f2py=0; + f2py_scattering_grids_def[i_f2py++].data = get_scattering_q_grid; + f2py_scattering_grids_def[i_f2py++].data = same_vector; + f2py_scattering_grids_def[i_f2py++].data = same_vector_nopbc; +} +extern void F_FUNC_US(f2pyinitscattering_grids,F2PYINITSCATTERING_GRIDS)(void (*)(char *,char *,char *)); +static void f2py_init_scattering_grids(void) { + F_FUNC_US(f2pyinitscattering_grids,F2PYINITSCATTERING_GRIDS)(f2py_setup_scattering_grids); +} + + +static FortranDataDef f2py_third_order_centering_def[] = { + {"analysis",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_analysis,doc_f2py_rout_thermal_conductivity_third_order_centering_analysis}, + {"center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_center,doc_f2py_rout_thermal_conductivity_third_order_centering_center}, + {"center_sparse",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_center_sparse,doc_f2py_rout_thermal_conductivity_third_order_centering_center_sparse}, + {"pre_center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_pre_center,doc_f2py_rout_thermal_conductivity_third_order_centering_pre_center}, + {"assign",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_assign,doc_f2py_rout_thermal_conductivity_third_order_centering_assign}, + {"within_dmax",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_within_dmax,doc_f2py_rout_thermal_conductivity_third_order_centering_within_dmax}, + {"compute_perimeter",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter,doc_f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter}, + {"three_to_one_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len,doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len}, + {"three_to_one",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_three_to_one,doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one}, + {"one_to_three_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len,doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len}, + {"one_to_three",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_one_to_three,doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three}, + {"min_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2,doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2}, + {"max_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2,doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2}, + {"min_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3,doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3}, + {"max_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3,doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3}, + {"cryst_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart,doc_f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart}, + {NULL} +}; + +static void f2py_setup_third_order_centering(char *analysis,char *center,char *center_sparse,char *pre_center,char *assign,char *within_dmax,char *compute_perimeter,char *three_to_one_len,char *three_to_one,char *one_to_three_len,char *one_to_three,char *min_el_wise_2,char *max_el_wise_2,char *min_el_wise_3,char *max_el_wise_3,char *cryst_to_cart) { + int i_f2py=0; + f2py_third_order_centering_def[i_f2py++].data = analysis; + f2py_third_order_centering_def[i_f2py++].data = center; + f2py_third_order_centering_def[i_f2py++].data = center_sparse; + f2py_third_order_centering_def[i_f2py++].data = pre_center; + f2py_third_order_centering_def[i_f2py++].data = assign; + f2py_third_order_centering_def[i_f2py++].data = within_dmax; + f2py_third_order_centering_def[i_f2py++].data = compute_perimeter; + f2py_third_order_centering_def[i_f2py++].data = three_to_one_len; + f2py_third_order_centering_def[i_f2py++].data = three_to_one; + f2py_third_order_centering_def[i_f2py++].data = one_to_three_len; + f2py_third_order_centering_def[i_f2py++].data = one_to_three; + f2py_third_order_centering_def[i_f2py++].data = min_el_wise_2; + f2py_third_order_centering_def[i_f2py++].data = max_el_wise_2; + f2py_third_order_centering_def[i_f2py++].data = min_el_wise_3; + f2py_third_order_centering_def[i_f2py++].data = max_el_wise_3; + f2py_third_order_centering_def[i_f2py++].data = cryst_to_cart; +} +extern void F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_centering(void) { + F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(f2py_setup_third_order_centering); +} + + +static FortranDataDef f2py_third_order_cond_def[] = { + {"interpol_v2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_interpol_v2,doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v2}, + {"interpol_v3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_interpol_v3,doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v3}, + {"compute_full_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single}, + {"compute_diag_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single}, + {"compute_perturb_selfnrg_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single}, + {"compute_spectralf_diag_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single}, + {"lambda_dynamic_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single,doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single}, + {"lambda_dynamic_value_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single,doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single}, + {"calculate_spectral_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function,doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function}, + {"calculate_spectral_function_mode_mixing",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing,doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing}, + {"calculate_spectral_function_cartesian",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian,doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian}, + {"bose_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_bose_freq,doc_f2py_rout_thermal_conductivity_third_order_cond_bose_freq}, + {"eq_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_eq_freq,doc_f2py_rout_thermal_conductivity_third_order_cond_eq_freq}, + {"f_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_f_bose,doc_f2py_rout_thermal_conductivity_third_order_cond_f_bose}, + {"df_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_df_bose,doc_f2py_rout_thermal_conductivity_third_order_cond_df_bose}, + {"gaussian_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_gaussian_function,doc_f2py_rout_thermal_conductivity_third_order_cond_gaussian_function}, + {"eliminate_transl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl,doc_f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl}, + {"cinv",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_cinv,doc_f2py_rout_thermal_conductivity_third_order_cond_cinv}, + {NULL} +}; + +static void f2py_setup_third_order_cond(char *interpol_v2,char *interpol_v3,char *compute_full_dynamic_bubble_single,char *compute_diag_dynamic_bubble_single,char *compute_perturb_selfnrg_single,char *compute_spectralf_diag_single,char *lambda_dynamic_single,char *lambda_dynamic_value_single,char *calculate_spectral_function,char *calculate_spectral_function_mode_mixing,char *calculate_spectral_function_cartesian,char *bose_freq,char *eq_freq,char *f_bose,char *df_bose,char *gaussian_function,char *eliminate_transl,char *cinv) { + int i_f2py=0; + f2py_third_order_cond_def[i_f2py++].data = interpol_v2; + f2py_third_order_cond_def[i_f2py++].data = interpol_v3; + f2py_third_order_cond_def[i_f2py++].data = compute_full_dynamic_bubble_single; + f2py_third_order_cond_def[i_f2py++].data = compute_diag_dynamic_bubble_single; + f2py_third_order_cond_def[i_f2py++].data = compute_perturb_selfnrg_single; + f2py_third_order_cond_def[i_f2py++].data = compute_spectralf_diag_single; + f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_single; + f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_value_single; + f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function; + f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_mode_mixing; + f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_cartesian; + f2py_third_order_cond_def[i_f2py++].data = bose_freq; + f2py_third_order_cond_def[i_f2py++].data = eq_freq; + f2py_third_order_cond_def[i_f2py++].data = f_bose; + f2py_third_order_cond_def[i_f2py++].data = df_bose; + f2py_third_order_cond_def[i_f2py++].data = gaussian_function; + f2py_third_order_cond_def[i_f2py++].data = eliminate_transl; + f2py_third_order_cond_def[i_f2py++].data = cinv; +} +extern void F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_cond(void) { + F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(f2py_setup_third_order_cond); +} + +/*need_f90modhooks*/ + +/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ + +/******************* See f2py2e/common_rules.py: buildhooks *******************/ + +/*need_commonhooks*/ + +/**************************** See f2py2e/rules.py ****************************/ + +static FortranDataDef f2py_routine_defs[] = { + +/*eof routine_defs*/ + {NULL} +}; + +static PyMethodDef f2py_module_methods[] = { + + {NULL,NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "thermal_conductivity", + NULL, + -1, + f2py_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit_thermal_conductivity(void) { + int i; + PyObject *m,*d, *s, *tmp; + m = thermal_conductivity_module = PyModule_Create(&moduledef); + Py_SET_TYPE(&PyFortran_Type, &PyType_Type); + import_array(); + if (PyErr_Occurred()) + {PyErr_SetString(PyExc_ImportError, "can't initialize module thermal_conductivity (failed to import numpy)"); return m;} + d = PyModule_GetDict(m); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + s = PyUnicode_FromString( + "This module 'thermal_conductivity' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" +"Fortran 90/95 modules:\n"" get_lf --- calculate_lineshapes(),calculate_lineshapes_mode_mixing(),calculate_lineshapes_cartesian(),calculate_lifetimes_selfconsistently(),solve_selfconsistent_equation(),calculate_correlation_function(),calculate_lifetimes_perturbative(),calculate_lifetimes(),calculate_self_energy_la(),calculate_self_energy_p(),calculate_self_energy_full(),check_if_gamma(),vec_dot_mat(),calculate_real_part_via_kramers_kronig(),calculate_real_part_via_kramers_kronig_2d(),hilbert_transform_via_fft(),ht(),cfft(),inv(),interpolate_fc2()"" scattering_grids --- get_scattering_q_grid(),same_vector(),same_vector_nopbc()"" third_order_centering --- analysis(),center(),center_sparse(),pre_center(),assign(),within_dmax(),compute_perimeter(),three_to_one_len(),three_to_one(),one_to_three_len(),one_to_three(),min_el_wise_2(),max_el_wise_2(),min_el_wise_3(),max_el_wise_3(),cryst_to_cart()"" third_order_cond --- interpol_v2(),interpol_v3(),compute_full_dynamic_bubble_single(),compute_diag_dynamic_bubble_single(),compute_perturb_selfnrg_single(),compute_spectralf_diag_single(),lambda_dynamic_single(),lambda_dynamic_value_single(),calculate_spectral_function(),calculate_spectral_function_mode_mixing(),calculate_spectral_function_cartesian(),bose_freq(),eq_freq(),f_bose(),df_bose(),gaussian_function(),eliminate_transl(),cinv()""."); + PyDict_SetItemString(d, "__doc__", s); + Py_DECREF(s); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__f2py_numpy_version__", s); + Py_DECREF(s); + thermal_conductivity_error = PyErr_NewException ("thermal_conductivity.error", NULL, NULL); + /* + * Store the error object inside the dict, so that it could get deallocated. + * (in practice, this is a module, so it likely will not and cannot.) + */ + PyDict_SetItemString(d, "_thermal_conductivity_error", thermal_conductivity_error); + Py_DECREF(thermal_conductivity_error); + for(i=0;f2py_routine_defs[i].name!=NULL;i++) { + tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); + PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); + Py_DECREF(tmp); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*eof initf2pywraphooks*/ + PyDict_SetItemString(d, "third_order_cond", PyFortranObject_New(f2py_third_order_cond_def,f2py_init_third_order_cond)); + PyDict_SetItemString(d, "third_order_centering", PyFortranObject_New(f2py_third_order_centering_def,f2py_init_third_order_centering)); + PyDict_SetItemString(d, "scattering_grids", PyFortranObject_New(f2py_scattering_grids_def,f2py_init_scattering_grids)); + PyDict_SetItemString(d, "get_lf", PyFortranObject_New(f2py_get_lf_def,f2py_init_get_lf)); +/*eof initf90modhooks*/ + +/*eof initcommonhooks*/ + + +#ifdef F2PY_REPORT_ATEXIT + if (! PyErr_Occurred()) + on_exit(f2py_report_on_exit,(void*)"thermal_conductivity"); +#endif + return m; +} +#ifdef __cplusplus +} +#endif diff --git a/f2py_wrappers/thirdorder-f2pywrappers2.f90 b/f2py_wrappers/thirdorder-f2pywrappers2.f90 new file mode 100644 index 00000000..2e7ee112 --- /dev/null +++ b/f2py_wrappers/thirdorder-f2pywrappers2.f90 @@ -0,0 +1,585 @@ +! -*- f90 -*- +! This file is autogenerated with f2py (version:1.26.4) +! It contains Fortran 90 wrappers to fortran functions. + + subroutine f2py_third_order_asr_getdims_p(r,s,f2pysetdata,flag) + use third_order_asr, only: d => 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),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_third_order_asr_getdims_p + subroutine f2py_third_order_asr_getdims_index_blocks_r2(r,s,f2pyse& + &tdata,flag) + use third_order_asr, only: d => index_blocks_r2 + + 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_third_order_asr_getdims_index_blocks_r2 + subroutine f2py_third_order_asr_getdims_num_blocks_r2(r,s,f2pysetd& + &ata,flag) + use third_order_asr, only: d => num_blocks_r2 + + 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_third_order_asr_getdims_num_blocks_r2 + subroutine f2pywrap_third_order_asr_geq (geqf2pywrap, v1, v2, lat,& + & pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) + use third_order_asr, only : geq + logical pbc + integer f2py_v1_d0 + integer f2py_v2_d0 + integer f2py_lat_d0 + integer v1(f2py_v1_d0) + integer v2(f2py_v2_d0) + integer lat(f2py_lat_d0) + logical geqf2pywrap + geqf2pywrap = .not.(.not.geq(v1, v2, lat, pbc)) + end subroutine f2pywrap_third_order_asr_geq + subroutine f2pywrap_third_order_asr_f (ff2pywrap, x) + use third_order_asr, only : f + integer x(6) + integer ff2pywrap(6,5) + ff2pywrap = f(x) + end subroutine f2pywrap_third_order_asr_f + + subroutine f2pyinitthird_order_asr(f2pysetupfunc) + use third_order_asr, only : perm_initialized + use third_order_asr, only : p + use third_order_asr, only : r2index_initialized + use third_order_asr, only : index_blocks_r2 + use third_order_asr, only : num_blocks_r2 + use third_order_asr, only : initialize_r2index + use third_order_asr, only : initialize_perm + use third_order_asr, only : impose_perm_sym + use third_order_asr, only : impose_asr_3rd + use third_order_asr, only : impose_asr + interface + subroutine f2pywrap_third_order_asr_geq (geqf2pywrap, v1, v2, lat,& + & pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) + logical pbc + integer f2py_v1_d0 + integer f2py_v2_d0 + integer f2py_lat_d0 + integer v1(f2py_v1_d0) + integer v2(f2py_v2_d0) + integer lat(f2py_lat_d0) + logical geqf2pywrap + end subroutine f2pywrap_third_order_asr_geq + subroutine f2pywrap_third_order_asr_f (ff2pywrap, x) + integer x(6) + integer ff2pywrap(6,5) + end subroutine f2pywrap_third_order_asr_f + end interface + external f2pysetupfunc + external f2py_third_order_asr_getdims_p + external f2py_third_order_asr_getdims_index_blocks_r2 + external f2py_third_order_asr_getdims_num_blocks_r2 + call f2pysetupfunc(perm_initialized,f2py_third_order_asr_getdims_p& + &,r2index_initialized,f2py_third_order_asr_getdims_index_blocks_r2,& + &f2py_third_order_asr_getdims_num_blocks_r2,initialize_r2index,init& + &ialize_perm,f2pywrap_third_order_asr_geq,f2pywrap_third_order_asr_& + &f,impose_perm_sym,impose_asr_3rd,impose_asr) + end subroutine f2pyinitthird_order_asr + + subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& + &f2pywrap, v1, v2, v3, d1, d2, d3, tol) + use third_order_centering, only : within_dmax + real(kind=8) d1 + real(kind=8) d2 + real(kind=8) d3 + real(kind=8) tol + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + logical within_dmaxf2pywrap + within_dmaxf2pywrap = .not.(.not.within_dmax(v1, v2, v3, d1, d2, d& + &3, tol)) + end subroutine f2pywrap_third_order_centering_within_dmax + subroutine f2pywrap_third_order_centering_compute_perimeter (compu& + &te_perimeterf2pywrap, v1, v2, v3) + use third_order_centering, only : compute_perimeter + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + real(kind=8) compute_perimeterf2pywrap + compute_perimeterf2pywrap = compute_perimeter(v1, v2, v3) + end subroutine f2pywrap_third_order_centering_compute_perimeter + subroutine f2pywrap_third_order_centering_three_to_one_len (three_& + &to_one_lenf2pywrap, v, v_min, v_len) + use third_order_centering, only : three_to_one_len + integer v(3) + integer v_min(3) + integer v_len(3) + integer three_to_one_lenf2pywrap + three_to_one_lenf2pywrap = three_to_one_len(v, v_min, v_len) + end subroutine f2pywrap_third_order_centering_three_to_one_len + subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& + &nef2pywrap, v, v_min, v_max) + use third_order_centering, only : three_to_one + integer v(3) + integer v_min(3) + integer v_max(3) + integer three_to_onef2pywrap + three_to_onef2pywrap = three_to_one(v, v_min, v_max) + end subroutine f2pywrap_third_order_centering_three_to_one + subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& + &_three_lenf2pywrap, j, v_min, v_len) + use third_order_centering, only : one_to_three_len + integer j + integer v_min(3) + integer v_len(3) + integer one_to_three_lenf2pywrap(3) + one_to_three_lenf2pywrap = one_to_three_len(j, v_min, v_len) + end subroutine f2pywrap_third_order_centering_one_to_three_len + subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& + &eef2pywrap, j, v_min, v_max) + use third_order_centering, only : one_to_three + integer j + integer v_min(3) + integer v_max(3) + integer one_to_threef2pywrap(3) + one_to_threef2pywrap = one_to_three(j, v_min, v_max) + end subroutine f2pywrap_third_order_centering_one_to_three + subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& + &se_2f2pywrap, a, b) + use third_order_centering, only : min_el_wise_2 + integer a(3) + integer b(3) + integer min_el_wise_2f2pywrap(3) + min_el_wise_2f2pywrap = min_el_wise_2(a, b) + end subroutine f2pywrap_third_order_centering_min_el_wise_2 + subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& + &se_2f2pywrap, a, b) + use third_order_centering, only : max_el_wise_2 + integer a(3) + integer b(3) + integer max_el_wise_2f2pywrap(3) + max_el_wise_2f2pywrap = max_el_wise_2(a, b) + end subroutine f2pywrap_third_order_centering_max_el_wise_2 + subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& + &se_3f2pywrap, a, b, c) + use third_order_centering, only : min_el_wise_3 + integer a(3) + integer b(3) + integer c(3) + integer min_el_wise_3f2pywrap(3) + min_el_wise_3f2pywrap = min_el_wise_3(a, b, c) + end subroutine f2pywrap_third_order_centering_min_el_wise_3 + subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& + &se_3f2pywrap, a, b, c) + use third_order_centering, only : max_el_wise_3 + integer a(3) + integer b(3) + integer c(3) + integer max_el_wise_3f2pywrap(3) + max_el_wise_3f2pywrap = max_el_wise_3(a, b, c) + end subroutine f2pywrap_third_order_centering_max_el_wise_3 + subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& + &cartf2pywrap, v, alat) + use third_order_centering, only : cryst_to_cart + integer v(3) + real(kind=8) alat(3,3) + real(kind=8) cryst_to_cartf2pywrap(3) + cryst_to_cartf2pywrap = cryst_to_cart(v, alat) + end subroutine f2pywrap_third_order_centering_cryst_to_cart + + subroutine f2pyinitthird_order_centering(f2pysetupfunc) + use third_order_centering, only : analysis + use third_order_centering, only : center + use third_order_centering, only : center_sparse + use third_order_centering, only : pre_center + use third_order_centering, only : assign + interface + subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& + &f2pywrap, v1, v2, v3, d1, d2, d3, tol) + real(kind=8) d1 + real(kind=8) d2 + real(kind=8) d3 + real(kind=8) tol + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + logical within_dmaxf2pywrap + end subroutine f2pywrap_third_order_centering_within_dmax + subroutine f2pywrap_third_order_centering_compute_perimeter (compu& + &te_perimeterf2pywrap, v1, v2, v3) + real(kind=8) v1(3) + real(kind=8) v2(3) + real(kind=8) v3(3) + real(kind=8) compute_perimeterf2pywrap + end subroutine f2pywrap_third_order_centering_compute_perimeter + subroutine f2pywrap_third_order_centering_three_to_one_len (three_& + &to_one_lenf2pywrap, v, v_min, v_len) + integer v(3) + integer v_min(3) + integer v_len(3) + integer three_to_one_lenf2pywrap + end subroutine f2pywrap_third_order_centering_three_to_one_len + subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& + &nef2pywrap, v, v_min, v_max) + integer v(3) + integer v_min(3) + integer v_max(3) + integer three_to_onef2pywrap + end subroutine f2pywrap_third_order_centering_three_to_one + subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& + &_three_lenf2pywrap, j, v_min, v_len) + integer j + integer v_min(3) + integer v_len(3) + integer one_to_three_lenf2pywrap(3) + end subroutine f2pywrap_third_order_centering_one_to_three_len + subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& + &eef2pywrap, j, v_min, v_max) + integer j + integer v_min(3) + integer v_max(3) + integer one_to_threef2pywrap(3) + end subroutine f2pywrap_third_order_centering_one_to_three + subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& + &se_2f2pywrap, a, b) + integer a(3) + integer b(3) + integer min_el_wise_2f2pywrap(3) + end subroutine f2pywrap_third_order_centering_min_el_wise_2 + subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& + &se_2f2pywrap, a, b) + integer a(3) + integer b(3) + integer max_el_wise_2f2pywrap(3) + end subroutine f2pywrap_third_order_centering_max_el_wise_2 + subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& + &se_3f2pywrap, a, b, c) + integer a(3) + integer b(3) + integer c(3) + integer min_el_wise_3f2pywrap(3) + end subroutine f2pywrap_third_order_centering_min_el_wise_3 + subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& + &se_3f2pywrap, a, b, c) + integer a(3) + integer b(3) + integer c(3) + integer max_el_wise_3f2pywrap(3) + end subroutine f2pywrap_third_order_centering_max_el_wise_3 + subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& + &cartf2pywrap, v, alat) + integer v(3) + real(kind=8) alat(3,3) + real(kind=8) cryst_to_cartf2pywrap(3) + end subroutine f2pywrap_third_order_centering_cryst_to_cart + end interface + external f2pysetupfunc + call f2pysetupfunc(analysis,center,center_sparse,pre_center,assign& + &,f2pywrap_third_order_centering_within_dmax,f2pywrap_third_order_c& + &entering_compute_perimeter,f2pywrap_third_order_centering_three_to& + &_one_len,f2pywrap_third_order_centering_three_to_one,f2pywrap_thir& + &d_order_centering_one_to_three_len,f2pywrap_third_order_centering_& + &one_to_three,f2pywrap_third_order_centering_min_el_wise_2,f2pywrap& + &_third_order_centering_max_el_wise_2,f2pywrap_third_order_centerin& + &g_min_el_wise_3,f2pywrap_third_order_centering_max_el_wise_3,f2pyw& + &rap_third_order_centering_cryst_to_cart) + end subroutine f2pyinitthird_order_centering + + subroutine f2pywrap_third_order_cond_centering_norm (normf2pywrap,& + & r) + use third_order_cond_centering, only : norm + real(kind=8) r(3) + real(kind=8) normf2pywrap + normf2pywrap = norm(r) + end subroutine f2pywrap_third_order_cond_centering_norm + subroutine f2pywrap_third_order_cond_centering_norma2 (norma2f2pyw& + &rap, m, f2py_m_d0, f2py_m_d1) + use third_order_cond_centering, only : norma2 + integer f2py_m_d0 + integer f2py_m_d1 + real(kind=8) m(f2py_m_d0,f2py_m_d1) + real(kind=8) norma2f2pywrap + norma2f2pywrap = norma2(m) + end subroutine f2pywrap_third_order_cond_centering_norma2 + subroutine f2pywrap_third_order_cond_centering_norma3 (norma3f2pyw& + &rap, m, f2py_m_d0, f2py_m_d1, f2py_m_d2) + use third_order_cond_centering, only : norma3 + integer f2py_m_d0 + integer f2py_m_d1 + integer f2py_m_d2 + real(kind=8) m(f2py_m_d0,f2py_m_d1,f2py_m_d2) + real(kind=8) norma3f2pywrap + norma3f2pywrap = norma3(m) + end subroutine f2pywrap_third_order_cond_centering_norma3 + subroutine f2pywrap_third_order_cond_centering_dot (dotf2pywrap, v& + &, m) + use third_order_cond_centering, only : dot + real(kind=8) v(3) + real(kind=8) m(3,3) + real(kind=8) dotf2pywrap(3) + dotf2pywrap = dot(v, m) + end subroutine f2pywrap_third_order_cond_centering_dot + + subroutine f2pyinitthird_order_cond_centering(f2pysetupfunc) + use third_order_cond_centering, only : check_permutation_symmetry + use third_order_cond_centering, only : apply_permutation_symmetry + use third_order_cond_centering, only : apply_permutation_symmetry_& + &local + use third_order_cond_centering, only : number_of_triplets + use third_order_cond_centering, only : find_triplets + use third_order_cond_centering, only : distribute_fc3 + use third_order_cond_centering, only : apply_asr + use third_order_cond_centering, only : find_unique_rvec + interface + subroutine f2pywrap_third_order_cond_centering_norm (normf2pywrap,& + & r) + real(kind=8) r(3) + real(kind=8) normf2pywrap + end subroutine f2pywrap_third_order_cond_centering_norm + subroutine f2pywrap_third_order_cond_centering_norma2 (norma2f2pyw& + &rap, m, f2py_m_d0, f2py_m_d1) + integer f2py_m_d0 + integer f2py_m_d1 + real(kind=8) m(f2py_m_d0,f2py_m_d1) + real(kind=8) norma2f2pywrap + end subroutine f2pywrap_third_order_cond_centering_norma2 + subroutine f2pywrap_third_order_cond_centering_norma3 (norma3f2pyw& + &rap, m, f2py_m_d0, f2py_m_d1, f2py_m_d2) + integer f2py_m_d0 + integer f2py_m_d1 + integer f2py_m_d2 + real(kind=8) m(f2py_m_d0,f2py_m_d1,f2py_m_d2) + real(kind=8) norma3f2pywrap + end subroutine f2pywrap_third_order_cond_centering_norma3 + subroutine f2pywrap_third_order_cond_centering_dot (dotf2pywrap, v& + &, m) + real(kind=8) v(3) + real(kind=8) m(3,3) + real(kind=8) dotf2pywrap(3) + end subroutine f2pywrap_third_order_cond_centering_dot + end interface + external f2pysetupfunc + call f2pysetupfunc(check_permutation_symmetry,apply_permutation_sy& + &mmetry,apply_permutation_symmetry_local,number_of_triplets,find_tr& + &iplets,distribute_fc3,apply_asr,find_unique_rvec,f2pywrap_third_or& + &der_cond_centering_norm,f2pywrap_third_order_cond_centering_norma2& + &,f2pywrap_third_order_cond_centering_norma3,f2pywrap_third_order_c& + &ond_centering_dot) + end subroutine f2pyinitthird_order_cond_centering + + subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& + & t) + use third_order_cond, only : f_bose + real(kind=8) freq + real(kind=8) t + real(kind=8) f_bosef2pywrap + f_bosef2pywrap = f_bose(freq, t) + end subroutine f2pywrap_third_order_cond_f_bose + subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& + &q, t) + use third_order_cond, only : df_bose + real(kind=8) freq + real(kind=8) t + real(kind=8) df_bosef2pywrap + df_bosef2pywrap = df_bose(freq, t) + end subroutine f2pywrap_third_order_cond_df_bose + subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& + &unctionf2pywrap, x, sigma) + use third_order_cond, only : gaussian_function + real(kind=8) x + real(kind=8) sigma + real(kind=8) gaussian_functionf2pywrap + gaussian_functionf2pywrap = gaussian_function(x, sigma) + end subroutine f2pywrap_third_order_cond_gaussian_function + subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& + &_d0, f2py_a_d1) + use third_order_cond, only : cinv + integer f2py_a_d0 + integer f2py_a_d1 + complex(kind=8) a(f2py_a_d0,f2py_a_d1) + complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) + cinvf2pywrap = cinv(a) + end subroutine f2pywrap_third_order_cond_cinv + + subroutine f2pyinitthird_order_cond(f2pysetupfunc) + use third_order_cond, only : interpol_v2 + use third_order_cond, only : interpol_v3 + use third_order_cond, only : compute_full_dynamic_bubble_single + use third_order_cond, only : compute_diag_dynamic_bubble_single + use third_order_cond, only : compute_perturb_selfnrg_single + use third_order_cond, only : compute_spectralf_diag_single + use third_order_cond, only : lambda_dynamic_single + use third_order_cond, only : lambda_dynamic_value_single + use third_order_cond, only : calculate_spectral_function + use third_order_cond, only : calculate_spectral_function_mode_mixi& + &ng + use third_order_cond, only : calculate_spectral_function_cartesian + use third_order_cond, only : bose_freq + use third_order_cond, only : eq_freq + use third_order_cond, only : eliminate_transl + interface + subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& + & t) + real(kind=8) freq + real(kind=8) t + real(kind=8) f_bosef2pywrap + end subroutine f2pywrap_third_order_cond_f_bose + subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& + &q, t) + real(kind=8) freq + real(kind=8) t + real(kind=8) df_bosef2pywrap + end subroutine f2pywrap_third_order_cond_df_bose + subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& + &unctionf2pywrap, x, sigma) + real(kind=8) x + real(kind=8) sigma + real(kind=8) gaussian_functionf2pywrap + end subroutine f2pywrap_third_order_cond_gaussian_function + subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& + &_d0, f2py_a_d1) + integer f2py_a_d0 + integer f2py_a_d1 + complex(kind=8) a(f2py_a_d0,f2py_a_d1) + complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) + end subroutine f2pywrap_third_order_cond_cinv + end interface + external f2pysetupfunc + call f2pysetupfunc(interpol_v2,interpol_v3,compute_full_dynamic_bu& + &bble_single,compute_diag_dynamic_bubble_single,compute_perturb_sel& + &fnrg_single,compute_spectralf_diag_single,lambda_dynamic_single,la& + &mbda_dynamic_value_single,calculate_spectral_function,calculate_sp& + &ectral_function_mode_mixing,calculate_spectral_function_cartesian,& + &bose_freq,eq_freq,f2pywrap_third_order_cond_f_bose,f2pywrap_third_& + &order_cond_df_bose,f2pywrap_third_order_cond_gaussian_function,eli& + &minate_transl,f2pywrap_third_order_cond_cinv) + end subroutine f2pyinitthird_order_cond + + subroutine f2pywrap_third_order_bubble_f_bose (f_bosef2pywrap, fre& + &q, t) + use third_order_bubble, only : f_bose + real(kind=8) freq + real(kind=8) t + real(kind=8) f_bosef2pywrap + f_bosef2pywrap = f_bose(freq, t) + end subroutine f2pywrap_third_order_bubble_f_bose + subroutine f2pywrap_third_order_bubble_df_bose (df_bosef2pywrap, f& + &req, t) + use third_order_bubble, only : df_bose + real(kind=8) freq + real(kind=8) t + real(kind=8) df_bosef2pywrap + df_bosef2pywrap = df_bose(freq, t) + end subroutine f2pywrap_third_order_bubble_df_bose + + subroutine f2pyinitthird_order_bubble(f2pysetupfunc) + use third_order_bubble, only : compute_static_bubble + use third_order_bubble, only : compute_dynamic_bubble + use third_order_bubble, only : compute_diag_dynamic_bubble + use third_order_bubble, only : compute_perturb_selfnrg + use third_order_bubble, only : compute_spectralf + use third_order_bubble, only : compute_spectralf_diag + use third_order_bubble, only : lambda + use third_order_bubble, only : lambda_dynamic + use third_order_bubble, only : lambda_dynamic_value + use third_order_bubble, only : bose_freq + use third_order_bubble, only : invzmat + use third_order_bubble, only : eliminate_transl + interface + subroutine f2pywrap_third_order_bubble_f_bose (f_bosef2pywrap, fre& + &q, t) + real(kind=8) freq + real(kind=8) t + real(kind=8) f_bosef2pywrap + end subroutine f2pywrap_third_order_bubble_f_bose + subroutine f2pywrap_third_order_bubble_df_bose (df_bosef2pywrap, f& + &req, t) + real(kind=8) freq + real(kind=8) t + real(kind=8) df_bosef2pywrap + end subroutine f2pywrap_third_order_bubble_df_bose + end interface + external f2pysetupfunc + call f2pysetupfunc(compute_static_bubble,compute_dynamic_bubble,co& + &mpute_diag_dynamic_bubble,compute_perturb_selfnrg,compute_spectral& + &f,compute_spectralf_diag,lambda,lambda_dynamic,lambda_dynamic_valu& + &e,bose_freq,f2pywrap_third_order_bubble_f_bose,f2pywrap_third_orde& + &r_bubble_df_bose,invzmat,eliminate_transl) + end subroutine f2pyinitthird_order_bubble + + + subroutine f2pyinitthird_order_interpol(f2pysetupfunc) + use third_order_interpol, only : interpol + external f2pysetupfunc + call f2pysetupfunc(interpol) + end subroutine f2pyinitthird_order_interpol + + diff --git a/f2py_wrappers/thirdordermodule.c b/f2py_wrappers/thirdordermodule.c new file mode 100644 index 00000000..4279164d --- /dev/null +++ b/f2py_wrappers/thirdordermodule.c @@ -0,0 +1,13066 @@ +/* File: thirdordermodule.c + * This file is auto-generated with f2py (version:1.26.4). + * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, + * written by Pearu Peterson . + * Generation date: Mon Sep 15 06:38:01 2025 + * Do not edit this file directly unless you know what you are doing!!! + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ + +/* Unconditionally included */ +#include +#include + +/*********************** See f2py2e/cfuncs.py: includes ***********************/ +#include "fortranobject.h" +#include + +/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ +static PyObject *thirdorder_error; +static PyObject *thirdorder_module; + +/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ +typedef struct {double r,i;} complex_double; + +/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ +/*need_typedefs_generated*/ + +/********************** See f2py2e/cfuncs.py: cppmacros **********************/ + +/* See fortranobject.h for definitions. The macros here are provided for BC. */ +#define rank f2py_rank +#define shape f2py_shape +#define fshape f2py_shape +#define len f2py_len +#define flen f2py_flen +#define slen f2py_slen +#define size f2py_size + + +#define CHECKSCALAR(check,tcheck,name,show,var)\ + if (!(check)) {\ + char errstring[256];\ + sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ + PyErr_SetString(thirdorder_error,errstring);\ + /*goto capi_fail;*/\ + } else + +#ifdef DEBUGCFUNCS +#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); +#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ + PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ + fprintf(stderr,"\n"); +#else +#define CFUNCSMESS(mess) +#define CFUNCSMESSPY(mess,obj) +#endif + + +#ifndef max +#define max(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) ((a < b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef MIN +#define MIN(a,b) ((a < b) ? (a) : (b)) +#endif + + +#define CHECKARRAY(check,tcheck,name) \ + if (!(check)) {\ + PyErr_SetString(thirdorder_error,"("tcheck") failed for "name);\ + /*goto capi_fail;*/\ + } else + +#define pyobj_from_complex_double1(v) (PyComplex_FromDoubles(v.r,v.i)) + +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F +#else +#define F_FUNC(f,F) _##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F##_ +#else +#define F_FUNC(f,F) _##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F +#else +#define F_FUNC(f,F) f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F##_ +#else +#define F_FUNC(f,F) f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) +#else +#define F_FUNC_US(f,F) F_FUNC(f,F) +#endif + + +/************************ See f2py2e/cfuncs.py: cfuncs ************************/ + +static int +int_from_pyobj(int* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + + if (PyLong_Check(obj)) { + *v = Npy__PyLong_AsInt(obj); + return !(*v == -1 && PyErr_Occurred()); + } + + tmp = PyNumber_Long(obj); + if (tmp) { + *v = Npy__PyLong_AsInt(tmp); + Py_DECREF(tmp); + return !(*v == -1 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (int_from_pyobj(v, tmp, errmess)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + + { + PyObject* err = PyErr_Occurred(); + if (err == NULL) { + err = thirdorder_error; + } + PyErr_SetString(err, errmess); + } + return 0; +} + + +static int +double_from_pyobj(double* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + if (PyFloat_Check(obj)) { + *v = PyFloat_AsDouble(obj); + return !(*v == -1.0 && PyErr_Occurred()); + } + + tmp = PyNumber_Float(obj); + if (tmp) { + *v = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return !(*v == -1.0 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} + Py_DECREF(tmp); + } + { + PyObject* err = PyErr_Occurred(); + if (err==NULL) err = thirdorder_error; + PyErr_SetString(err,errmess); + } + return 0; +} + + +/********************* See f2py2e/cfuncs.py: userincludes *********************/ +/*need_userincludes*/ + +/********************* See f2py2e/capi_rules.py: usercode *********************/ + + +/* See f2py2e/rules.py */ +/*eof externroutines*/ + +/******************** See f2py2e/capi_rules.py: usercode1 ********************/ + + +/******************* See f2py2e/cb_rules.py: buildcallback *******************/ +/*need_callbacks*/ + +/*********************** See f2py2e/rules.py: buildapi ***********************/ + +/***************************** initialize_r2index *****************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_initialize_r2index[] = "\ +initialize_r2index(xr2,xr2list,pbc,[totnum_r2,n_blocks,sclat])\n\nWrapper for ``initialize_r2index``.\ +\n\nParameters\n----------\n" +"xr2 : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2list : input rank-2 array('i') with bounds (3,totnum_r2)\n" +"pbc : input int\n" +"\nOther Parameters\n----------------\n" +"totnum_r2 : input int, optional\n Default: shape(xr2list, 1)\n" +"n_blocks : input int, optional\n Default: shape(xr2, 1)\n" +"sclat : input rank-1 array('i') with bounds (3)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_asr_initialize_r2index(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *xr2 = NULL; + npy_intp xr2_Dims[2] = {-1, -1}; + const int xr2_Rank = 2; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr2list = NULL; + npy_intp xr2list_Dims[2] = {-1, -1}; + const int xr2list_Rank = 2; + PyArrayObject *capi_xr2list_as_array = NULL; + int capi_xr2list_intent = 0; + PyObject *xr2list_capi = Py_None; + int totnum_r2 = 0; + PyObject *totnum_r2_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + static char *capi_kwlist[] = {"xr2","xr2list","pbc","totnum_r2","n_blocks","sclat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OOO:thirdorder.third_order_asr.initialize_r2index",\ + capi_kwlist,&xr2_capi,&xr2list_capi,&pbc_capi,&totnum_r2_capi,&n_blocks_capi,&sclat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable xr2 */ + xr2_Dims[0]=3; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_r2index: failed to create array from the 1st argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + /* Processing variable xr2list */ + xr2list_Dims[0]=3; + capi_xr2list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_r2index: failed to create array from the 2nd argument `xr2list`"; + capi_xr2list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2list_Dims,xr2list_Rank, capi_xr2list_intent,xr2list_capi,capi_errmess); + if (capi_xr2list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2list = (int *)(PyArray_DATA(capi_xr2list_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN|F2PY_OPTIONAL; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_r2index: failed to create array from the 3rd keyword `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.initialize_r2index() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2, 1) == n_blocks,"shape(xr2, 1) == n_blocks","2nd keyword n_blocks","initialize_r2index:n_blocks=%d",n_blocks) { + /* Processing variable totnum_r2 */ + if (totnum_r2_capi == Py_None) totnum_r2 = shape(xr2list, 1); else + f2py_success = int_from_pyobj(&totnum_r2,totnum_r2_capi,"thirdorder.third_order_asr.initialize_r2index() 1st keyword (totnum_r2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2list, 1) == totnum_r2,"shape(xr2list, 1) == totnum_r2","1st keyword totnum_r2","initialize_r2index:totnum_r2=%d",totnum_r2) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(xr2,xr2list,&totnum_r2,&n_blocks,sclat,&pbc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(xr2list, 1) == totnum_r2)*/ + } /*if (f2py_success) of totnum_r2*/ + /* End of cleaning variable totnum_r2 */ + } /*CHECKSCALAR(shape(xr2, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_xr2list_as_array!=xr2list_capi) { + Py_XDECREF(capi_xr2list_as_array); } + } /* if (capi_xr2list_as_array == NULL) ... else of xr2list */ + /* End of cleaning variable xr2list */ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of initialize_r2index *************************/ + +/****************************** initialize_perm ******************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_initialize_perm[] = "\ +initialize_perm(r23,sclat,pbc,[n_blocks])\n\nWrapper for ``initialize_perm``.\ +\n\nParameters\n----------\n" +"r23 : input rank-2 array('i') with bounds (6,n_blocks)\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(r23, 1)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_asr_initialize_perm(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *r23 = NULL; + npy_intp r23_Dims[2] = {-1, -1}; + const int r23_Rank = 2; + PyArrayObject *capi_r23_as_array = NULL; + int capi_r23_intent = 0; + PyObject *r23_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + static char *capi_kwlist[] = {"r23","sclat","pbc","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:thirdorder.third_order_asr.initialize_perm",\ + capi_kwlist,&r23_capi,&sclat_capi,&pbc_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable r23 */ + r23_Dims[0]=6; + capi_r23_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_perm: failed to create array from the 1st argument `r23`"; + capi_r23_as_array = ndarray_from_pyobj( NPY_INT,1,r23_Dims,r23_Rank, capi_r23_intent,r23_capi,capi_errmess); + if (capi_r23_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r23 = (int *)(PyArray_DATA(capi_r23_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_perm: failed to create array from the 2nd argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(r23, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.initialize_perm() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(r23, 1) == n_blocks,"shape(r23, 1) == n_blocks","1st keyword n_blocks","initialize_perm:n_blocks=%d",n_blocks) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(r23,&n_blocks,sclat,&pbc); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(r23, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_r23_as_array!=r23_capi) { + Py_XDECREF(capi_r23_as_array); } + } /* if (capi_r23_as_array == NULL) ... else of r23 */ + /* End of cleaning variable r23 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of initialize_perm ***************************/ + +/************************************ geq ************************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_geq[] = "\ +geq = geq(v1,v2,lat,pbc)\n\nWrapper for ``geq``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('i') with bounds (f2py_v1_d0)\n" +"v2 : input rank-1 array('i') with bounds (f2py_v2_d0)\n" +"lat : input rank-1 array('i') with bounds (f2py_lat_d0)\n" +"pbc : input int\n" +"\nReturns\n-------\n" +"geq : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_asr_geq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int geqf2pywrap = 0; + int *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + int *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + int *lat = NULL; + npy_intp lat_Dims[1] = {-1}; + const int lat_Rank = 1; + PyArrayObject *capi_lat_as_array = NULL; + int capi_lat_intent = 0; + PyObject *lat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + int f2py_v1_d0 = 0; + int f2py_v2_d0 = 0; + int f2py_lat_d0 = 0; + static char *capi_kwlist[] = {"v1","v2","lat","pbc",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:thirdorder.third_order_asr.geq",\ + capi_kwlist,&v1_capi,&v2_capi,&lat_capi,&pbc_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + ; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.geq: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_INT,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (int *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + ; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.geq: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_INT,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (int *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable lat */ + ; + capi_lat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.geq: failed to create array from the 3rd argument `lat`"; + capi_lat_as_array = ndarray_from_pyobj( NPY_INT,1,lat_Dims,lat_Rank, capi_lat_intent,lat_capi,capi_errmess); + if (capi_lat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat = (int *)(PyArray_DATA(capi_lat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable geqf2pywrap */ + /* Processing variable f2py_v1_d0 */ + f2py_v1_d0 = shape(v1, 0); + /* Processing variable f2py_v2_d0 */ + f2py_v2_d0 = shape(v2, 0); + /* Processing variable f2py_lat_d0 */ + f2py_lat_d0 = shape(lat, 0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&geqf2pywrap,v1,v2,lat,&pbc,&f2py_v1_d0,&f2py_v2_d0,&f2py_lat_d0); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",geqf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_lat_d0 */ + /* End of cleaning variable f2py_v2_d0 */ + /* End of cleaning variable f2py_v1_d0 */ + /* End of cleaning variable geqf2pywrap */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_lat_as_array!=lat_capi) { + Py_XDECREF(capi_lat_as_array); } + } /* if (capi_lat_as_array == NULL) ... else of lat */ + /* End of cleaning variable lat */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of geq *********************************/ + +/************************************* f *************************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_f[] = "\ +f = f(x)\n\nWrapper for ``f``.\ +\n\nParameters\n----------\n" +"x : input rank-1 array('i') with bounds (6)\n" +"\nReturns\n-------\n" +"f : rank-2 array('i') with bounds (6,5) and ff2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_asr_f(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *ff2pywrap = NULL; + npy_intp ff2pywrap_Dims[2] = {-1, -1}; + const int ff2pywrap_Rank = 2; + PyArrayObject *capi_ff2pywrap_as_array = NULL; + int capi_ff2pywrap_intent = 0; + int *x = NULL; + npy_intp x_Dims[1] = {-1}; + const int x_Rank = 1; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + static char *capi_kwlist[] = {"x",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thirdorder.third_order_asr.f",\ + capi_kwlist,&x_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + x_Dims[0]=6; + capi_x_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.f: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_INT,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (int *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable ff2pywrap */ + ff2pywrap_Dims[0]=6,ff2pywrap_Dims[1]=5; + capi_ff2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.f: failed to create array from the hidden `ff2pywrap`"; + capi_ff2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,ff2pywrap_Dims,ff2pywrap_Rank, capi_ff2pywrap_intent,Py_None,capi_errmess); + if (capi_ff2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ff2pywrap = (int *)(PyArray_DATA(capi_ff2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ff2pywrap,x); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_ff2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_ff2pywrap_as_array == NULL) ... else of ff2pywrap */ + /* End of cleaning variable ff2pywrap */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************** end of f **********************************/ + +/****************************** impose_perm_sym ******************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_impose_perm_sym[] = "\ +fcvar,fc_sym = impose_perm_sym(fc,r23,sclat,pbc,verbose,[nat,n_blocks])\n\nWrapper for ``impose_perm_sym``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"r23 : input rank-2 array('i') with bounds (6,n_blocks)\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"verbose : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(fc, 3)\n" +"\nReturns\n-------\n" +"fcvar : float\n" +"fc_sym : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_asr_impose_perm_sym(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + int *r23 = NULL; + npy_intp r23_Dims[2] = {-1, -1}; + const int r23_Rank = 2; + PyArrayObject *capi_r23_as_array = NULL; + int capi_r23_intent = 0; + PyObject *r23_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + double fcvar = 0; + double *fc_sym = NULL; + npy_intp fc_sym_Dims[4] = {-1, -1, -1, -1}; + const int fc_sym_Rank = 4; + PyArrayObject *capi_fc_sym_as_array = NULL; + int capi_fc_sym_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"fc","r23","sclat","pbc","verbose","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:thirdorder.third_order_asr.impose_perm_sym",\ + capi_kwlist,&fc_capi,&r23_capi,&sclat_capi,&pbc_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the 3rd argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable verbose */ + verbose = (int)PyObject_IsTrue(verbose_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable fcvar */ + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_asr.impose_perm_sym() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_perm_sym:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.impose_perm_sym() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","2nd keyword n_blocks","impose_perm_sym:n_blocks=%d",n_blocks) { + /* Processing variable r23 */ + r23_Dims[0]=6,r23_Dims[1]=n_blocks; + capi_r23_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the 2nd argument `r23`"; + capi_r23_as_array = ndarray_from_pyobj( NPY_INT,1,r23_Dims,r23_Rank, capi_r23_intent,r23_capi,capi_errmess); + if (capi_r23_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r23 = (int *)(PyArray_DATA(capi_r23_as_array)); + + /* Processing variable fc_sym */ + fc_sym_Dims[0]=3 * nat,fc_sym_Dims[1]=3 * nat,fc_sym_Dims[2]=3 * nat,fc_sym_Dims[3]=n_blocks; + capi_fc_sym_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the hidden `fc_sym`"; + capi_fc_sym_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_sym_Dims,fc_sym_Rank, capi_fc_sym_intent,Py_None,capi_errmess); + if (capi_fc_sym_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_sym = (double *)(PyArray_DATA(capi_fc_sym_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r23,sclat,&pbc,&verbose,&fcvar,fc_sym,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("dN",fcvar,capi_fc_sym_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_sym_as_array == NULL) ... else of fc_sym */ + /* End of cleaning variable fc_sym */ + if((PyObject *)capi_r23_as_array!=r23_capi) { + Py_XDECREF(capi_r23_as_array); } + } /* if (capi_r23_as_array == NULL) ... else of r23 */ + /* End of cleaning variable r23 */ + } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + /* End of cleaning variable fcvar */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of impose_perm_sym ***************************/ + +/******************************* impose_asr_3rd *******************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_impose_asr_3rd[] = "\ +fcvar,sum3rd,fc_asr = impose_asr_3rd(fc,xr2,xr2list,pow,sclat,pbc,verbose,[totnum_r2,nat,n_blocks])\n\nWrapper for ``impose_asr_3rd``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"xr2 : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2list : input rank-2 array('i') with bounds (3,totnum_r2)\n" +"pow : input float\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"verbose : input int\n" +"\nOther Parameters\n----------------\n" +"totnum_r2 : input int, optional\n Default: shape(xr2list, 1)\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(fc, 3)\n" +"\nReturns\n-------\n" +"fcvar : float\n" +"sum3rd : float\n" +"fc_asr : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_asr_impose_asr_3rd(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,double*,int*,int*,int*,double*,double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[2] = {-1, -1}; + const int xr2_Rank = 2; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr2list = NULL; + npy_intp xr2list_Dims[2] = {-1, -1}; + const int xr2list_Rank = 2; + PyArrayObject *capi_xr2list_as_array = NULL; + int capi_xr2list_intent = 0; + PyObject *xr2list_capi = Py_None; + double pow = 0; + PyObject *pow_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + double fcvar = 0; + double sum3rd = 0; + double *fc_asr = NULL; + npy_intp fc_asr_Dims[4] = {-1, -1, -1, -1}; + const int fc_asr_Rank = 4; + PyArrayObject *capi_fc_asr_as_array = NULL; + int capi_fc_asr_intent = 0; + int totnum_r2 = 0; + PyObject *totnum_r2_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"fc","xr2","xr2list","pow","sclat","pbc","verbose","totnum_r2","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OOO:thirdorder.third_order_asr.impose_asr_3rd",\ + capi_kwlist,&fc_capi,&xr2_capi,&xr2list_capi,&pow_capi,&sclat_capi,&pbc_capi,&verbose_capi,&totnum_r2_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable pow */ + f2py_success = double_from_pyobj(&pow,pow_capi,"thirdorder.third_order_asr.impose_asr_3rd() 4th argument (pow) can't be converted to double"); + if (f2py_success) { + /* Processing variable xr2list */ + xr2list_Dims[0]=3; + capi_xr2list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 3rd argument `xr2list`"; + capi_xr2list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2list_Dims,xr2list_Rank, capi_xr2list_intent,xr2list_capi,capi_errmess); + if (capi_xr2list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2list = (int *)(PyArray_DATA(capi_xr2list_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 5th argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable verbose */ + verbose = (int)PyObject_IsTrue(verbose_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable fcvar */ + /* Processing variable sum3rd */ + /* Processing variable totnum_r2 */ + if (totnum_r2_capi == Py_None) totnum_r2 = shape(xr2list, 1); else + f2py_success = int_from_pyobj(&totnum_r2,totnum_r2_capi,"thirdorder.third_order_asr.impose_asr_3rd() 1st keyword (totnum_r2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2list, 1) == totnum_r2,"shape(xr2list, 1) == totnum_r2","1st keyword totnum_r2","impose_asr_3rd:totnum_r2=%d",totnum_r2) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_asr.impose_asr_3rd() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","2nd keyword nat","impose_asr_3rd:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.impose_asr_3rd() 3rd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","3rd keyword n_blocks","impose_asr_3rd:n_blocks=%d",n_blocks) { + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=n_blocks; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 2nd argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + /* Processing variable fc_asr */ + fc_asr_Dims[0]=3 * nat,fc_asr_Dims[1]=3 * nat,fc_asr_Dims[2]=3 * nat,fc_asr_Dims[3]=n_blocks; + capi_fc_asr_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the hidden `fc_asr`"; + capi_fc_asr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_asr_Dims,fc_asr_Rank, capi_fc_asr_intent,Py_None,capi_errmess); + if (capi_fc_asr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_asr = (double *)(PyArray_DATA(capi_fc_asr_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,xr2,xr2list,&pow,sclat,&pbc,&verbose,&fcvar,&sum3rd,fc_asr,&totnum_r2,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("ddN",fcvar,sum3rd,capi_fc_asr_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_asr_as_array == NULL) ... else of fc_asr */ + /* End of cleaning variable fc_asr */ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(xr2list, 1) == totnum_r2)*/ + } /*if (f2py_success) of totnum_r2*/ + /* End of cleaning variable totnum_r2 */ + /* End of cleaning variable sum3rd */ + /* End of cleaning variable fcvar */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_xr2list_as_array!=xr2list_capi) { + Py_XDECREF(capi_xr2list_as_array); } + } /* if (capi_xr2list_as_array == NULL) ... else of xr2list */ + /* End of cleaning variable xr2list */ + } /*if (f2py_success) of pow*/ + /* End of cleaning variable pow */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of impose_asr_3rd ***************************/ + +/********************************* impose_asr *********************************/ +static char doc_f2py_rout_thirdorder_third_order_asr_impose_asr[] = "\ +fc_out = impose_asr(fc,r23,xr2,xr2list,pow,sclat,pbc,threshold,maxite,verbose,[totnum_r2,nat,n_blocks])\n\nWrapper for ``impose_asr``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"r23 : input rank-2 array('i') with bounds (6,n_blocks)\n" +"xr2 : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2list : input rank-2 array('i') with bounds (3,totnum_r2)\n" +"pow : input float\n" +"sclat : input rank-1 array('i') with bounds (3)\n" +"pbc : input int\n" +"threshold : input float\n" +"maxite : input int\n" +"verbose : input int\n" +"\nOther Parameters\n----------------\n" +"totnum_r2 : input int, optional\n Default: shape(xr2list, 1)\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(fc, 3)\n" +"\nReturns\n-------\n" +"fc_out : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_asr_impose_asr(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,double*,int*,int*,double*,int*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + int *r23 = NULL; + npy_intp r23_Dims[2] = {-1, -1}; + const int r23_Rank = 2; + PyArrayObject *capi_r23_as_array = NULL; + int capi_r23_intent = 0; + PyObject *r23_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[2] = {-1, -1}; + const int xr2_Rank = 2; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr2list = NULL; + npy_intp xr2list_Dims[2] = {-1, -1}; + const int xr2list_Rank = 2; + PyArrayObject *capi_xr2list_as_array = NULL; + int capi_xr2list_intent = 0; + PyObject *xr2list_capi = Py_None; + double pow = 0; + PyObject *pow_capi = Py_None; + int *sclat = NULL; + npy_intp sclat_Dims[1] = {-1}; + const int sclat_Rank = 1; + PyArrayObject *capi_sclat_as_array = NULL; + int capi_sclat_intent = 0; + PyObject *sclat_capi = Py_None; + int pbc = 0; + PyObject *pbc_capi = Py_None; + double threshold = 0; + PyObject *threshold_capi = Py_None; + int maxite = 0; + PyObject *maxite_capi = Py_None; + double *fc_out = NULL; + npy_intp fc_out_Dims[4] = {-1, -1, -1, -1}; + const int fc_out_Rank = 4; + PyArrayObject *capi_fc_out_as_array = NULL; + int capi_fc_out_intent = 0; + int verbose = 0; + PyObject *verbose_capi = Py_None; + int totnum_r2 = 0; + PyObject *totnum_r2_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"fc","r23","xr2","xr2list","pow","sclat","pbc","threshold","maxite","verbose","totnum_r2","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOOO|OOO:thirdorder.third_order_asr.impose_asr",\ + capi_kwlist,&fc_capi,&r23_capi,&xr2_capi,&xr2list_capi,&pow_capi,&sclat_capi,&pbc_capi,&threshold_capi,&maxite_capi,&verbose_capi,&totnum_r2_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable pow */ + f2py_success = double_from_pyobj(&pow,pow_capi,"thirdorder.third_order_asr.impose_asr() 5th argument (pow) can't be converted to double"); + if (f2py_success) { + /* Processing variable threshold */ + f2py_success = double_from_pyobj(&threshold,threshold_capi,"thirdorder.third_order_asr.impose_asr() 8th argument (threshold) can't be converted to double"); + if (f2py_success) { + /* Processing variable maxite */ + f2py_success = int_from_pyobj(&maxite,maxite_capi,"thirdorder.third_order_asr.impose_asr() 9th argument (maxite) can't be converted to int"); + if (f2py_success) { + /* Processing variable xr2list */ + xr2list_Dims[0]=3; + capi_xr2list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 4th argument `xr2list`"; + capi_xr2list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2list_Dims,xr2list_Rank, capi_xr2list_intent,xr2list_capi,capi_errmess); + if (capi_xr2list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2list = (int *)(PyArray_DATA(capi_xr2list_as_array)); + + /* Processing variable sclat */ + sclat_Dims[0]=3; + capi_sclat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 6th argument `sclat`"; + capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); + if (capi_sclat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); + + /* Processing variable pbc */ + pbc = (int)PyObject_IsTrue(pbc_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable verbose */ + verbose = (int)PyObject_IsTrue(verbose_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable totnum_r2 */ + if (totnum_r2_capi == Py_None) totnum_r2 = shape(xr2list, 1); else + f2py_success = int_from_pyobj(&totnum_r2,totnum_r2_capi,"thirdorder.third_order_asr.impose_asr() 1st keyword (totnum_r2) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2list, 1) == totnum_r2,"shape(xr2list, 1) == totnum_r2","1st keyword totnum_r2","impose_asr:totnum_r2=%d",totnum_r2) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_asr.impose_asr() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","2nd keyword nat","impose_asr:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.impose_asr() 3rd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","3rd keyword n_blocks","impose_asr:n_blocks=%d",n_blocks) { + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=n_blocks; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 3rd argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + /* Processing variable fc_out */ + fc_out_Dims[0]=3 * nat,fc_out_Dims[1]=3 * nat,fc_out_Dims[2]=3 * nat,fc_out_Dims[3]=n_blocks; + capi_fc_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the hidden `fc_out`"; + capi_fc_out_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_out_Dims,fc_out_Rank, capi_fc_out_intent,Py_None,capi_errmess); + if (capi_fc_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_out = (double *)(PyArray_DATA(capi_fc_out_as_array)); + + /* Processing variable r23 */ + r23_Dims[0]=6,r23_Dims[1]=n_blocks; + capi_r23_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 2nd argument `r23`"; + capi_r23_as_array = ndarray_from_pyobj( NPY_INT,1,r23_Dims,r23_Rank, capi_r23_intent,r23_capi,capi_errmess); + if (capi_r23_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r23 = (int *)(PyArray_DATA(capi_r23_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r23,xr2,xr2list,&pow,sclat,&pbc,&threshold,&maxite,fc_out,&verbose,&totnum_r2,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_out_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r23_as_array!=r23_capi) { + Py_XDECREF(capi_r23_as_array); } + } /* if (capi_r23_as_array == NULL) ... else of r23 */ + /* End of cleaning variable r23 */ + } /* if (capi_fc_out_as_array == NULL) ... else of fc_out */ + /* End of cleaning variable fc_out */ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(xr2list, 1) == totnum_r2)*/ + } /*if (f2py_success) of totnum_r2*/ + /* End of cleaning variable totnum_r2 */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of pbc*/ + /* End of cleaning variable pbc */ + if((PyObject *)capi_sclat_as_array!=sclat_capi) { + Py_XDECREF(capi_sclat_as_array); } + } /* if (capi_sclat_as_array == NULL) ... else of sclat */ + /* End of cleaning variable sclat */ + if((PyObject *)capi_xr2list_as_array!=xr2list_capi) { + Py_XDECREF(capi_xr2list_as_array); } + } /* if (capi_xr2list_as_array == NULL) ... else of xr2list */ + /* End of cleaning variable xr2list */ + } /*if (f2py_success) of maxite*/ + /* End of cleaning variable maxite */ + } /*if (f2py_success) of threshold*/ + /* End of cleaning variable threshold */ + } /*if (f2py_success) of pow*/ + /* End of cleaning variable pow */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of impose_asr *****************************/ + +/********************************** analysis **********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_analysis[] = "\ +weight,xr2,xr3 = analysis(far,tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,[nat,n_blocks])\n\nWrapper for ``analysis``.\ +\n\nParameters\n----------\n" +"far : input int\n" +"tol : input float\n" +"dmax : input rank-1 array('d') with bounds (nat)\n" +"sc_size : input rank-1 array('i') with bounds (3)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"tau : input rank-2 array('d') with bounds (nat,3)\n" +"tensor : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(dmax, 0)\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"\nReturns\n-------\n" +"weight : rank-4 array('i') with bounds (nat,nat,nat,n_blocks)\n" +"xr2 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)\n" +"xr3 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_centering_analysis(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,int*,int*,int*,double*,double*,double*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int far = 0; + PyObject *far_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + double *dmax = NULL; + npy_intp dmax_Dims[1] = {-1}; + const int dmax_Rank = 1; + PyArrayObject *capi_dmax_as_array = NULL; + int capi_dmax_intent = 0; + PyObject *dmax_capi = Py_None; + int *sc_size = NULL; + npy_intp sc_size_Dims[1] = {-1}; + const int sc_size_Rank = 1; + PyArrayObject *capi_sc_size_as_array = NULL; + int capi_sc_size_intent = 0; + PyObject *sc_size_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr3_list = NULL; + npy_intp xr3_list_Dims[2] = {-1, -1}; + const int xr3_list_Rank = 2; + PyArrayObject *capi_xr3_list_as_array = NULL; + int capi_xr3_list_intent = 0; + PyObject *xr3_list_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[4] = {-1, -1, -1, -1}; + const int weight_Rank = 4; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + int *xr2 = NULL; + npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr2_Rank = 6; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + int *xr3 = NULL; + npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr3_Rank = 6; + PyArrayObject *capi_xr3_as_array = NULL; + int capi_xr3_intent = 0; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"far","tol","dmax","sc_size","xr2_list","xr3_list","alat","tau","tensor","nat","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOOO|OO:thirdorder.third_order_centering.analysis",\ + capi_kwlist,&far_capi,&tol_capi,&dmax_capi,&sc_size_capi,&xr2_list_capi,&xr3_list_capi,&alat_capi,&tau_capi,&tensor_capi,&nat_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.analysis() 1st argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable dmax */ + ; + capi_dmax_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 3rd argument `dmax`"; + capi_dmax_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dmax_Dims,dmax_Rank, capi_dmax_intent,dmax_capi,capi_errmess); + if (capi_dmax_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dmax = (double *)(PyArray_DATA(capi_dmax_as_array)); + + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 7th argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 5th argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"thirdorder.third_order_centering.analysis() 2nd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable sc_size */ + sc_size_Dims[0]=3; + capi_sc_size_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 4th argument `sc_size`"; + capi_sc_size_as_array = ndarray_from_pyobj( NPY_INT,1,sc_size_Dims,sc_size_Rank, capi_sc_size_intent,sc_size_capi,capi_errmess); + if (capi_sc_size_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sc_size = (int *)(PyArray_DATA(capi_sc_size_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(dmax, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.analysis() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(dmax, 0) == nat,"shape(dmax, 0) == nat","1st keyword nat","analysis:nat=%d",nat) { + /* Processing variable tau */ + tau_Dims[0]=nat,tau_Dims[1]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 8th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_centering.analysis() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","analysis:n_blocks=%d",n_blocks) { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks; + capi_weight_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the hidden `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,Py_None,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks; + capi_xr2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the hidden `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,Py_None,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + /* Processing variable xr3 */ + xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks; + capi_xr3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the hidden `xr3`"; + capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,Py_None,capi_errmess); + if (capi_xr3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); + + /* Processing variable xr3_list */ + xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; + capi_xr3_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 6th argument `xr3_list`"; + capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); + if (capi_xr3_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); + + /* Processing variable tensor */ + tensor_Dims[0]=3 * nat,tensor_Dims[1]=3 * nat,tensor_Dims[2]=3 * nat,tensor_Dims[3]=n_blocks; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 9th argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&far,&tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,weight,xr2,xr3,&nat,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNN",capi_weight_as_array,capi_xr2_as_array,capi_xr3_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ + if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { + Py_XDECREF(capi_xr3_list_as_array); } + } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ + /* End of cleaning variable xr3_list */ + } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ + /* End of cleaning variable xr3 */ + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + } /*CHECKSCALAR(shape(dmax, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_sc_size_as_array!=sc_size_capi) { + Py_XDECREF(capi_sc_size_as_array); } + } /* if (capi_sc_size_as_array == NULL) ... else of sc_size */ + /* End of cleaning variable sc_size */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + if((PyObject *)capi_dmax_as_array!=dmax_capi) { + Py_XDECREF(capi_dmax_as_array); } + } /* if (capi_dmax_as_array == NULL) ... else of dmax */ + /* End of cleaning variable dmax */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of analysis ******************************/ + +/*********************************** center ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_center[] = "\ +centered = center(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_blocks,n_blocks_old])\n\nWrapper for ``center``.\ +\n\nParameters\n----------\n" +"original : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks_old)\n" +"weight : input rank-4 array('i') with bounds (nat,nat,nat,n_blocks_old)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" +"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr3 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" +"far : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(original, 0) / 3\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"n_blocks_old : input int, optional\n Default: shape(original, 3)\n" +"\nReturns\n-------\n" +"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_centering_center(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,int*,int*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *original = NULL; + npy_intp original_Dims[4] = {-1, -1, -1, -1}; + const int original_Rank = 4; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[4] = {-1, -1, -1, -1}; + const int weight_Rank = 4; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + PyObject *weight_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr2_Rank = 6; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr3_list = NULL; + npy_intp xr3_list_Dims[2] = {-1, -1}; + const int xr3_list_Rank = 2; + PyArrayObject *capi_xr3_list_as_array = NULL; + int capi_xr3_list_intent = 0; + PyObject *xr3_list_capi = Py_None; + int *xr3 = NULL; + npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; + const int xr3_Rank = 6; + PyArrayObject *capi_xr3_as_array = NULL; + int capi_xr3_intent = 0; + PyObject *xr3_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[4] = {-1, -1, -1, -1}; + const int centered_Rank = 4; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int far = 0; + PyObject *far_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int n_blocks_old = 0; + PyObject *n_blocks_old_capi = Py_None; + static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_blocks","n_blocks_old",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OOO:thirdorder.third_order_centering.center",\ + capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_blocks_capi,&n_blocks_old_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.center() 7th argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 3rd argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable original */ + ; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 1st argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(original, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.center() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_centering.center() 2nd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","center:n_blocks=%d",n_blocks) { + /* Processing variable xr3_list */ + xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; + capi_xr3_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 5th argument `xr3_list`"; + capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); + if (capi_xr3_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); + + /* Processing variable n_blocks_old */ + if (n_blocks_old_capi == Py_None) n_blocks_old = shape(original, 3); else + f2py_success = int_from_pyobj(&n_blocks_old,n_blocks_old_capi,"thirdorder.third_order_centering.center() 3rd keyword (n_blocks_old) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 3) == n_blocks_old,"shape(original, 3) == n_blocks_old","3rd keyword n_blocks_old","center:n_blocks_old=%d",n_blocks_old) { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks_old; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 4th argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","4th argument xr2") { + /* Processing variable xr3 */ + xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks_old; + capi_xr3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 6th argument `xr3`"; + capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); + if (capi_xr3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); + + CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","6th argument xr3") { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks_old; + capi_weight_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 2nd argument `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,&nat,centered,&far,&n_blocks,&n_blocks_old); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_centered_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_weight_as_array!=weight_capi) { + Py_XDECREF(capi_weight_as_array); } + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ + if((PyObject *)capi_xr3_as_array!=xr3_capi) { + Py_XDECREF(capi_xr3_as_array); } + } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ + /* End of cleaning variable xr3 */ + } /*CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKSCALAR(shape(original, 3) == n_blocks_old)*/ + } /*if (f2py_success) of n_blocks_old*/ + /* End of cleaning variable n_blocks_old */ + if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { + Py_XDECREF(capi_xr3_list_as_array); } + } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ + /* End of cleaning variable xr3_list */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of center *******************************/ + +/******************************* center_sparse *******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_center_sparse[] = "\ +centered,n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list = center_sparse(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_sup,n_blocks])\n\nWrapper for ``center_sparse``.\ +\n\nParameters\n----------\n" +"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup,n_sup)\n" +"weight : input rank-5 array('i') with bounds (nat,nat,n_sup,nat,n_sup)\n" +"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr2 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" +"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" +"xr3 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" +"far : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(original, 0) / 3\n" +"n_sup : input int, optional\n Default: shape(original, 3)\n" +"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" +"\nReturns\n-------\n" +"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"n_sparse_blocks : int\n" +"xr2_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" +"xr3_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" +"atom_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" +"r_blocks_sparse_list : rank-1 array('i') with bounds (n_blocks * nat * nat * nat)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_centering_center_sparse(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,int*,int*,int*,double*,int*,int*,int*,int*,int*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *original = NULL; + npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; + const int original_Rank = 5; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + int *weight = NULL; + npy_intp weight_Dims[5] = {-1, -1, -1, -1, -1}; + const int weight_Rank = 5; + PyArrayObject *capi_weight_as_array = NULL; + int capi_weight_intent = 0; + PyObject *weight_capi = Py_None; + int *xr2_list = NULL; + npy_intp xr2_list_Dims[2] = {-1, -1}; + const int xr2_list_Rank = 2; + PyArrayObject *capi_xr2_list_as_array = NULL; + int capi_xr2_list_intent = 0; + PyObject *xr2_list_capi = Py_None; + int *xr2 = NULL; + npy_intp xr2_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int xr2_Rank = 7; + PyArrayObject *capi_xr2_as_array = NULL; + int capi_xr2_intent = 0; + PyObject *xr2_capi = Py_None; + int *xr3_list = NULL; + npy_intp xr3_list_Dims[2] = {-1, -1}; + const int xr3_list_Rank = 2; + PyArrayObject *capi_xr3_list_as_array = NULL; + int capi_xr3_list_intent = 0; + PyObject *xr3_list_capi = Py_None; + int *xr3 = NULL; + npy_intp xr3_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; + const int xr3_Rank = 7; + PyArrayObject *capi_xr3_as_array = NULL; + int capi_xr3_intent = 0; + PyObject *xr3_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[4] = {-1, -1, -1, -1}; + const int centered_Rank = 4; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int n_sparse_blocks = 0; + int *xr2_sparse_list = NULL; + npy_intp xr2_sparse_list_Dims[2] = {-1, -1}; + const int xr2_sparse_list_Rank = 2; + PyArrayObject *capi_xr2_sparse_list_as_array = NULL; + int capi_xr2_sparse_list_intent = 0; + int *xr3_sparse_list = NULL; + npy_intp xr3_sparse_list_Dims[2] = {-1, -1}; + const int xr3_sparse_list_Rank = 2; + PyArrayObject *capi_xr3_sparse_list_as_array = NULL; + int capi_xr3_sparse_list_intent = 0; + int *atom_sparse_list = NULL; + npy_intp atom_sparse_list_Dims[2] = {-1, -1}; + const int atom_sparse_list_Rank = 2; + PyArrayObject *capi_atom_sparse_list_as_array = NULL; + int capi_atom_sparse_list_intent = 0; + int *r_blocks_sparse_list = NULL; + npy_intp r_blocks_sparse_list_Dims[1] = {-1}; + const int r_blocks_sparse_list_Rank = 1; + PyArrayObject *capi_r_blocks_sparse_list_as_array = NULL; + int capi_r_blocks_sparse_list_intent = 0; + int far = 0; + PyObject *far_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_sup = 0; + PyObject *n_sup_capi = Py_None; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_sup","n_blocks",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OOO:thirdorder.third_order_centering.center_sparse",\ + capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_sup_capi,&n_blocks_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.center_sparse() 7th argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable xr2_list */ + xr2_list_Dims[0]=3; + capi_xr2_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 3rd argument `xr2_list`"; + capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); + if (capi_xr2_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); + + /* Processing variable original */ + ; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 1st argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + /* Processing variable n_sparse_blocks */ + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(original, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.center_sparse() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center_sparse:nat=%d",nat) { + /* Processing variable n_sup */ + if (n_sup_capi == Py_None) n_sup = shape(original, 3); else + f2py_success = int_from_pyobj(&n_sup,n_sup_capi,"thirdorder.third_order_centering.center_sparse() 2nd keyword (n_sup) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(original, 3) == n_sup,"shape(original, 3) == n_sup","2nd keyword n_sup","center_sparse:n_sup=%d",n_sup) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_centering.center_sparse() 3rd keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","3rd keyword n_blocks","center_sparse:n_blocks=%d",n_blocks) { + /* Processing variable xr3_list */ + xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; + capi_xr3_list_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 5th argument `xr3_list`"; + capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); + if (capi_xr3_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); + + /* Processing variable xr2 */ + xr2_Dims[0]=3,xr2_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_sup,xr2_Dims[5]=nat,xr2_Dims[6]=n_sup; + capi_xr2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 4th argument `xr2`"; + capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); + if (capi_xr2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); + + CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","4th argument xr2") { + /* Processing variable xr3 */ + xr3_Dims[0]=3,xr3_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=n_sup,xr3_Dims[5]=nat,xr3_Dims[6]=n_sup; + capi_xr3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 6th argument `xr3`"; + capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); + if (capi_xr3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); + + CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","6th argument xr3") { + /* Processing variable weight */ + weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_sup,weight_Dims[3]=nat,weight_Dims[4]=n_sup; + capi_weight_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 2nd argument `weight`"; + capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); + if (capi_weight_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + weight = (int *)(PyArray_DATA(capi_weight_as_array)); + + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable xr2_sparse_list */ + xr2_sparse_list_Dims[0]=3,xr2_sparse_list_Dims[1]=n_blocks * nat * nat * nat; + capi_xr2_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `xr2_sparse_list`"; + capi_xr2_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_sparse_list_Dims,xr2_sparse_list_Rank, capi_xr2_sparse_list_intent,Py_None,capi_errmess); + if (capi_xr2_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr2_sparse_list = (int *)(PyArray_DATA(capi_xr2_sparse_list_as_array)); + + /* Processing variable xr3_sparse_list */ + xr3_sparse_list_Dims[0]=3,xr3_sparse_list_Dims[1]=n_blocks * nat * nat * nat; + capi_xr3_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `xr3_sparse_list`"; + capi_xr3_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_sparse_list_Dims,xr3_sparse_list_Rank, capi_xr3_sparse_list_intent,Py_None,capi_errmess); + if (capi_xr3_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xr3_sparse_list = (int *)(PyArray_DATA(capi_xr3_sparse_list_as_array)); + + /* Processing variable atom_sparse_list */ + atom_sparse_list_Dims[0]=3,atom_sparse_list_Dims[1]=n_blocks * nat * nat * nat; + capi_atom_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `atom_sparse_list`"; + capi_atom_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,atom_sparse_list_Dims,atom_sparse_list_Rank, capi_atom_sparse_list_intent,Py_None,capi_errmess); + if (capi_atom_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + atom_sparse_list = (int *)(PyArray_DATA(capi_atom_sparse_list_as_array)); + + /* Processing variable r_blocks_sparse_list */ + r_blocks_sparse_list_Dims[0]=n_blocks * nat * nat * nat; + capi_r_blocks_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `r_blocks_sparse_list`"; + capi_r_blocks_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,r_blocks_sparse_list_Dims,r_blocks_sparse_list_Rank, capi_r_blocks_sparse_list_intent,Py_None,capi_errmess); + if (capi_r_blocks_sparse_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_blocks_sparse_list = (int *)(PyArray_DATA(capi_r_blocks_sparse_list_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,centered,&n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list,&far,&nat,&n_sup,&n_blocks); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NiNNNN",capi_centered_as_array,n_sparse_blocks,capi_xr2_sparse_list_as_array,capi_xr3_sparse_list_as_array,capi_atom_sparse_list_as_array,capi_r_blocks_sparse_list_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_r_blocks_sparse_list_as_array == NULL) ... else of r_blocks_sparse_list */ + /* End of cleaning variable r_blocks_sparse_list */ + } /* if (capi_atom_sparse_list_as_array == NULL) ... else of atom_sparse_list */ + /* End of cleaning variable atom_sparse_list */ + } /* if (capi_xr3_sparse_list_as_array == NULL) ... else of xr3_sparse_list */ + /* End of cleaning variable xr3_sparse_list */ + } /* if (capi_xr2_sparse_list_as_array == NULL) ... else of xr2_sparse_list */ + /* End of cleaning variable xr2_sparse_list */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + if((PyObject *)capi_weight_as_array!=weight_capi) { + Py_XDECREF(capi_weight_as_array); } + } /* if (capi_weight_as_array == NULL) ... else of weight */ + /* End of cleaning variable weight */ + } /*CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ + if((PyObject *)capi_xr3_as_array!=xr3_capi) { + Py_XDECREF(capi_xr3_as_array); } + } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ + /* End of cleaning variable xr3 */ + } /*CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ + if((PyObject *)capi_xr2_as_array!=xr2_capi) { + Py_XDECREF(capi_xr2_as_array); } + } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ + /* End of cleaning variable xr2 */ + if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { + Py_XDECREF(capi_xr3_list_as_array); } + } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ + /* End of cleaning variable xr3_list */ + } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(original, 3) == n_sup)*/ + } /*if (f2py_success) of n_sup*/ + /* End of cleaning variable n_sup */ + } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + /* End of cleaning variable n_sparse_blocks */ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { + Py_XDECREF(capi_xr2_list_as_array); } + } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ + /* End of cleaning variable xr2_list */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of center_sparse ****************************/ + +/********************************* pre_center *********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_pre_center[] = "\ +centered,lat_min,lat_max = pre_center(far,nq1,nq2,nq3,tol,alat,tau,original,[nat])\n\nWrapper for ``pre_center``.\ +\n\nParameters\n----------\n" +"far : input int\n" +"nq1 : input int\n" +"nq2 : input int\n" +"nq3 : input int\n" +"tol : input float\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"tau : input rank-2 array('d') with bounds (nat,3)\n" +"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,nq1 * nq2 * nq3,nq1 * nq2 * nq3)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(tau, 0)\n" +"\nReturns\n-------\n" +"centered : rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3)\n" +"lat_min : rank-1 array('i') with bounds (3)\n" +"lat_max : rank-1 array('i') with bounds (3)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_centering_pre_center(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*,int*,double*,double*,double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int far = 0; + PyObject *far_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int nq1 = 0; + PyObject *nq1_capi = Py_None; + int nq2 = 0; + PyObject *nq2_capi = Py_None; + int nq3 = 0; + PyObject *nq3_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + double *tau = NULL; + npy_intp tau_Dims[2] = {-1, -1}; + const int tau_Rank = 2; + PyArrayObject *capi_tau_as_array = NULL; + int capi_tau_intent = 0; + PyObject *tau_capi = Py_None; + double *original = NULL; + npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; + const int original_Rank = 5; + PyArrayObject *capi_original_as_array = NULL; + int capi_original_intent = 0; + PyObject *original_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[5] = {-1, -1, -1, -1, -1}; + const int centered_Rank = 5; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int *lat_min = NULL; + npy_intp lat_min_Dims[1] = {-1}; + const int lat_min_Rank = 1; + PyArrayObject *capi_lat_min_as_array = NULL; + int capi_lat_min_intent = 0; + int *lat_max = NULL; + npy_intp lat_max_Dims[1] = {-1}; + const int lat_max_Rank = 1; + PyArrayObject *capi_lat_max_as_array = NULL; + int capi_lat_max_intent = 0; + static char *capi_kwlist[] = {"far","nq1","nq2","nq3","tol","alat","tau","original","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|O:thirdorder.third_order_centering.pre_center",\ + capi_kwlist,&far_capi,&nq1_capi,&nq2_capi,&nq3_capi,&tol_capi,&alat_capi,&tau_capi,&original_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable nq1 */ + f2py_success = int_from_pyobj(&nq1,nq1_capi,"thirdorder.third_order_centering.pre_center() 2nd argument (nq1) can't be converted to int"); + if (f2py_success) { + /* Processing variable nq2 */ + f2py_success = int_from_pyobj(&nq2,nq2_capi,"thirdorder.third_order_centering.pre_center() 3rd argument (nq2) can't be converted to int"); + if (f2py_success) { + /* Processing variable nq3 */ + f2py_success = int_from_pyobj(&nq3,nq3_capi,"thirdorder.third_order_centering.pre_center() 4th argument (nq3) can't be converted to int"); + if (f2py_success) { + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the 6th argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable tau */ + tau_Dims[1]=3; + capi_tau_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the 7th argument `tau`"; + capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); + if (capi_tau_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tau = (double *)(PyArray_DATA(capi_tau_as_array)); + + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.pre_center() 1st argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"thirdorder.third_order_centering.pre_center() 5th argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable lat_min */ + lat_min_Dims[0]=3; + capi_lat_min_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the hidden `lat_min`"; + capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,Py_None,capi_errmess); + if (capi_lat_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); + + /* Processing variable lat_max */ + lat_max_Dims[0]=3; + capi_lat_max_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the hidden `lat_max`"; + capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,Py_None,capi_errmess); + if (capi_lat_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(tau, 0); else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.pre_center() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tau, 0) == nat,"shape(tau, 0) == nat","1st keyword nat","pre_center:nat=%d",nat) { + /* Processing variable original */ + original_Dims[0]=3 * nat,original_Dims[1]=3 * nat,original_Dims[2]=3 * nat,original_Dims[3]=nq1 * nq2 * nq3,original_Dims[4]=nq1 * nq2 * nq3; + capi_original_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the 8th argument `original`"; + capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); + if (capi_original_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + original = (double *)(PyArray_DATA(capi_original_as_array)); + + CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { + CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { + CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,centered_Dims[4]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&far,&nat,&nq1,&nq2,&nq3,&tol,alat,tau,original,centered,lat_min,lat_max); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNN",capi_centered_as_array,capi_lat_min_as_array,capi_lat_max_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ + } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ + } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ + if((PyObject *)capi_original_as_array!=original_capi) { + Py_XDECREF(capi_original_as_array); } + } /* if (capi_original_as_array == NULL) ... else of original */ + /* End of cleaning variable original */ + } /*CHECKSCALAR(shape(tau, 0) == nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ + /* End of cleaning variable lat_max */ + } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ + /* End of cleaning variable lat_min */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ + if((PyObject *)capi_tau_as_array!=tau_capi) { + Py_XDECREF(capi_tau_as_array); } + } /* if (capi_tau_as_array == NULL) ... else of tau */ + /* End of cleaning variable tau */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + } /*if (f2py_success) of nq3*/ + /* End of cleaning variable nq3 */ + } /*if (f2py_success) of nq2*/ + /* End of cleaning variable nq2 */ + } /*if (f2py_success) of nq1*/ + /* End of cleaning variable nq1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of pre_center *****************************/ + +/*********************************** assign ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_assign[] = "\ +centered,x2,x3,r2,r3 = assign(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,n_sup_ws,[nat,n_sup_ws_prev])\n\nWrapper for ``assign``.\ +\n\nParameters\n----------\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"lat_min_prev : input rank-1 array('i') with bounds (3)\n" +"lat_max_prev : input rank-1 array('i') with bounds (3)\n" +"centered_prev : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws_prev,n_sup_ws_prev)\n" +"lat_min : input rank-1 array('i') with bounds (3)\n" +"lat_max : input rank-1 array('i') with bounds (3)\n" +"n_sup_ws : input int\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(centered_prev, 0) / 3\n" +"n_sup_ws_prev : input int, optional\n Default: shape(centered_prev, 3)\n" +"\nReturns\n-------\n" +"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws * n_sup_ws)\n" +"x2 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" +"x3 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" +"r2 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)\n" +"r3 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_centering_assign(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,int*,double*,int*,int*,int*,int*,int*,double*,int*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + int *lat_min_prev = NULL; + npy_intp lat_min_prev_Dims[1] = {-1}; + const int lat_min_prev_Rank = 1; + PyArrayObject *capi_lat_min_prev_as_array = NULL; + int capi_lat_min_prev_intent = 0; + PyObject *lat_min_prev_capi = Py_None; + int *lat_max_prev = NULL; + npy_intp lat_max_prev_Dims[1] = {-1}; + const int lat_max_prev_Rank = 1; + PyArrayObject *capi_lat_max_prev_as_array = NULL; + int capi_lat_max_prev_intent = 0; + PyObject *lat_max_prev_capi = Py_None; + double *centered_prev = NULL; + npy_intp centered_prev_Dims[5] = {-1, -1, -1, -1, -1}; + const int centered_prev_Rank = 5; + PyArrayObject *capi_centered_prev_as_array = NULL; + int capi_centered_prev_intent = 0; + PyObject *centered_prev_capi = Py_None; + int *lat_min = NULL; + npy_intp lat_min_Dims[1] = {-1}; + const int lat_min_Rank = 1; + PyArrayObject *capi_lat_min_as_array = NULL; + int capi_lat_min_intent = 0; + PyObject *lat_min_capi = Py_None; + int *lat_max = NULL; + npy_intp lat_max_Dims[1] = {-1}; + const int lat_max_Rank = 1; + PyArrayObject *capi_lat_max_as_array = NULL; + int capi_lat_max_intent = 0; + PyObject *lat_max_capi = Py_None; + int n_sup_ws = 0; + PyObject *n_sup_ws_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int n_sup_ws_prev = 0; + PyObject *n_sup_ws_prev_capi = Py_None; + double *centered = NULL; + npy_intp centered_Dims[4] = {-1, -1, -1, -1}; + const int centered_Rank = 4; + PyArrayObject *capi_centered_as_array = NULL; + int capi_centered_intent = 0; + int *x2 = NULL; + npy_intp x2_Dims[2] = {-1, -1}; + const int x2_Rank = 2; + PyArrayObject *capi_x2_as_array = NULL; + int capi_x2_intent = 0; + int *x3 = NULL; + npy_intp x3_Dims[2] = {-1, -1}; + const int x3_Rank = 2; + PyArrayObject *capi_x3_as_array = NULL; + int capi_x3_intent = 0; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + static char *capi_kwlist[] = {"alat","lat_min_prev","lat_max_prev","centered_prev","lat_min","lat_max","n_sup_ws","nat","n_sup_ws_prev",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OO:thirdorder.third_order_centering.assign",\ + capi_kwlist,&alat_capi,&lat_min_prev_capi,&lat_max_prev_capi,¢ered_prev_capi,&lat_min_capi,&lat_max_capi,&n_sup_ws_capi,&nat_capi,&n_sup_ws_prev_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable n_sup_ws */ + f2py_success = int_from_pyobj(&n_sup_ws,n_sup_ws_capi,"thirdorder.third_order_centering.assign() 7th argument (n_sup_ws) can't be converted to int"); + if (f2py_success) { + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 1st argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable lat_min_prev */ + lat_min_prev_Dims[0]=3; + capi_lat_min_prev_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 2nd argument `lat_min_prev`"; + capi_lat_min_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_prev_Dims,lat_min_prev_Rank, capi_lat_min_prev_intent,lat_min_prev_capi,capi_errmess); + if (capi_lat_min_prev_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_min_prev = (int *)(PyArray_DATA(capi_lat_min_prev_as_array)); + + /* Processing variable lat_max_prev */ + lat_max_prev_Dims[0]=3; + capi_lat_max_prev_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 3rd argument `lat_max_prev`"; + capi_lat_max_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_prev_Dims,lat_max_prev_Rank, capi_lat_max_prev_intent,lat_max_prev_capi,capi_errmess); + if (capi_lat_max_prev_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_max_prev = (int *)(PyArray_DATA(capi_lat_max_prev_as_array)); + + /* Processing variable lat_min */ + lat_min_Dims[0]=3; + capi_lat_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 5th argument `lat_min`"; + capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,lat_min_capi,capi_errmess); + if (capi_lat_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); + + /* Processing variable lat_max */ + lat_max_Dims[0]=3; + capi_lat_max_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 6th argument `lat_max`"; + capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,lat_max_capi,capi_errmess); + if (capi_lat_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); + + /* Processing variable centered_prev */ + ; + capi_centered_prev_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 4th argument `centered_prev`"; + capi_centered_prev_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_prev_Dims,centered_prev_Rank, capi_centered_prev_intent,centered_prev_capi,capi_errmess); + if (capi_centered_prev_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered_prev = (double *)(PyArray_DATA(capi_centered_prev_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(centered_prev, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.assign() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(centered_prev, 0) == 3 * nat,"shape(centered_prev, 0) == 3 * nat","1st keyword nat","assign:nat=%d",nat) { + /* Processing variable n_sup_ws_prev */ + if (n_sup_ws_prev_capi == Py_None) n_sup_ws_prev = shape(centered_prev, 3); else + f2py_success = int_from_pyobj(&n_sup_ws_prev,n_sup_ws_prev_capi,"thirdorder.third_order_centering.assign() 2nd keyword (n_sup_ws_prev) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev,"shape(centered_prev, 3) == n_sup_ws_prev","2nd keyword n_sup_ws_prev","assign:n_sup_ws_prev=%d",n_sup_ws_prev) { + /* Processing variable centered */ + centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_sup_ws * n_sup_ws; + capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `centered`"; + capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); + if (capi_centered_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + centered = (double *)(PyArray_DATA(capi_centered_as_array)); + + /* Processing variable x2 */ + x2_Dims[0]=3,x2_Dims[1]=n_sup_ws * n_sup_ws; + capi_x2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `x2`"; + capi_x2_as_array = ndarray_from_pyobj( NPY_INT,1,x2_Dims,x2_Rank, capi_x2_intent,Py_None,capi_errmess); + if (capi_x2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x2 = (int *)(PyArray_DATA(capi_x2_as_array)); + + /* Processing variable x3 */ + x3_Dims[0]=3,x3_Dims[1]=n_sup_ws * n_sup_ws; + capi_x3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `x3`"; + capi_x3_as_array = ndarray_from_pyobj( NPY_INT,1,x3_Dims,x3_Rank, capi_x3_intent,Py_None,capi_errmess); + if (capi_x3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x3 = (int *)(PyArray_DATA(capi_x3_as_array)); + + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_sup_ws * n_sup_ws; + capi_r2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,Py_None,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_sup_ws * n_sup_ws; + capi_r3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,Py_None,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,&n_sup_ws,&nat,&n_sup_ws_prev,centered,x2,x3,r2,r3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNNNN",capi_centered_as_array,capi_x2_as_array,capi_x3_as_array,capi_r2_as_array,capi_r3_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /* if (capi_x3_as_array == NULL) ... else of x3 */ + /* End of cleaning variable x3 */ + } /* if (capi_x2_as_array == NULL) ... else of x2 */ + /* End of cleaning variable x2 */ + } /* if (capi_centered_as_array == NULL) ... else of centered */ + /* End of cleaning variable centered */ + } /*CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev)*/ + } /*if (f2py_success) of n_sup_ws_prev*/ + /* End of cleaning variable n_sup_ws_prev */ + } /*CHECKSCALAR(shape(centered_prev, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_centered_prev_as_array!=centered_prev_capi) { + Py_XDECREF(capi_centered_prev_as_array); } + } /* if (capi_centered_prev_as_array == NULL) ... else of centered_prev */ + /* End of cleaning variable centered_prev */ + if((PyObject *)capi_lat_max_as_array!=lat_max_capi) { + Py_XDECREF(capi_lat_max_as_array); } + } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ + /* End of cleaning variable lat_max */ + if((PyObject *)capi_lat_min_as_array!=lat_min_capi) { + Py_XDECREF(capi_lat_min_as_array); } + } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ + /* End of cleaning variable lat_min */ + if((PyObject *)capi_lat_max_prev_as_array!=lat_max_prev_capi) { + Py_XDECREF(capi_lat_max_prev_as_array); } + } /* if (capi_lat_max_prev_as_array == NULL) ... else of lat_max_prev */ + /* End of cleaning variable lat_max_prev */ + if((PyObject *)capi_lat_min_prev_as_array!=lat_min_prev_capi) { + Py_XDECREF(capi_lat_min_prev_as_array); } + } /* if (capi_lat_min_prev_as_array == NULL) ... else of lat_min_prev */ + /* End of cleaning variable lat_min_prev */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + } /*if (f2py_success) of n_sup_ws*/ + /* End of cleaning variable n_sup_ws */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of assign *******************************/ + +/******************************** within_dmax ********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_within_dmax[] = "\ +within_dmax = within_dmax(v1,v2,v3,d1,d2,d3,tol)\n\nWrapper for ``within_dmax``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"v3 : input rank-1 array('d') with bounds (3)\n" +"d1 : input float\n" +"d2 : input float\n" +"d3 : input float\n" +"tol : input float\n" +"\nReturns\n-------\n" +"within_dmax : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_within_dmax(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int within_dmaxf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + double *v3 = NULL; + npy_intp v3_Dims[1] = {-1}; + const int v3_Rank = 1; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + double d1 = 0; + PyObject *d1_capi = Py_None; + double d2 = 0; + PyObject *d2_capi = Py_None; + double d3 = 0; + PyObject *d3_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2","v3","d1","d2","d3","tol",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|:thirdorder.third_order_centering.within_dmax",\ + capi_kwlist,&v1_capi,&v2_capi,&v3_capi,&d1_capi,&d2_capi,&d3_capi,&tol_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.within_dmax: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.within_dmax: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable v3 */ + v3_Dims[0]=3; + capi_v3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.within_dmax: failed to create array from the 3rd argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable d1 */ + f2py_success = double_from_pyobj(&d1,d1_capi,"thirdorder.third_order_centering.within_dmax() 4th argument (d1) can't be converted to double"); + if (f2py_success) { + /* Processing variable d2 */ + f2py_success = double_from_pyobj(&d2,d2_capi,"thirdorder.third_order_centering.within_dmax() 5th argument (d2) can't be converted to double"); + if (f2py_success) { + /* Processing variable d3 */ + f2py_success = double_from_pyobj(&d3,d3_capi,"thirdorder.third_order_centering.within_dmax() 6th argument (d3) can't be converted to double"); + if (f2py_success) { + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"thirdorder.third_order_centering.within_dmax() 7th argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable within_dmaxf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&within_dmaxf2pywrap,v1,v2,v3,&d1,&d2,&d3,&tol); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",within_dmaxf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable within_dmaxf2pywrap */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + } /*if (f2py_success) of d3*/ + /* End of cleaning variable d3 */ + } /*if (f2py_success) of d2*/ + /* End of cleaning variable d2 */ + } /*if (f2py_success) of d1*/ + /* End of cleaning variable d1 */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of within_dmax *****************************/ + +/***************************** compute_perimeter *****************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_compute_perimeter[] = "\ +compute_perimeter = compute_perimeter(v1,v2,v3)\n\nWrapper for ``compute_perimeter``.\ +\n\nParameters\n----------\n" +"v1 : input rank-1 array('d') with bounds (3)\n" +"v2 : input rank-1 array('d') with bounds (3)\n" +"v3 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"compute_perimeter : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_compute_perimeter(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double compute_perimeterf2pywrap = 0; + double *v1 = NULL; + npy_intp v1_Dims[1] = {-1}; + const int v1_Rank = 1; + PyArrayObject *capi_v1_as_array = NULL; + int capi_v1_intent = 0; + PyObject *v1_capi = Py_None; + double *v2 = NULL; + npy_intp v2_Dims[1] = {-1}; + const int v2_Rank = 1; + PyArrayObject *capi_v2_as_array = NULL; + int capi_v2_intent = 0; + PyObject *v2_capi = Py_None; + double *v3 = NULL; + npy_intp v3_Dims[1] = {-1}; + const int v3_Rank = 1; + PyArrayObject *capi_v3_as_array = NULL; + int capi_v3_intent = 0; + PyObject *v3_capi = Py_None; + static char *capi_kwlist[] = {"v1","v2","v3",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.compute_perimeter",\ + capi_kwlist,&v1_capi,&v2_capi,&v3_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v1 */ + v1_Dims[0]=3; + capi_v1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.compute_perimeter: failed to create array from the 1st argument `v1`"; + capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); + if (capi_v1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v1 = (double *)(PyArray_DATA(capi_v1_as_array)); + + /* Processing variable v2 */ + v2_Dims[0]=3; + capi_v2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.compute_perimeter: failed to create array from the 2nd argument `v2`"; + capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); + if (capi_v2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v2 = (double *)(PyArray_DATA(capi_v2_as_array)); + + /* Processing variable v3 */ + v3_Dims[0]=3; + capi_v3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.compute_perimeter: failed to create array from the 3rd argument `v3`"; + capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); + if (capi_v3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v3 = (double *)(PyArray_DATA(capi_v3_as_array)); + + /* Processing variable compute_perimeterf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&compute_perimeterf2pywrap,v1,v2,v3); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",compute_perimeterf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable compute_perimeterf2pywrap */ + if((PyObject *)capi_v3_as_array!=v3_capi) { + Py_XDECREF(capi_v3_as_array); } + } /* if (capi_v3_as_array == NULL) ... else of v3 */ + /* End of cleaning variable v3 */ + if((PyObject *)capi_v2_as_array!=v2_capi) { + Py_XDECREF(capi_v2_as_array); } + } /* if (capi_v2_as_array == NULL) ... else of v2 */ + /* End of cleaning variable v2 */ + if((PyObject *)capi_v1_as_array!=v1_capi) { + Py_XDECREF(capi_v1_as_array); } + } /* if (capi_v1_as_array == NULL) ... else of v1 */ + /* End of cleaning variable v1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of compute_perimeter **************************/ + +/****************************** three_to_one_len ******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_three_to_one_len[] = "\ +three_to_one_len = three_to_one_len(v,v_min,v_len)\n\nWrapper for ``three_to_one_len``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_len : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"three_to_one_len : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_three_to_one_len(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int three_to_one_lenf2pywrap = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_len = NULL; + npy_intp v_len_Dims[1] = {-1}; + const int v_len_Rank = 1; + PyArrayObject *capi_v_len_as_array = NULL; + int capi_v_len_intent = 0; + PyObject *v_len_capi = Py_None; + static char *capi_kwlist[] = {"v","v_min","v_len",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.three_to_one_len",\ + capi_kwlist,&v_capi,&v_min_capi,&v_len_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one_len: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one_len: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_len */ + v_len_Dims[0]=3; + capi_v_len_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one_len: failed to create array from the 3rd argument `v_len`"; + capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); + if (capi_v_len_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); + + /* Processing variable three_to_one_lenf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&three_to_one_lenf2pywrap,v,v_min,v_len); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",three_to_one_lenf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable three_to_one_lenf2pywrap */ + if((PyObject *)capi_v_len_as_array!=v_len_capi) { + Py_XDECREF(capi_v_len_as_array); } + } /* if (capi_v_len_as_array == NULL) ... else of v_len */ + /* End of cleaning variable v_len */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of three_to_one_len **************************/ + +/******************************** three_to_one ********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_three_to_one[] = "\ +three_to_one = three_to_one(v,v_min,v_max)\n\nWrapper for ``three_to_one``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_max : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"three_to_one : int"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_three_to_one(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int three_to_onef2pywrap = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_max = NULL; + npy_intp v_max_Dims[1] = {-1}; + const int v_max_Rank = 1; + PyArrayObject *capi_v_max_as_array = NULL; + int capi_v_max_intent = 0; + PyObject *v_max_capi = Py_None; + static char *capi_kwlist[] = {"v","v_min","v_max",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.three_to_one",\ + capi_kwlist,&v_capi,&v_min_capi,&v_max_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_max */ + v_max_Dims[0]=3; + capi_v_max_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one: failed to create array from the 3rd argument `v_max`"; + capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); + if (capi_v_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); + + /* Processing variable three_to_onef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&three_to_onef2pywrap,v,v_min,v_max); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",three_to_onef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable three_to_onef2pywrap */ + if((PyObject *)capi_v_max_as_array!=v_max_capi) { + Py_XDECREF(capi_v_max_as_array); } + } /* if (capi_v_max_as_array == NULL) ... else of v_max */ + /* End of cleaning variable v_max */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of three_to_one ****************************/ + +/****************************** one_to_three_len ******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_one_to_three_len[] = "\ +one_to_three_len = one_to_three_len(j,v_min,v_len)\n\nWrapper for ``one_to_three_len``.\ +\n\nParameters\n----------\n" +"j : input int\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_len : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"one_to_three_len : rank-1 array('i') with bounds (3) and one_to_three_lenf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_one_to_three_len(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *one_to_three_lenf2pywrap = NULL; + npy_intp one_to_three_lenf2pywrap_Dims[1] = {-1}; + const int one_to_three_lenf2pywrap_Rank = 1; + PyArrayObject *capi_one_to_three_lenf2pywrap_as_array = NULL; + int capi_one_to_three_lenf2pywrap_intent = 0; + int j = 0; + PyObject *j_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_len = NULL; + npy_intp v_len_Dims[1] = {-1}; + const int v_len_Rank = 1; + PyArrayObject *capi_v_len_as_array = NULL; + int capi_v_len_intent = 0; + PyObject *v_len_capi = Py_None; + static char *capi_kwlist[] = {"j","v_min","v_len",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.one_to_three_len",\ + capi_kwlist,&j_capi,&v_min_capi,&v_len_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable j */ + f2py_success = int_from_pyobj(&j,j_capi,"thirdorder.third_order_centering.one_to_three_len() 1st argument (j) can't be converted to int"); + if (f2py_success) { + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three_len: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_len */ + v_len_Dims[0]=3; + capi_v_len_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three_len: failed to create array from the 3rd argument `v_len`"; + capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); + if (capi_v_len_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); + + /* Processing variable one_to_three_lenf2pywrap */ + one_to_three_lenf2pywrap_Dims[0]=3; + capi_one_to_three_lenf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three_len: failed to create array from the hidden `one_to_three_lenf2pywrap`"; + capi_one_to_three_lenf2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_three_lenf2pywrap_Dims,one_to_three_lenf2pywrap_Rank, capi_one_to_three_lenf2pywrap_intent,Py_None,capi_errmess); + if (capi_one_to_three_lenf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + one_to_three_lenf2pywrap = (int *)(PyArray_DATA(capi_one_to_three_lenf2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(one_to_three_lenf2pywrap,&j,v_min,v_len); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_one_to_three_lenf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_one_to_three_lenf2pywrap_as_array == NULL) ... else of one_to_three_lenf2pywrap */ + /* End of cleaning variable one_to_three_lenf2pywrap */ + if((PyObject *)capi_v_len_as_array!=v_len_capi) { + Py_XDECREF(capi_v_len_as_array); } + } /* if (capi_v_len_as_array == NULL) ... else of v_len */ + /* End of cleaning variable v_len */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + } /*if (f2py_success) of j*/ + /* End of cleaning variable j */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of one_to_three_len **************************/ + +/******************************** one_to_three ********************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_one_to_three[] = "\ +one_to_three = one_to_three(j,v_min,v_max)\n\nWrapper for ``one_to_three``.\ +\n\nParameters\n----------\n" +"j : input int\n" +"v_min : input rank-1 array('i') with bounds (3)\n" +"v_max : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"one_to_three : rank-1 array('i') with bounds (3) and one_to_threef2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_one_to_three(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *one_to_threef2pywrap = NULL; + npy_intp one_to_threef2pywrap_Dims[1] = {-1}; + const int one_to_threef2pywrap_Rank = 1; + PyArrayObject *capi_one_to_threef2pywrap_as_array = NULL; + int capi_one_to_threef2pywrap_intent = 0; + int j = 0; + PyObject *j_capi = Py_None; + int *v_min = NULL; + npy_intp v_min_Dims[1] = {-1}; + const int v_min_Rank = 1; + PyArrayObject *capi_v_min_as_array = NULL; + int capi_v_min_intent = 0; + PyObject *v_min_capi = Py_None; + int *v_max = NULL; + npy_intp v_max_Dims[1] = {-1}; + const int v_max_Rank = 1; + PyArrayObject *capi_v_max_as_array = NULL; + int capi_v_max_intent = 0; + PyObject *v_max_capi = Py_None; + static char *capi_kwlist[] = {"j","v_min","v_max",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.one_to_three",\ + capi_kwlist,&j_capi,&v_min_capi,&v_max_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable j */ + f2py_success = int_from_pyobj(&j,j_capi,"thirdorder.third_order_centering.one_to_three() 1st argument (j) can't be converted to int"); + if (f2py_success) { + /* Processing variable v_min */ + v_min_Dims[0]=3; + capi_v_min_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three: failed to create array from the 2nd argument `v_min`"; + capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); + if (capi_v_min_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); + + /* Processing variable v_max */ + v_max_Dims[0]=3; + capi_v_max_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three: failed to create array from the 3rd argument `v_max`"; + capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); + if (capi_v_max_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); + + /* Processing variable one_to_threef2pywrap */ + one_to_threef2pywrap_Dims[0]=3; + capi_one_to_threef2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three: failed to create array from the hidden `one_to_threef2pywrap`"; + capi_one_to_threef2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_threef2pywrap_Dims,one_to_threef2pywrap_Rank, capi_one_to_threef2pywrap_intent,Py_None,capi_errmess); + if (capi_one_to_threef2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + one_to_threef2pywrap = (int *)(PyArray_DATA(capi_one_to_threef2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(one_to_threef2pywrap,&j,v_min,v_max); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_one_to_threef2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_one_to_threef2pywrap_as_array == NULL) ... else of one_to_threef2pywrap */ + /* End of cleaning variable one_to_threef2pywrap */ + if((PyObject *)capi_v_max_as_array!=v_max_capi) { + Py_XDECREF(capi_v_max_as_array); } + } /* if (capi_v_max_as_array == NULL) ... else of v_max */ + /* End of cleaning variable v_max */ + if((PyObject *)capi_v_min_as_array!=v_min_capi) { + Py_XDECREF(capi_v_min_as_array); } + } /* if (capi_v_min_as_array == NULL) ... else of v_min */ + /* End of cleaning variable v_min */ + } /*if (f2py_success) of j*/ + /* End of cleaning variable j */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of one_to_three ****************************/ + +/******************************* min_el_wise_2 *******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_2[] = "\ +min_el_wise_2 = min_el_wise_2(a,b)\n\nWrapper for ``min_el_wise_2``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"min_el_wise_2 : rank-1 array('i') with bounds (3) and min_el_wise_2f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_min_el_wise_2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *min_el_wise_2f2pywrap = NULL; + npy_intp min_el_wise_2f2pywrap_Dims[1] = {-1}; + const int min_el_wise_2f2pywrap_Rank = 1; + PyArrayObject *capi_min_el_wise_2f2pywrap_as_array = NULL; + int capi_min_el_wise_2f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + static char *capi_kwlist[] = {"a","b",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_centering.min_el_wise_2",\ + capi_kwlist,&a_capi,&b_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_2: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_2: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable min_el_wise_2f2pywrap */ + min_el_wise_2f2pywrap_Dims[0]=3; + capi_min_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_2: failed to create array from the hidden `min_el_wise_2f2pywrap`"; + capi_min_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_2f2pywrap_Dims,min_el_wise_2f2pywrap_Rank, capi_min_el_wise_2f2pywrap_intent,Py_None,capi_errmess); + if (capi_min_el_wise_2f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + min_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_2f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(min_el_wise_2f2pywrap,a,b); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_2f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_min_el_wise_2f2pywrap_as_array == NULL) ... else of min_el_wise_2f2pywrap */ + /* End of cleaning variable min_el_wise_2f2pywrap */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of min_el_wise_2 ****************************/ + +/******************************* max_el_wise_2 *******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_2[] = "\ +max_el_wise_2 = max_el_wise_2(a,b)\n\nWrapper for ``max_el_wise_2``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"max_el_wise_2 : rank-1 array('i') with bounds (3) and max_el_wise_2f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_max_el_wise_2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *max_el_wise_2f2pywrap = NULL; + npy_intp max_el_wise_2f2pywrap_Dims[1] = {-1}; + const int max_el_wise_2f2pywrap_Rank = 1; + PyArrayObject *capi_max_el_wise_2f2pywrap_as_array = NULL; + int capi_max_el_wise_2f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + static char *capi_kwlist[] = {"a","b",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_centering.max_el_wise_2",\ + capi_kwlist,&a_capi,&b_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_2: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_2: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable max_el_wise_2f2pywrap */ + max_el_wise_2f2pywrap_Dims[0]=3; + capi_max_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_2: failed to create array from the hidden `max_el_wise_2f2pywrap`"; + capi_max_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_2f2pywrap_Dims,max_el_wise_2f2pywrap_Rank, capi_max_el_wise_2f2pywrap_intent,Py_None,capi_errmess); + if (capi_max_el_wise_2f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + max_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_2f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(max_el_wise_2f2pywrap,a,b); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_2f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_max_el_wise_2f2pywrap_as_array == NULL) ... else of max_el_wise_2f2pywrap */ + /* End of cleaning variable max_el_wise_2f2pywrap */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of max_el_wise_2 ****************************/ + +/******************************* min_el_wise_3 *******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_3[] = "\ +min_el_wise_3 = min_el_wise_3(a,b,c)\n\nWrapper for ``min_el_wise_3``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"c : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"min_el_wise_3 : rank-1 array('i') with bounds (3) and min_el_wise_3f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_min_el_wise_3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *min_el_wise_3f2pywrap = NULL; + npy_intp min_el_wise_3f2pywrap_Dims[1] = {-1}; + const int min_el_wise_3f2pywrap_Rank = 1; + PyArrayObject *capi_min_el_wise_3f2pywrap_as_array = NULL; + int capi_min_el_wise_3f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + int *c = NULL; + npy_intp c_Dims[1] = {-1}; + const int c_Rank = 1; + PyArrayObject *capi_c_as_array = NULL; + int capi_c_intent = 0; + PyObject *c_capi = Py_None; + static char *capi_kwlist[] = {"a","b","c",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.min_el_wise_3",\ + capi_kwlist,&a_capi,&b_capi,&c_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable c */ + c_Dims[0]=3; + capi_c_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the 3rd argument `c`"; + capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); + if (capi_c_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + c = (int *)(PyArray_DATA(capi_c_as_array)); + + /* Processing variable min_el_wise_3f2pywrap */ + min_el_wise_3f2pywrap_Dims[0]=3; + capi_min_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the hidden `min_el_wise_3f2pywrap`"; + capi_min_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_3f2pywrap_Dims,min_el_wise_3f2pywrap_Rank, capi_min_el_wise_3f2pywrap_intent,Py_None,capi_errmess); + if (capi_min_el_wise_3f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + min_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_3f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(min_el_wise_3f2pywrap,a,b,c); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_3f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_min_el_wise_3f2pywrap_as_array == NULL) ... else of min_el_wise_3f2pywrap */ + /* End of cleaning variable min_el_wise_3f2pywrap */ + if((PyObject *)capi_c_as_array!=c_capi) { + Py_XDECREF(capi_c_as_array); } + } /* if (capi_c_as_array == NULL) ... else of c */ + /* End of cleaning variable c */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of min_el_wise_3 ****************************/ + +/******************************* max_el_wise_3 *******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_3[] = "\ +max_el_wise_3 = max_el_wise_3(a,b,c)\n\nWrapper for ``max_el_wise_3``.\ +\n\nParameters\n----------\n" +"a : input rank-1 array('i') with bounds (3)\n" +"b : input rank-1 array('i') with bounds (3)\n" +"c : input rank-1 array('i') with bounds (3)\n" +"\nReturns\n-------\n" +"max_el_wise_3 : rank-1 array('i') with bounds (3) and max_el_wise_3f2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_max_el_wise_3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int *max_el_wise_3f2pywrap = NULL; + npy_intp max_el_wise_3f2pywrap_Dims[1] = {-1}; + const int max_el_wise_3f2pywrap_Rank = 1; + PyArrayObject *capi_max_el_wise_3f2pywrap_as_array = NULL; + int capi_max_el_wise_3f2pywrap_intent = 0; + int *a = NULL; + npy_intp a_Dims[1] = {-1}; + const int a_Rank = 1; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int *b = NULL; + npy_intp b_Dims[1] = {-1}; + const int b_Rank = 1; + PyArrayObject *capi_b_as_array = NULL; + int capi_b_intent = 0; + PyObject *b_capi = Py_None; + int *c = NULL; + npy_intp c_Dims[1] = {-1}; + const int c_Rank = 1; + PyArrayObject *capi_c_as_array = NULL; + int capi_c_intent = 0; + PyObject *c_capi = Py_None; + static char *capi_kwlist[] = {"a","b","c",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_centering.max_el_wise_3",\ + capi_kwlist,&a_capi,&b_capi,&c_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + a_Dims[0]=3; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (int *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable b */ + b_Dims[0]=3; + capi_b_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the 2nd argument `b`"; + capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); + if (capi_b_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + b = (int *)(PyArray_DATA(capi_b_as_array)); + + /* Processing variable c */ + c_Dims[0]=3; + capi_c_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the 3rd argument `c`"; + capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); + if (capi_c_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + c = (int *)(PyArray_DATA(capi_c_as_array)); + + /* Processing variable max_el_wise_3f2pywrap */ + max_el_wise_3f2pywrap_Dims[0]=3; + capi_max_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the hidden `max_el_wise_3f2pywrap`"; + capi_max_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_3f2pywrap_Dims,max_el_wise_3f2pywrap_Rank, capi_max_el_wise_3f2pywrap_intent,Py_None,capi_errmess); + if (capi_max_el_wise_3f2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + max_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_3f2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(max_el_wise_3f2pywrap,a,b,c); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_3f2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_max_el_wise_3f2pywrap_as_array == NULL) ... else of max_el_wise_3f2pywrap */ + /* End of cleaning variable max_el_wise_3f2pywrap */ + if((PyObject *)capi_c_as_array!=c_capi) { + Py_XDECREF(capi_c_as_array); } + } /* if (capi_c_as_array == NULL) ... else of c */ + /* End of cleaning variable c */ + if((PyObject *)capi_b_as_array!=b_capi) { + Py_XDECREF(capi_b_as_array); } + } /* if (capi_b_as_array == NULL) ... else of b */ + /* End of cleaning variable b */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of max_el_wise_3 ****************************/ + +/******************************* cryst_to_cart *******************************/ +static char doc_f2py_rout_thirdorder_third_order_centering_cryst_to_cart[] = "\ +cryst_to_cart = cryst_to_cart(v,alat)\n\nWrapper for ``cryst_to_cart``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('i') with bounds (3)\n" +"alat : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"cryst_to_cart : rank-1 array('d') with bounds (3) and cryst_to_cartf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_centering_cryst_to_cart(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *cryst_to_cartf2pywrap = NULL; + npy_intp cryst_to_cartf2pywrap_Dims[1] = {-1}; + const int cryst_to_cartf2pywrap_Rank = 1; + PyArrayObject *capi_cryst_to_cartf2pywrap_as_array = NULL; + int capi_cryst_to_cartf2pywrap_intent = 0; + int *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + double *alat = NULL; + npy_intp alat_Dims[2] = {-1, -1}; + const int alat_Rank = 2; + PyArrayObject *capi_alat_as_array = NULL; + int capi_alat_intent = 0; + PyObject *alat_capi = Py_None; + static char *capi_kwlist[] = {"v","alat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_centering.cryst_to_cart",\ + capi_kwlist,&v_capi,&alat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.cryst_to_cart: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (int *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable alat */ + alat_Dims[0]=3,alat_Dims[1]=3; + capi_alat_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.cryst_to_cart: failed to create array from the 2nd argument `alat`"; + capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); + if (capi_alat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + alat = (double *)(PyArray_DATA(capi_alat_as_array)); + + /* Processing variable cryst_to_cartf2pywrap */ + cryst_to_cartf2pywrap_Dims[0]=3; + capi_cryst_to_cartf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.cryst_to_cart: failed to create array from the hidden `cryst_to_cartf2pywrap`"; + capi_cryst_to_cartf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cryst_to_cartf2pywrap_Dims,cryst_to_cartf2pywrap_Rank, capi_cryst_to_cartf2pywrap_intent,Py_None,capi_errmess); + if (capi_cryst_to_cartf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + cryst_to_cartf2pywrap = (double *)(PyArray_DATA(capi_cryst_to_cartf2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(cryst_to_cartf2pywrap,v,alat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_cryst_to_cartf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_cryst_to_cartf2pywrap_as_array == NULL) ... else of cryst_to_cartf2pywrap */ + /* End of cleaning variable cryst_to_cartf2pywrap */ + if((PyObject *)capi_alat_as_array!=alat_capi) { + Py_XDECREF(capi_alat_as_array); } + } /* if (capi_alat_as_array == NULL) ... else of alat */ + /* End of cleaning variable alat */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of cryst_to_cart ****************************/ + +/************************* check_permutation_symmetry *************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry[] = "\ +perm = check_permutation_symmetry(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``check_permutation_symmetry``.\ +\n\nParameters\n----------\n" +"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" +"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" +"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 0)\n" +"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" +"\nReturns\n-------\n" +"perm : int"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *r_vector2 = NULL; + npy_intp r_vector2_Dims[2] = {-1, -1}; + const int r_vector2_Rank = 2; + PyArrayObject *capi_r_vector2_as_array = NULL; + int capi_r_vector2_intent = 0; + PyObject *r_vector2_capi = Py_None; + double *r_vector3 = NULL; + npy_intp r_vector3_Dims[2] = {-1, -1}; + const int r_vector3_Rank = 2; + PyArrayObject *capi_r_vector3_as_array = NULL; + int capi_r_vector3_intent = 0; + PyObject *r_vector3_capi = Py_None; + int n_r = 0; + PyObject *n_r_capi = Py_None; + int natom = 0; + PyObject *natom_capi = Py_None; + int perm = 0; + static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thirdorder.third_order_cond_centering.check_permutation_symmetry",\ + capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable tensor */ + ; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.check_permutation_symmetry: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + /* Processing variable perm */ + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 0); else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.check_permutation_symmetry() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","check_permutation_symmetry:n_r=%d",n_r) { + /* Processing variable natom */ + if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.check_permutation_symmetry() 2nd keyword (natom) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","check_permutation_symmetry:natom=%d",natom) { + /* Processing variable r_vector2 */ + r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; + capi_r_vector2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.check_permutation_symmetry: failed to create array from the 2nd argument `r_vector2`"; + capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); + if (capi_r_vector2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); + + /* Processing variable r_vector3 */ + r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; + capi_r_vector3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.check_permutation_symmetry: failed to create array from the 3rd argument `r_vector3`"; + capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); + if (capi_r_vector3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,r_vector2,r_vector3,&n_r,&natom,&perm); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",perm); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { + Py_XDECREF(capi_r_vector3_as_array); } + } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ + /* End of cleaning variable r_vector3 */ + if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { + Py_XDECREF(capi_r_vector2_as_array); } + } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ + /* End of cleaning variable r_vector2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ + } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + /* End of cleaning variable perm */ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of check_permutation_symmetry *********************/ + +/************************* apply_permutation_symmetry *************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry[] = "\ +new_tensor = apply_permutation_symmetry(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``apply_permutation_symmetry``.\ +\n\nParameters\n----------\n" +"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" +"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" +"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 0)\n" +"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" +"\nReturns\n-------\n" +"new_tensor : rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *r_vector2 = NULL; + npy_intp r_vector2_Dims[2] = {-1, -1}; + const int r_vector2_Rank = 2; + PyArrayObject *capi_r_vector2_as_array = NULL; + int capi_r_vector2_intent = 0; + PyObject *r_vector2_capi = Py_None; + double *r_vector3 = NULL; + npy_intp r_vector3_Dims[2] = {-1, -1}; + const int r_vector3_Rank = 2; + PyArrayObject *capi_r_vector3_as_array = NULL; + int capi_r_vector3_intent = 0; + PyObject *r_vector3_capi = Py_None; + double *new_tensor = NULL; + npy_intp new_tensor_Dims[4] = {-1, -1, -1, -1}; + const int new_tensor_Rank = 4; + PyArrayObject *capi_new_tensor_as_array = NULL; + int capi_new_tensor_intent = 0; + int n_r = 0; + PyObject *n_r_capi = Py_None; + int natom = 0; + PyObject *natom_capi = Py_None; + static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thirdorder.third_order_cond_centering.apply_permutation_symmetry",\ + capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable tensor */ + ; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 0); else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","apply_permutation_symmetry:n_r=%d",n_r) { + /* Processing variable natom */ + if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry() 2nd keyword (natom) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","apply_permutation_symmetry:natom=%d",natom) { + /* Processing variable r_vector2 */ + r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; + capi_r_vector2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the 2nd argument `r_vector2`"; + capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); + if (capi_r_vector2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); + + /* Processing variable r_vector3 */ + r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; + capi_r_vector3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the 3rd argument `r_vector3`"; + capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); + if (capi_r_vector3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); + + /* Processing variable new_tensor */ + new_tensor_Dims[0]=n_r,new_tensor_Dims[1]=3 * natom,new_tensor_Dims[2]=3 * natom,new_tensor_Dims[3]=3 * natom; + capi_new_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the hidden `new_tensor`"; + capi_new_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_tensor_Dims,new_tensor_Rank, capi_new_tensor_intent,Py_None,capi_errmess); + if (capi_new_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + new_tensor = (double *)(PyArray_DATA(capi_new_tensor_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,r_vector2,r_vector3,new_tensor,&n_r,&natom); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_new_tensor_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_new_tensor_as_array == NULL) ... else of new_tensor */ + /* End of cleaning variable new_tensor */ + if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { + Py_XDECREF(capi_r_vector3_as_array); } + } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ + /* End of cleaning variable r_vector3 */ + if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { + Py_XDECREF(capi_r_vector2_as_array); } + } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ + /* End of cleaning variable r_vector2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ + } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of apply_permutation_symmetry *********************/ + +/********************** apply_permutation_symmetry_local **********************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local[] = "\ +apply_permutation_symmetry_local(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``apply_permutation_symmetry_local``.\ +\n\nParameters\n----------\n" +"tensor : in/output rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" +"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" +"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 0)\n" +"natom : input int, optional\n Default: shape(tensor, 1) / 3"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *r_vector2 = NULL; + npy_intp r_vector2_Dims[2] = {-1, -1}; + const int r_vector2_Rank = 2; + PyArrayObject *capi_r_vector2_as_array = NULL; + int capi_r_vector2_intent = 0; + PyObject *r_vector2_capi = Py_None; + double *r_vector3 = NULL; + npy_intp r_vector3_Dims[2] = {-1, -1}; + const int r_vector3_Rank = 2; + PyArrayObject *capi_r_vector3_as_array = NULL; + int capi_r_vector3_intent = 0; + PyObject *r_vector3_capi = Py_None; + int n_r = 0; + PyObject *n_r_capi = Py_None; + int natom = 0; + PyObject *natom_capi = Py_None; + static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thirdorder.third_order_cond_centering.apply_permutation_symmetry_local",\ + capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable tensor */ + ; + capi_tensor_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry_local: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 0); else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry_local() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","apply_permutation_symmetry_local:n_r=%d",n_r) { + /* Processing variable natom */ + if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry_local() 2nd keyword (natom) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","apply_permutation_symmetry_local:natom=%d",natom) { + /* Processing variable r_vector2 */ + r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; + capi_r_vector2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry_local: failed to create array from the 2nd argument `r_vector2`"; + capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); + if (capi_r_vector2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); + + /* Processing variable r_vector3 */ + r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; + capi_r_vector3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry_local: failed to create array from the 3rd argument `r_vector3`"; + capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); + if (capi_r_vector3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,r_vector2,r_vector3,&n_r,&natom); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { + Py_XDECREF(capi_r_vector3_as_array); } + } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ + /* End of cleaning variable r_vector3 */ + if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { + Py_XDECREF(capi_r_vector2_as_array); } + } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ + /* End of cleaning variable r_vector2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ + } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************** end of apply_permutation_symmetry_local ******************/ + +/***************************** number_of_triplets *****************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets[] = "\ +itrip = number_of_triplets(tensor,rvec2,rvec3,tot_trip,natom,[n_r])\n\nWrapper for ``number_of_triplets``.\ +\n\nParameters\n----------\n" +"tensor : input rank-5 array('d') with bounds (natom * natom * natom,81 * n_r,3,3,3)\n" +"rvec2 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" +"rvec3 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" +"tot_trip : input rank-1 array('i') with bounds (natom * natom * natom)\n" +"natom : input int\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 1) / 81\n" +"\nReturns\n-------\n" +"itrip : int"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[5] = {-1, -1, -1, -1, -1}; + const int tensor_Rank = 5; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *rvec2 = NULL; + npy_intp rvec2_Dims[3] = {-1, -1, -1}; + const int rvec2_Rank = 3; + PyArrayObject *capi_rvec2_as_array = NULL; + int capi_rvec2_intent = 0; + PyObject *rvec2_capi = Py_None; + double *rvec3 = NULL; + npy_intp rvec3_Dims[3] = {-1, -1, -1}; + const int rvec3_Rank = 3; + PyArrayObject *capi_rvec3_as_array = NULL; + int capi_rvec3_intent = 0; + PyObject *rvec3_capi = Py_None; + int *tot_trip = NULL; + npy_intp tot_trip_Dims[1] = {-1}; + const int tot_trip_Rank = 1; + PyArrayObject *capi_tot_trip_as_array = NULL; + int capi_tot_trip_intent = 0; + PyObject *tot_trip_capi = Py_None; + int itrip = 0; + int natom = 0; + PyObject *natom_capi = Py_None; + int n_r = 0; + PyObject *n_r_capi = Py_None; + static char *capi_kwlist[] = {"tensor","rvec2","rvec3","tot_trip","natom","n_r",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|O:thirdorder.third_order_cond_centering.number_of_triplets",\ + capi_kwlist,&tensor_capi,&rvec2_capi,&rvec3_capi,&tot_trip_capi,&natom_capi,&n_r_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable natom */ + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.number_of_triplets() 5th argument (natom) can't be converted to int"); + if (f2py_success) { + /* Processing variable itrip */ + /* Processing variable tensor */ + tensor_Dims[0]=natom * natom * natom,tensor_Dims[2]=3,tensor_Dims[3]=3,tensor_Dims[4]=3; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + CHECKARRAY(shape(tensor, 0) == natom * natom * natom,"shape(tensor, 0) == natom * natom * natom","1st argument tensor") { + /* Processing variable tot_trip */ + tot_trip_Dims[0]=natom * natom * natom; + capi_tot_trip_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 4th argument `tot_trip`"; + capi_tot_trip_as_array = ndarray_from_pyobj( NPY_INT,1,tot_trip_Dims,tot_trip_Rank, capi_tot_trip_intent,tot_trip_capi,capi_errmess); + if (capi_tot_trip_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tot_trip = (int *)(PyArray_DATA(capi_tot_trip_as_array)); + + CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom,"shape(tot_trip, 0) == natom * natom * natom","4th argument tot_trip") { + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 1) / 81; else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.number_of_triplets() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 81 * n_r,"shape(tensor, 1) == 81 * n_r","1st keyword n_r","number_of_triplets:n_r=%d",n_r) { + /* Processing variable rvec2 */ + rvec2_Dims[0]=natom * natom * natom,rvec2_Dims[1]=81 * n_r,rvec2_Dims[2]=3; + capi_rvec2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 2nd argument `rvec2`"; + capi_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec2_Dims,rvec2_Rank, capi_rvec2_intent,rvec2_capi,capi_errmess); + if (capi_rvec2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rvec2 = (double *)(PyArray_DATA(capi_rvec2_as_array)); + + CHECKARRAY(shape(rvec2, 0) == natom * natom * natom,"shape(rvec2, 0) == natom * natom * natom","2nd argument rvec2") { + /* Processing variable rvec3 */ + rvec3_Dims[0]=natom * natom * natom,rvec3_Dims[1]=81 * n_r,rvec3_Dims[2]=3; + capi_rvec3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 3rd argument `rvec3`"; + capi_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec3_Dims,rvec3_Rank, capi_rvec3_intent,rvec3_capi,capi_errmess); + if (capi_rvec3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rvec3 = (double *)(PyArray_DATA(capi_rvec3_as_array)); + + CHECKARRAY(shape(rvec3, 0) == natom * natom * natom,"shape(rvec3, 0) == natom * natom * natom","3rd argument rvec3") { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,rvec2,rvec3,tot_trip,&itrip,&natom,&n_r); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",itrip); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKARRAY(shape(rvec3, 0) == natom * natom * natom)*/ + if((PyObject *)capi_rvec3_as_array!=rvec3_capi) { + Py_XDECREF(capi_rvec3_as_array); } + } /* if (capi_rvec3_as_array == NULL) ... else of rvec3 */ + /* End of cleaning variable rvec3 */ + } /*CHECKARRAY(shape(rvec2, 0) == natom * natom * natom)*/ + if((PyObject *)capi_rvec2_as_array!=rvec2_capi) { + Py_XDECREF(capi_rvec2_as_array); } + } /* if (capi_rvec2_as_array == NULL) ... else of rvec2 */ + /* End of cleaning variable rvec2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 81 * n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + } /*CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom)*/ + if((PyObject *)capi_tot_trip_as_array!=tot_trip_capi) { + Py_XDECREF(capi_tot_trip_as_array); } + } /* if (capi_tot_trip_as_array == NULL) ... else of tot_trip */ + /* End of cleaning variable tot_trip */ + } /*CHECKARRAY(shape(tensor, 0) == natom * natom * natom)*/ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ + /* End of cleaning variable itrip */ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of number_of_triplets *************************/ + +/******************************* find_triplets *******************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_find_triplets[] = "\ +help_tensor,help_rvec2,help_rvec3,tot_trip = find_triplets(tensor,r_vector2,r_vector3,rsup,irsup,pos,far,[n_r,natom])\n\nWrapper for ``find_triplets``.\ +\n\nParameters\n----------\n" +"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" +"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" +"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" +"rsup : input rank-2 array('d') with bounds (3,3)\n" +"irsup : input rank-2 array('d') with bounds (3,3)\n" +"pos : input rank-2 array('d') with bounds (natom,3)\n" +"far : input int\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 0)\n" +"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" +"\nReturns\n-------\n" +"help_tensor : rank-5 array('d') with bounds (natom * natom * natom,81 * n_r,3,3,3)\n" +"help_rvec2 : rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" +"help_rvec3 : rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" +"tot_trip : rank-1 array('i') with bounds (natom * natom * natom)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_find_triplets(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *r_vector2 = NULL; + npy_intp r_vector2_Dims[2] = {-1, -1}; + const int r_vector2_Rank = 2; + PyArrayObject *capi_r_vector2_as_array = NULL; + int capi_r_vector2_intent = 0; + PyObject *r_vector2_capi = Py_None; + double *r_vector3 = NULL; + npy_intp r_vector3_Dims[2] = {-1, -1}; + const int r_vector3_Rank = 2; + PyArrayObject *capi_r_vector3_as_array = NULL; + int capi_r_vector3_intent = 0; + PyObject *r_vector3_capi = Py_None; + double *rsup = NULL; + npy_intp rsup_Dims[2] = {-1, -1}; + const int rsup_Rank = 2; + PyArrayObject *capi_rsup_as_array = NULL; + int capi_rsup_intent = 0; + PyObject *rsup_capi = Py_None; + double *irsup = NULL; + npy_intp irsup_Dims[2] = {-1, -1}; + const int irsup_Rank = 2; + PyArrayObject *capi_irsup_as_array = NULL; + int capi_irsup_intent = 0; + PyObject *irsup_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *help_tensor = NULL; + npy_intp help_tensor_Dims[5] = {-1, -1, -1, -1, -1}; + const int help_tensor_Rank = 5; + PyArrayObject *capi_help_tensor_as_array = NULL; + int capi_help_tensor_intent = 0; + double *help_rvec2 = NULL; + npy_intp help_rvec2_Dims[3] = {-1, -1, -1}; + const int help_rvec2_Rank = 3; + PyArrayObject *capi_help_rvec2_as_array = NULL; + int capi_help_rvec2_intent = 0; + double *help_rvec3 = NULL; + npy_intp help_rvec3_Dims[3] = {-1, -1, -1}; + const int help_rvec3_Rank = 3; + PyArrayObject *capi_help_rvec3_as_array = NULL; + int capi_help_rvec3_intent = 0; + int *tot_trip = NULL; + npy_intp tot_trip_Dims[1] = {-1}; + const int tot_trip_Rank = 1; + PyArrayObject *capi_tot_trip_as_array = NULL; + int capi_tot_trip_intent = 0; + int far = 0; + PyObject *far_capi = Py_None; + int n_r = 0; + PyObject *n_r_capi = Py_None; + int natom = 0; + PyObject *natom_capi = Py_None; + static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","rsup","irsup","pos","far","n_r","natom",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OO:thirdorder.third_order_cond_centering.find_triplets",\ + capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&rsup_capi,&irsup_capi,&pos_capi,&far_capi,&n_r_capi,&natom_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable far */ + f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_cond_centering.find_triplets() 7th argument (far) can't be converted to int"); + if (f2py_success) { + /* Processing variable tensor */ + ; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + /* Processing variable rsup */ + rsup_Dims[0]=3,rsup_Dims[1]=3; + capi_rsup_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 4th argument `rsup`"; + capi_rsup_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rsup_Dims,rsup_Rank, capi_rsup_intent,rsup_capi,capi_errmess); + if (capi_rsup_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rsup = (double *)(PyArray_DATA(capi_rsup_as_array)); + + /* Processing variable irsup */ + irsup_Dims[0]=3,irsup_Dims[1]=3; + capi_irsup_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 5th argument `irsup`"; + capi_irsup_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irsup_Dims,irsup_Rank, capi_irsup_intent,irsup_capi,capi_errmess); + if (capi_irsup_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + irsup = (double *)(PyArray_DATA(capi_irsup_as_array)); + + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 0); else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.find_triplets() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","find_triplets:n_r=%d",n_r) { + /* Processing variable natom */ + if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.find_triplets() 2nd keyword (natom) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","find_triplets:natom=%d",natom) { + /* Processing variable r_vector2 */ + r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; + capi_r_vector2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 2nd argument `r_vector2`"; + capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); + if (capi_r_vector2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); + + /* Processing variable r_vector3 */ + r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; + capi_r_vector3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 3rd argument `r_vector3`"; + capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); + if (capi_r_vector3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=natom,pos_Dims[1]=3; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 6th argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable help_tensor */ + help_tensor_Dims[0]=natom * natom * natom,help_tensor_Dims[1]=81 * n_r,help_tensor_Dims[2]=3,help_tensor_Dims[3]=3,help_tensor_Dims[4]=3; + capi_help_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `help_tensor`"; + capi_help_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,help_tensor_Dims,help_tensor_Rank, capi_help_tensor_intent,Py_None,capi_errmess); + if (capi_help_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + help_tensor = (double *)(PyArray_DATA(capi_help_tensor_as_array)); + + /* Processing variable help_rvec2 */ + help_rvec2_Dims[0]=natom * natom * natom,help_rvec2_Dims[1]=81 * n_r,help_rvec2_Dims[2]=3; + capi_help_rvec2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `help_rvec2`"; + capi_help_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,help_rvec2_Dims,help_rvec2_Rank, capi_help_rvec2_intent,Py_None,capi_errmess); + if (capi_help_rvec2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + help_rvec2 = (double *)(PyArray_DATA(capi_help_rvec2_as_array)); + + /* Processing variable help_rvec3 */ + help_rvec3_Dims[0]=natom * natom * natom,help_rvec3_Dims[1]=81 * n_r,help_rvec3_Dims[2]=3; + capi_help_rvec3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `help_rvec3`"; + capi_help_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,help_rvec3_Dims,help_rvec3_Rank, capi_help_rvec3_intent,Py_None,capi_errmess); + if (capi_help_rvec3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + help_rvec3 = (double *)(PyArray_DATA(capi_help_rvec3_as_array)); + + /* Processing variable tot_trip */ + tot_trip_Dims[0]=natom * natom * natom; + capi_tot_trip_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `tot_trip`"; + capi_tot_trip_as_array = ndarray_from_pyobj( NPY_INT,1,tot_trip_Dims,tot_trip_Rank, capi_tot_trip_intent,Py_None,capi_errmess); + if (capi_tot_trip_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tot_trip = (int *)(PyArray_DATA(capi_tot_trip_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,r_vector2,r_vector3,rsup,irsup,pos,help_tensor,help_rvec2,help_rvec3,tot_trip,&far,&n_r,&natom); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNNN",capi_help_tensor_as_array,capi_help_rvec2_as_array,capi_help_rvec3_as_array,capi_tot_trip_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_tot_trip_as_array == NULL) ... else of tot_trip */ + /* End of cleaning variable tot_trip */ + } /* if (capi_help_rvec3_as_array == NULL) ... else of help_rvec3 */ + /* End of cleaning variable help_rvec3 */ + } /* if (capi_help_rvec2_as_array == NULL) ... else of help_rvec2 */ + /* End of cleaning variable help_rvec2 */ + } /* if (capi_help_tensor_as_array == NULL) ... else of help_tensor */ + /* End of cleaning variable help_tensor */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { + Py_XDECREF(capi_r_vector3_as_array); } + } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ + /* End of cleaning variable r_vector3 */ + if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { + Py_XDECREF(capi_r_vector2_as_array); } + } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ + /* End of cleaning variable r_vector2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ + } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + if((PyObject *)capi_irsup_as_array!=irsup_capi) { + Py_XDECREF(capi_irsup_as_array); } + } /* if (capi_irsup_as_array == NULL) ... else of irsup */ + /* End of cleaning variable irsup */ + if((PyObject *)capi_rsup_as_array!=rsup_capi) { + Py_XDECREF(capi_rsup_as_array); } + } /* if (capi_rsup_as_array == NULL) ... else of rsup */ + /* End of cleaning variable rsup */ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ + } /*if (f2py_success) of far*/ + /* End of cleaning variable far */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of find_triplets ****************************/ + +/******************************* distribute_fc3 *******************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3[] = "\ +f_tensor,f_rvec2,f_rvec3,itrip = distribute_fc3(tensor,rvec2,rvec3,tot_trip,ntrip,natom,[n_r])\n\nWrapper for ``distribute_fc3``.\ +\n\nParameters\n----------\n" +"tensor : input rank-5 array('d') with bounds (natom * natom * natom,81 * n_r,3,3,3)\n" +"rvec2 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" +"rvec3 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" +"tot_trip : input rank-1 array('i') with bounds (natom * natom * natom)\n" +"ntrip : input int\n" +"natom : input int\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 1) / 81\n" +"\nReturns\n-------\n" +"f_tensor : rank-4 array('d') with bounds (ntrip,3 * natom,3 * natom,3 * natom)\n" +"f_rvec2 : rank-2 array('d') with bounds (ntrip,3)\n" +"f_rvec3 : rank-2 array('d') with bounds (ntrip,3)\n" +"itrip : int"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,double*,double*,double*,int*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[5] = {-1, -1, -1, -1, -1}; + const int tensor_Rank = 5; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *rvec2 = NULL; + npy_intp rvec2_Dims[3] = {-1, -1, -1}; + const int rvec2_Rank = 3; + PyArrayObject *capi_rvec2_as_array = NULL; + int capi_rvec2_intent = 0; + PyObject *rvec2_capi = Py_None; + double *rvec3 = NULL; + npy_intp rvec3_Dims[3] = {-1, -1, -1}; + const int rvec3_Rank = 3; + PyArrayObject *capi_rvec3_as_array = NULL; + int capi_rvec3_intent = 0; + PyObject *rvec3_capi = Py_None; + int *tot_trip = NULL; + npy_intp tot_trip_Dims[1] = {-1}; + const int tot_trip_Rank = 1; + PyArrayObject *capi_tot_trip_as_array = NULL; + int capi_tot_trip_intent = 0; + PyObject *tot_trip_capi = Py_None; + double *f_tensor = NULL; + npy_intp f_tensor_Dims[4] = {-1, -1, -1, -1}; + const int f_tensor_Rank = 4; + PyArrayObject *capi_f_tensor_as_array = NULL; + int capi_f_tensor_intent = 0; + double *f_rvec2 = NULL; + npy_intp f_rvec2_Dims[2] = {-1, -1}; + const int f_rvec2_Rank = 2; + PyArrayObject *capi_f_rvec2_as_array = NULL; + int capi_f_rvec2_intent = 0; + double *f_rvec3 = NULL; + npy_intp f_rvec3_Dims[2] = {-1, -1}; + const int f_rvec3_Rank = 2; + PyArrayObject *capi_f_rvec3_as_array = NULL; + int capi_f_rvec3_intent = 0; + int itrip = 0; + int ntrip = 0; + PyObject *ntrip_capi = Py_None; + int natom = 0; + PyObject *natom_capi = Py_None; + int n_r = 0; + PyObject *n_r_capi = Py_None; + static char *capi_kwlist[] = {"tensor","rvec2","rvec3","tot_trip","ntrip","natom","n_r",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|O:thirdorder.third_order_cond_centering.distribute_fc3",\ + capi_kwlist,&tensor_capi,&rvec2_capi,&rvec3_capi,&tot_trip_capi,&ntrip_capi,&natom_capi,&n_r_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ntrip */ + f2py_success = int_from_pyobj(&ntrip,ntrip_capi,"thirdorder.third_order_cond_centering.distribute_fc3() 5th argument (ntrip) can't be converted to int"); + if (f2py_success) { + /* Processing variable natom */ + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.distribute_fc3() 6th argument (natom) can't be converted to int"); + if (f2py_success) { + /* Processing variable itrip */ + /* Processing variable tensor */ + tensor_Dims[0]=natom * natom * natom,tensor_Dims[2]=3,tensor_Dims[3]=3,tensor_Dims[4]=3; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + CHECKARRAY(shape(tensor, 0) == natom * natom * natom,"shape(tensor, 0) == natom * natom * natom","1st argument tensor") { + /* Processing variable tot_trip */ + tot_trip_Dims[0]=natom * natom * natom; + capi_tot_trip_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 4th argument `tot_trip`"; + capi_tot_trip_as_array = ndarray_from_pyobj( NPY_INT,1,tot_trip_Dims,tot_trip_Rank, capi_tot_trip_intent,tot_trip_capi,capi_errmess); + if (capi_tot_trip_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tot_trip = (int *)(PyArray_DATA(capi_tot_trip_as_array)); + + CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom,"shape(tot_trip, 0) == natom * natom * natom","4th argument tot_trip") { + /* Processing variable f_tensor */ + f_tensor_Dims[0]=ntrip,f_tensor_Dims[1]=3 * natom,f_tensor_Dims[2]=3 * natom,f_tensor_Dims[3]=3 * natom; + capi_f_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the hidden `f_tensor`"; + capi_f_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_tensor_Dims,f_tensor_Rank, capi_f_tensor_intent,Py_None,capi_errmess); + if (capi_f_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f_tensor = (double *)(PyArray_DATA(capi_f_tensor_as_array)); + + /* Processing variable f_rvec2 */ + f_rvec2_Dims[0]=ntrip,f_rvec2_Dims[1]=3; + capi_f_rvec2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the hidden `f_rvec2`"; + capi_f_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_rvec2_Dims,f_rvec2_Rank, capi_f_rvec2_intent,Py_None,capi_errmess); + if (capi_f_rvec2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f_rvec2 = (double *)(PyArray_DATA(capi_f_rvec2_as_array)); + + /* Processing variable f_rvec3 */ + f_rvec3_Dims[0]=ntrip,f_rvec3_Dims[1]=3; + capi_f_rvec3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the hidden `f_rvec3`"; + capi_f_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_rvec3_Dims,f_rvec3_Rank, capi_f_rvec3_intent,Py_None,capi_errmess); + if (capi_f_rvec3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f_rvec3 = (double *)(PyArray_DATA(capi_f_rvec3_as_array)); + + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 1) / 81; else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.distribute_fc3() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 81 * n_r,"shape(tensor, 1) == 81 * n_r","1st keyword n_r","distribute_fc3:n_r=%d",n_r) { + /* Processing variable rvec2 */ + rvec2_Dims[0]=natom * natom * natom,rvec2_Dims[1]=81 * n_r,rvec2_Dims[2]=3; + capi_rvec2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 2nd argument `rvec2`"; + capi_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec2_Dims,rvec2_Rank, capi_rvec2_intent,rvec2_capi,capi_errmess); + if (capi_rvec2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rvec2 = (double *)(PyArray_DATA(capi_rvec2_as_array)); + + CHECKARRAY(shape(rvec2, 0) == natom * natom * natom,"shape(rvec2, 0) == natom * natom * natom","2nd argument rvec2") { + /* Processing variable rvec3 */ + rvec3_Dims[0]=natom * natom * natom,rvec3_Dims[1]=81 * n_r,rvec3_Dims[2]=3; + capi_rvec3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 3rd argument `rvec3`"; + capi_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec3_Dims,rvec3_Rank, capi_rvec3_intent,rvec3_capi,capi_errmess); + if (capi_rvec3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rvec3 = (double *)(PyArray_DATA(capi_rvec3_as_array)); + + CHECKARRAY(shape(rvec3, 0) == natom * natom * natom,"shape(rvec3, 0) == natom * natom * natom","3rd argument rvec3") { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,rvec2,rvec3,tot_trip,f_tensor,f_rvec2,f_rvec3,&itrip,&ntrip,&natom,&n_r); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNNi",capi_f_tensor_as_array,capi_f_rvec2_as_array,capi_f_rvec3_as_array,itrip); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKARRAY(shape(rvec3, 0) == natom * natom * natom)*/ + if((PyObject *)capi_rvec3_as_array!=rvec3_capi) { + Py_XDECREF(capi_rvec3_as_array); } + } /* if (capi_rvec3_as_array == NULL) ... else of rvec3 */ + /* End of cleaning variable rvec3 */ + } /*CHECKARRAY(shape(rvec2, 0) == natom * natom * natom)*/ + if((PyObject *)capi_rvec2_as_array!=rvec2_capi) { + Py_XDECREF(capi_rvec2_as_array); } + } /* if (capi_rvec2_as_array == NULL) ... else of rvec2 */ + /* End of cleaning variable rvec2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 81 * n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + } /* if (capi_f_rvec3_as_array == NULL) ... else of f_rvec3 */ + /* End of cleaning variable f_rvec3 */ + } /* if (capi_f_rvec2_as_array == NULL) ... else of f_rvec2 */ + /* End of cleaning variable f_rvec2 */ + } /* if (capi_f_tensor_as_array == NULL) ... else of f_tensor */ + /* End of cleaning variable f_tensor */ + } /*CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom)*/ + if((PyObject *)capi_tot_trip_as_array!=tot_trip_capi) { + Py_XDECREF(capi_tot_trip_as_array); } + } /* if (capi_tot_trip_as_array == NULL) ... else of tot_trip */ + /* End of cleaning variable tot_trip */ + } /*CHECKARRAY(shape(tensor, 0) == natom * natom * natom)*/ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ + /* End of cleaning variable itrip */ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ + } /*if (f2py_success) of ntrip*/ + /* End of cleaning variable ntrip */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of distribute_fc3 ***************************/ + +/********************************* apply_asr *********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_apply_asr[] = "\ +new_tensor = apply_asr(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``apply_asr``.\ +\n\nParameters\n----------\n" +"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" +"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" +"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(tensor, 0)\n" +"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" +"\nReturns\n-------\n" +"new_tensor : rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_apply_asr(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *tensor = NULL; + npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; + const int tensor_Rank = 4; + PyArrayObject *capi_tensor_as_array = NULL; + int capi_tensor_intent = 0; + PyObject *tensor_capi = Py_None; + double *r_vector2 = NULL; + npy_intp r_vector2_Dims[2] = {-1, -1}; + const int r_vector2_Rank = 2; + PyArrayObject *capi_r_vector2_as_array = NULL; + int capi_r_vector2_intent = 0; + PyObject *r_vector2_capi = Py_None; + double *r_vector3 = NULL; + npy_intp r_vector3_Dims[2] = {-1, -1}; + const int r_vector3_Rank = 2; + PyArrayObject *capi_r_vector3_as_array = NULL; + int capi_r_vector3_intent = 0; + PyObject *r_vector3_capi = Py_None; + double *new_tensor = NULL; + npy_intp new_tensor_Dims[4] = {-1, -1, -1, -1}; + const int new_tensor_Rank = 4; + PyArrayObject *capi_new_tensor_as_array = NULL; + int capi_new_tensor_intent = 0; + int n_r = 0; + PyObject *n_r_capi = Py_None; + int natom = 0; + PyObject *natom_capi = Py_None; + static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thirdorder.third_order_cond_centering.apply_asr",\ + capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable tensor */ + ; + capi_tensor_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the 1st argument `tensor`"; + capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); + if (capi_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); + + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(tensor, 0); else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.apply_asr() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","apply_asr:n_r=%d",n_r) { + /* Processing variable natom */ + if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else + f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.apply_asr() 2nd keyword (natom) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","apply_asr:natom=%d",natom) { + /* Processing variable r_vector2 */ + r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; + capi_r_vector2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the 2nd argument `r_vector2`"; + capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); + if (capi_r_vector2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); + + /* Processing variable r_vector3 */ + r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; + capi_r_vector3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the 3rd argument `r_vector3`"; + capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); + if (capi_r_vector3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); + + /* Processing variable new_tensor */ + new_tensor_Dims[0]=n_r,new_tensor_Dims[1]=3 * natom,new_tensor_Dims[2]=3 * natom,new_tensor_Dims[3]=3 * natom; + capi_new_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the hidden `new_tensor`"; + capi_new_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_tensor_Dims,new_tensor_Rank, capi_new_tensor_intent,Py_None,capi_errmess); + if (capi_new_tensor_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + new_tensor = (double *)(PyArray_DATA(capi_new_tensor_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(tensor,r_vector2,r_vector3,new_tensor,&n_r,&natom); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_new_tensor_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_new_tensor_as_array == NULL) ... else of new_tensor */ + /* End of cleaning variable new_tensor */ + if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { + Py_XDECREF(capi_r_vector3_as_array); } + } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ + /* End of cleaning variable r_vector3 */ + if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { + Py_XDECREF(capi_r_vector2_as_array); } + } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ + /* End of cleaning variable r_vector2 */ + } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ + } /*if (f2py_success) of natom*/ + /* End of cleaning variable natom */ + } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + if((PyObject *)capi_tensor_as_array!=tensor_capi) { + Py_XDECREF(capi_tensor_as_array); } + } /* if (capi_tensor_as_array == NULL) ... else of tensor */ + /* End of cleaning variable tensor */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of apply_asr ******************************/ + +/****************************** find_unique_rvec ******************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec[] = "\ +u_rvec3,list,tot_r = find_unique_rvec(r_vec3,[n_r])\n\nWrapper for ``find_unique_rvec``.\ +\n\nParameters\n----------\n" +"r_vec3 : input rank-2 array('d') with bounds (n_r,3)\n" +"\nOther Parameters\n----------------\n" +"n_r : input int, optional\n Default: shape(r_vec3, 0)\n" +"\nReturns\n-------\n" +"u_rvec3 : rank-2 array('d') with bounds (n_r,3)\n" +"list : rank-2 array('i') with bounds (n_r,n_r)\n" +"tot_r : int"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *r_vec3 = NULL; + npy_intp r_vec3_Dims[2] = {-1, -1}; + const int r_vec3_Rank = 2; + PyArrayObject *capi_r_vec3_as_array = NULL; + int capi_r_vec3_intent = 0; + PyObject *r_vec3_capi = Py_None; + double *u_rvec3 = NULL; + npy_intp u_rvec3_Dims[2] = {-1, -1}; + const int u_rvec3_Rank = 2; + PyArrayObject *capi_u_rvec3_as_array = NULL; + int capi_u_rvec3_intent = 0; + int *list = NULL; + npy_intp list_Dims[2] = {-1, -1}; + const int list_Rank = 2; + PyArrayObject *capi_list_as_array = NULL; + int capi_list_intent = 0; + int n_r = 0; + PyObject *n_r_capi = Py_None; + int tot_r = 0; + static char *capi_kwlist[] = {"r_vec3","n_r",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:thirdorder.third_order_cond_centering.find_unique_rvec",\ + capi_kwlist,&r_vec3_capi,&n_r_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable r_vec3 */ + r_vec3_Dims[1]=3; + capi_r_vec3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_unique_rvec: failed to create array from the 1st argument `r_vec3`"; + capi_r_vec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vec3_Dims,r_vec3_Rank, capi_r_vec3_intent,r_vec3_capi,capi_errmess); + if (capi_r_vec3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r_vec3 = (double *)(PyArray_DATA(capi_r_vec3_as_array)); + + /* Processing variable tot_r */ + /* Processing variable n_r */ + if (n_r_capi == Py_None) n_r = shape(r_vec3, 0); else + f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.find_unique_rvec() 1st keyword (n_r) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(r_vec3, 0) == n_r,"shape(r_vec3, 0) == n_r","1st keyword n_r","find_unique_rvec:n_r=%d",n_r) { + /* Processing variable u_rvec3 */ + u_rvec3_Dims[0]=n_r,u_rvec3_Dims[1]=3; + capi_u_rvec3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_unique_rvec: failed to create array from the hidden `u_rvec3`"; + capi_u_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_rvec3_Dims,u_rvec3_Rank, capi_u_rvec3_intent,Py_None,capi_errmess); + if (capi_u_rvec3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u_rvec3 = (double *)(PyArray_DATA(capi_u_rvec3_as_array)); + + /* Processing variable list */ + list_Dims[0]=n_r,list_Dims[1]=n_r; + capi_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_unique_rvec: failed to create array from the hidden `list`"; + capi_list_as_array = ndarray_from_pyobj( NPY_INT,1,list_Dims,list_Rank, capi_list_intent,Py_None,capi_errmess); + if (capi_list_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + list = (int *)(PyArray_DATA(capi_list_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(r_vec3,u_rvec3,list,&n_r,&tot_r); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("NNi",capi_u_rvec3_as_array,capi_list_as_array,tot_r); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_list_as_array == NULL) ... else of list */ + /* End of cleaning variable list */ + } /* if (capi_u_rvec3_as_array == NULL) ... else of u_rvec3 */ + /* End of cleaning variable u_rvec3 */ + } /*CHECKSCALAR(shape(r_vec3, 0) == n_r)*/ + } /*if (f2py_success) of n_r*/ + /* End of cleaning variable n_r */ + /* End of cleaning variable tot_r */ + if((PyObject *)capi_r_vec3_as_array!=r_vec3_capi) { + Py_XDECREF(capi_r_vec3_as_array); } + } /* if (capi_r_vec3_as_array == NULL) ... else of r_vec3 */ + /* End of cleaning variable r_vec3 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of find_unique_rvec **************************/ + +/************************************ norm ************************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_norm[] = "\ +d = norm(r)\n\nWrapper for ``norm``.\ +\n\nParameters\n----------\n" +"r : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"d : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_norm(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double normf2pywrap = 0; + double *r = NULL; + npy_intp r_Dims[1] = {-1}; + const int r_Rank = 1; + PyArrayObject *capi_r_as_array = NULL; + int capi_r_intent = 0; + PyObject *r_capi = Py_None; + static char *capi_kwlist[] = {"r",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thirdorder.third_order_cond_centering.norm",\ + capi_kwlist,&r_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable r */ + r_Dims[0]=3; + capi_r_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.norm: failed to create array from the 1st argument `r`"; + capi_r_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_Dims,r_Rank, capi_r_intent,r_capi,capi_errmess); + if (capi_r_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r = (double *)(PyArray_DATA(capi_r_as_array)); + + /* Processing variable normf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&normf2pywrap,r); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",normf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable normf2pywrap */ + if((PyObject *)capi_r_as_array!=r_capi) { + Py_XDECREF(capi_r_as_array); } + } /* if (capi_r_as_array == NULL) ... else of r */ + /* End of cleaning variable r */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of norm ********************************/ + +/*********************************** norma2 ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_norma2[] = "\ +d = norma2(m)\n\nWrapper for ``norma2``.\ +\n\nParameters\n----------\n" +"m : input rank-2 array('d') with bounds (f2py_m_d0,f2py_m_d1)\n" +"\nReturns\n-------\n" +"d : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_norma2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double norma2f2pywrap = 0; + double *m = NULL; + npy_intp m_Dims[2] = {-1, -1}; + const int m_Rank = 2; + PyArrayObject *capi_m_as_array = NULL; + int capi_m_intent = 0; + PyObject *m_capi = Py_None; + int f2py_m_d0 = 0; + int f2py_m_d1 = 0; + static char *capi_kwlist[] = {"m",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thirdorder.third_order_cond_centering.norma2",\ + capi_kwlist,&m_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable m */ + ; + capi_m_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.norma2: failed to create array from the 1st argument `m`"; + capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); + if (capi_m_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m = (double *)(PyArray_DATA(capi_m_as_array)); + + /* Processing variable norma2f2pywrap */ + /* Processing variable f2py_m_d0 */ + f2py_m_d0 = shape(m, 0); + /* Processing variable f2py_m_d1 */ + f2py_m_d1 = shape(m, 1); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&norma2f2pywrap,m,&f2py_m_d0,&f2py_m_d1); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",norma2f2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_m_d1 */ + /* End of cleaning variable f2py_m_d0 */ + /* End of cleaning variable norma2f2pywrap */ + if((PyObject *)capi_m_as_array!=m_capi) { + Py_XDECREF(capi_m_as_array); } + } /* if (capi_m_as_array == NULL) ... else of m */ + /* End of cleaning variable m */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of norma2 *******************************/ + +/*********************************** norma3 ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_norma3[] = "\ +d = norma3(m)\n\nWrapper for ``norma3``.\ +\n\nParameters\n----------\n" +"m : input rank-3 array('d') with bounds (f2py_m_d0,f2py_m_d1,f2py_m_d2)\n" +"\nReturns\n-------\n" +"d : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_norma3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double norma3f2pywrap = 0; + double *m = NULL; + npy_intp m_Dims[3] = {-1, -1, -1}; + const int m_Rank = 3; + PyArrayObject *capi_m_as_array = NULL; + int capi_m_intent = 0; + PyObject *m_capi = Py_None; + int f2py_m_d0 = 0; + int f2py_m_d1 = 0; + int f2py_m_d2 = 0; + static char *capi_kwlist[] = {"m",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thirdorder.third_order_cond_centering.norma3",\ + capi_kwlist,&m_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable m */ + ; + capi_m_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.norma3: failed to create array from the 1st argument `m`"; + capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); + if (capi_m_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m = (double *)(PyArray_DATA(capi_m_as_array)); + + /* Processing variable norma3f2pywrap */ + /* Processing variable f2py_m_d0 */ + f2py_m_d0 = shape(m, 0); + /* Processing variable f2py_m_d1 */ + f2py_m_d1 = shape(m, 1); + /* Processing variable f2py_m_d2 */ + f2py_m_d2 = shape(m, 2); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&norma3f2pywrap,m,&f2py_m_d0,&f2py_m_d1,&f2py_m_d2); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",norma3f2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_m_d2 */ + /* End of cleaning variable f2py_m_d1 */ + /* End of cleaning variable f2py_m_d0 */ + /* End of cleaning variable norma3f2pywrap */ + if((PyObject *)capi_m_as_array!=m_capi) { + Py_XDECREF(capi_m_as_array); } + } /* if (capi_m_as_array == NULL) ... else of m */ + /* End of cleaning variable m */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of norma3 *******************************/ + +/************************************ dot ************************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_centering_dot[] = "\ +v1 = dot(v,m)\n\nWrapper for ``dot``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('d') with bounds (3)\n" +"m : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"v1 : rank-1 array('d') with bounds (3) and dotf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_centering_dot(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *dotf2pywrap = NULL; + npy_intp dotf2pywrap_Dims[1] = {-1}; + const int dotf2pywrap_Rank = 1; + PyArrayObject *capi_dotf2pywrap_as_array = NULL; + int capi_dotf2pywrap_intent = 0; + double *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + double *m = NULL; + npy_intp m_Dims[2] = {-1, -1}; + const int m_Rank = 2; + PyArrayObject *capi_m_as_array = NULL; + int capi_m_intent = 0; + PyObject *m_capi = Py_None; + static char *capi_kwlist[] = {"v","m",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_cond_centering.dot",\ + capi_kwlist,&v_capi,&m_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + v_Dims[0]=3; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.dot: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (double *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable m */ + m_Dims[0]=3,m_Dims[1]=3; + capi_m_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.dot: failed to create array from the 2nd argument `m`"; + capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); + if (capi_m_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + m = (double *)(PyArray_DATA(capi_m_as_array)); + + /* Processing variable dotf2pywrap */ + dotf2pywrap_Dims[0]=3; + capi_dotf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.dot: failed to create array from the hidden `dotf2pywrap`"; + capi_dotf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dotf2pywrap_Dims,dotf2pywrap_Rank, capi_dotf2pywrap_intent,Py_None,capi_errmess); + if (capi_dotf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dotf2pywrap = (double *)(PyArray_DATA(capi_dotf2pywrap_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(dotf2pywrap,v,m); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_dotf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_dotf2pywrap_as_array == NULL) ... else of dotf2pywrap */ + /* End of cleaning variable dotf2pywrap */ + if((PyObject *)capi_m_as_array!=m_capi) { + Py_XDECREF(capi_m_as_array); } + } /* if (capi_m_as_array == NULL) ... else of m */ + /* End of cleaning variable m */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************************* end of dot *********************************/ + +/******************************** interpol_v2 ********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_interpol_v2[] = "\ +fc_interp = interpol_v2(fc,r2,r3,pos,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v2``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" +"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"q2 : input rank-1 array('d') with bounds (3)\n" +"q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(fc, 0)\n" +"nat : input int, optional\n Default: shape(fc, 1) / 3\n" +"\nReturns\n-------\n" +"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_interpol_v2(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + PyObject *r3_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *q2 = NULL; + npy_intp q2_Dims[1] = {-1}; + const int q2_Rank = 1; + PyArrayObject *capi_q2_as_array = NULL; + int capi_q2_intent = 0; + PyObject *q2_capi = Py_None; + double *q3 = NULL; + npy_intp q3_Dims[1] = {-1}; + const int q3_Rank = 1; + PyArrayObject *capi_q3_as_array = NULL; + int capi_q3_intent = 0; + PyObject *q3_capi = Py_None; + complex_double *fc_interp = NULL; + npy_intp fc_interp_Dims[3] = {-1, -1, -1}; + const int fc_interp_Rank = 3; + PyArrayObject *capi_fc_interp_as_array = NULL; + int capi_fc_interp_intent = 0; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"fc","r2","r3","pos","q2","q3","n_blocks","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thirdorder.third_order_cond.interpol_v2",\ + capi_kwlist,&fc_capi,&r2_capi,&r3_capi,&pos_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable q2 */ + q2_Dims[0]=3; + capi_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 5th argument `q2`"; + capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); + if (capi_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q2 = (double *)(PyArray_DATA(capi_q2_as_array)); + + /* Processing variable q3 */ + q3_Dims[0]=3; + capi_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 6th argument `q3`"; + capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); + if (capi_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q3 = (double *)(PyArray_DATA(capi_q3_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.interpol_v2() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v2:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_cond.interpol_v2() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v2:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 2nd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_blocks; + capi_r3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 3rd argument `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 4th argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable fc_interp */ + fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; + capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the hidden `fc_interp`"; + capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); + if (capi_fc_interp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r2,r3,pos,q2,q3,fc_interp,&n_blocks,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ + /* End of cleaning variable fc_interp */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r3_as_array!=r3_capi) { + Py_XDECREF(capi_r3_as_array); } + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_q3_as_array!=q3_capi) { + Py_XDECREF(capi_q3_as_array); } + } /* if (capi_q3_as_array == NULL) ... else of q3 */ + /* End of cleaning variable q3 */ + if((PyObject *)capi_q2_as_array!=q2_capi) { + Py_XDECREF(capi_q2_as_array); } + } /* if (capi_q2_as_array == NULL) ... else of q2 */ + /* End of cleaning variable q2 */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of interpol_v2 *****************************/ + +/******************************** interpol_v3 ********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_interpol_v3[] = "\ +fc_interp = interpol_v3(fc,pos,r2,r3,q1,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v3``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" +"pos : input rank-2 array('d') with bounds (3,nat)\n" +"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"q1 : input rank-1 array('d') with bounds (3)\n" +"q2 : input rank-1 array('d') with bounds (3)\n" +"q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(fc, 0)\n" +"nat : input int, optional\n Default: shape(fc, 1) / 3\n" +"\nReturns\n-------\n" +"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_interpol_v3(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + double *pos = NULL; + npy_intp pos_Dims[2] = {-1, -1}; + const int pos_Rank = 2; + PyArrayObject *capi_pos_as_array = NULL; + int capi_pos_intent = 0; + PyObject *pos_capi = Py_None; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + PyObject *r3_capi = Py_None; + double *q1 = NULL; + npy_intp q1_Dims[1] = {-1}; + const int q1_Rank = 1; + PyArrayObject *capi_q1_as_array = NULL; + int capi_q1_intent = 0; + PyObject *q1_capi = Py_None; + double *q2 = NULL; + npy_intp q2_Dims[1] = {-1}; + const int q2_Rank = 1; + PyArrayObject *capi_q2_as_array = NULL; + int capi_q2_intent = 0; + PyObject *q2_capi = Py_None; + double *q3 = NULL; + npy_intp q3_Dims[1] = {-1}; + const int q3_Rank = 1; + PyArrayObject *capi_q3_as_array = NULL; + int capi_q3_intent = 0; + PyObject *q3_capi = Py_None; + complex_double *fc_interp = NULL; + npy_intp fc_interp_Dims[3] = {-1, -1, -1}; + const int fc_interp_Rank = 3; + PyArrayObject *capi_fc_interp_as_array = NULL; + int capi_fc_interp_intent = 0; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"fc","pos","r2","r3","q1","q2","q3","n_blocks","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|OO:thirdorder.third_order_cond.interpol_v3",\ + capi_kwlist,&fc_capi,&pos_capi,&r2_capi,&r3_capi,&q1_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable q2 */ + q2_Dims[0]=3; + capi_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 6th argument `q2`"; + capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); + if (capi_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q2 = (double *)(PyArray_DATA(capi_q2_as_array)); + + /* Processing variable q3 */ + q3_Dims[0]=3; + capi_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 7th argument `q3`"; + capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); + if (capi_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q3 = (double *)(PyArray_DATA(capi_q3_as_array)); + + /* Processing variable q1 */ + q1_Dims[0]=3; + capi_q1_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 5th argument `q1`"; + capi_q1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q1_Dims,q1_Rank, capi_q1_intent,q1_capi,capi_errmess); + if (capi_q1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q1 = (double *)(PyArray_DATA(capi_q1_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.interpol_v3() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v3:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_cond.interpol_v3() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v3:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 3rd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_blocks; + capi_r3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 4th argument `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + + /* Processing variable pos */ + pos_Dims[0]=3,pos_Dims[1]=nat; + capi_pos_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 2nd argument `pos`"; + capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); + if (capi_pos_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pos = (double *)(PyArray_DATA(capi_pos_as_array)); + + /* Processing variable fc_interp */ + fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; + capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the hidden `fc_interp`"; + capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); + if (capi_fc_interp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,pos,r2,r3,q1,q2,q3,fc_interp,&n_blocks,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ + /* End of cleaning variable fc_interp */ + if((PyObject *)capi_pos_as_array!=pos_capi) { + Py_XDECREF(capi_pos_as_array); } + } /* if (capi_pos_as_array == NULL) ... else of pos */ + /* End of cleaning variable pos */ + if((PyObject *)capi_r3_as_array!=r3_capi) { + Py_XDECREF(capi_r3_as_array); } + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_q1_as_array!=q1_capi) { + Py_XDECREF(capi_q1_as_array); } + } /* if (capi_q1_as_array == NULL) ... else of q1 */ + /* End of cleaning variable q1 */ + if((PyObject *)capi_q3_as_array!=q3_capi) { + Py_XDECREF(capi_q3_as_array); } + } /* if (capi_q3_as_array == NULL) ... else of q3 */ + /* End of cleaning variable q3 */ + if((PyObject *)capi_q2_as_array!=q2_capi) { + Py_XDECREF(capi_q2_as_array); } + } /* if (capi_q2_as_array == NULL) ... else of q2 */ + /* End of cleaning variable q2 */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of interpol_v3 *****************************/ + +/********************* compute_full_dynamic_bubble_single *********************/ +static char doc_f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single[] = "\ +bubble = compute_full_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_full_dynamic_bubble_single``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (n_mod)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"n_mod : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-3 array('D') with bounds (ne,n_mod,n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[3] = {-1, -1, -1}; + const int bubble_Rank = 3; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:thirdorder.third_order_cond.compute_full_dynamic_bubble_single",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.compute_full_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.compute_full_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_full_dynamic_bubble_single:ne=%d",ne) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.compute_full_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_full_dynamic_bubble_single:n_mod=%d",n_mod) { + /* Processing variable bubble */ + bubble_Dims[0]=ne,bubble_Dims[1]=n_mod,bubble_Dims[2]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=n_mod,freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************** end of compute_full_dynamic_bubble_single *****************/ + +/********************* compute_diag_dynamic_bubble_single *********************/ +static char doc_f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single[] = "\ +bubble = compute_diag_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_diag_dynamic_bubble_single``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (n_mod)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"n_mod : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-2 array('D') with bounds (ne,n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[2] = {-1, -1}; + const int bubble_Rank = 2; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OO:thirdorder.third_order_cond.compute_diag_dynamic_bubble_single",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.compute_diag_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.compute_diag_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_diag_dynamic_bubble_single:n_mod=%d",n_mod) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.compute_diag_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_diag_dynamic_bubble_single:ne=%d",ne) { + /* Processing variable bubble */ + bubble_Dims[0]=ne,bubble_Dims[1]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=n_mod,freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************** end of compute_diag_dynamic_bubble_single *****************/ + +/*********************** compute_perturb_selfnrg_single ***********************/ +static char doc_f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single[] = "\ +selfnrg = compute_perturb_selfnrg_single(sigma,t,freq,is_gamma,d3,gaussian,classical,[n_mod])\n\nWrapper for ``compute_perturb_selfnrg_single``.\ +\n\nParameters\n----------\n" +"sigma : input rank-1 array('d') with bounds (n_mod)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"gaussian : input int\n" +"classical : input int\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"selfnrg : rank-1 array('D') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,int*,complex_double*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + int classical = 0; + PyObject *classical_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[1] = {-1}; + const int selfnrg_Rank = 1; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + static char *capi_kwlist[] = {"sigma","t","freq","is_gamma","d3","gaussian","classical","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:thirdorder.third_order_cond.compute_perturb_selfnrg_single",\ + capi_kwlist,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 1st argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.compute_perturb_selfnrg_single() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 4th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable classical */ + classical = (int)PyObject_IsTrue(classical_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.compute_perturb_selfnrg_single() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","1st keyword n_mod","compute_perturb_selfnrg_single:n_mod=%d",n_mod) { + /* Processing variable selfnrg */ + selfnrg_Dims[0]=n_mod; + capi_selfnrg_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the hidden `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,Py_None,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable freq */ + freq_Dims[0]=n_mod,freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 3rd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 5th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(sigma,&t,freq,is_gamma,d3,&n_mod,&gaussian,&classical,selfnrg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_selfnrg_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*if (f2py_success) of classical*/ + /* End of cleaning variable classical */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************* end of compute_perturb_selfnrg_single *******************/ + +/*********************** compute_spectralf_diag_single ***********************/ +static char doc_f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single[] = "\ +spectralf = compute_spectralf_diag_single(sigma,ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``compute_spectralf_diag_single``.\ +\n\nParameters\n----------\n" +"sigma : input rank-1 array('d') with bounds (3 * nat)\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" +"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(sigma, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,complex_double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *d2_freq = NULL; + npy_intp d2_freq_Dims[1] = {-1}; + const int d2_freq_Rank = 1; + PyArrayObject *capi_d2_freq_as_array = NULL; + int capi_d2_freq_intent = 0; + PyObject *d2_freq_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[2] = {-1, -1}; + const int selfnrg_Rank = 2; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + PyObject *selfnrg_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *spectralf = NULL; + npy_intp spectralf_Dims[2] = {-1, -1}; + const int spectralf_Rank = 2; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + static char *capi_kwlist[] = {"sigma","ener","d2_freq","selfnrg","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|OO:thirdorder.third_order_cond.compute_spectralf_diag_single",\ + capi_kwlist,&sigma_capi,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 2nd argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 1st argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.compute_spectralf_diag_single() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf_diag_single:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(sigma, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.compute_spectralf_diag_single() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == 3 * nat,"shape(sigma, 0) == 3 * nat","1st keyword nat","compute_spectralf_diag_single:nat=%d",nat) { + /* Processing variable d2_freq */ + d2_freq_Dims[0]=3 * nat; + capi_d2_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 3rd argument `d2_freq`"; + capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); + if (capi_d2_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); + + /* Processing variable selfnrg */ + selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; + capi_selfnrg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 4th argument `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(sigma,ener,d2_freq,selfnrg,&nat,&ne,spectralf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { + Py_XDECREF(capi_selfnrg_as_array); } + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { + Py_XDECREF(capi_d2_freq_as_array); } + } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ + /* End of cleaning variable d2_freq */ + } /*CHECKSCALAR(shape(sigma, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of compute_spectralf_diag_single ********************/ + +/*************************** lambda_dynamic_single ***************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single[] = "\ +lambda_out = lambda_dynamic_single(energies,sigma,t,static_limit,w_q2,w_q3,gaussian,[ne])\n\nWrapper for ``lambda_dynamic_single``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input float\n" +"t : input float\n" +"static_limit : input int\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"gaussian : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"\nReturns\n-------\n" +"lambda_out : rank-1 array('D') with bounds (ne)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,int*,double*,double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double sigma = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int static_limit = 0; + PyObject *static_limit_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + complex_double *lambda_out = NULL; + npy_intp lambda_out_Dims[1] = {-1}; + const int lambda_out_Rank = 1; + PyArrayObject *capi_lambda_out_as_array = NULL; + int capi_lambda_out_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","static_limit","w_q2","w_q3","gaussian","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|O:thirdorder.third_order_cond.lambda_dynamic_single",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&static_limit_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable static_limit */ + static_limit = (int)PyObject_IsTrue(static_limit_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + f2py_success = double_from_pyobj(&sigma,sigma_capi,"thirdorder.third_order_cond.lambda_dynamic_single() 2nd argument (sigma) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.lambda_dynamic_single() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the 5th argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the 6th argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.lambda_dynamic_single() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","lambda_dynamic_single:ne=%d",ne) { + /* Processing variable lambda_out */ + lambda_out_Dims[0]=ne; + capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the hidden `lambda_out`"; + capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); + if (capi_lambda_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,energies,&sigma,&t,&static_limit,w_q2,w_q3,&gaussian,lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ + /* End of cleaning variable lambda_out */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of sigma*/ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of static_limit*/ + /* End of cleaning variable static_limit */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of lambda_dynamic_single ************************/ + +/************************ lambda_dynamic_value_single ************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single[] = "\ +lambda_out = lambda_dynamic_value_single(n_mod,value,sigma,t,w_q2,w_q3,gaussian)\n\nWrapper for ``lambda_dynamic_value_single``.\ +\n\nParameters\n----------\n" +"n_mod : input int\n" +"value : input float\n" +"sigma : input float\n" +"t : input float\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"gaussian : input int\n" +"\nReturns\n-------\n" +"lambda_out : complex"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,double*,double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double value = 0; + PyObject *value_capi = Py_None; + double sigma = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + int gaussian = 0; + PyObject *gaussian_capi = Py_None; + complex_double lambda_out; + PyObject *lambda_out_capi = Py_None; + static char *capi_kwlist[] = {"n_mod","value","sigma","t","w_q2","w_q3","gaussian",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOO|:thirdorder.third_order_cond.lambda_dynamic_value_single",\ + capi_kwlist,&n_mod_capi,&value_capi,&sigma_capi,&t_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable lambda_out */ + /* Processing variable n_mod */ + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 1st argument (n_mod) can't be converted to int"); + if (f2py_success) { + /* Processing variable gaussian */ + gaussian = (int)PyObject_IsTrue(gaussian_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable sigma */ + f2py_success = double_from_pyobj(&sigma,sigma_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 3rd argument (sigma) can't be converted to double"); + if (f2py_success) { + /* Processing variable value */ + f2py_success = double_from_pyobj(&value,value_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 2nd argument (value) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 4th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_value_single: failed to create array from the 5th argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_value_single: failed to create array from the 6th argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&n_mod,&value,&sigma,&t,w_q2,w_q3,&gaussian,&lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ + lambda_out_capi = pyobj_from_complex_double1(lambda_out); +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",lambda_out_capi); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of value*/ + /* End of cleaning variable value */ + } /*if (f2py_success) of sigma*/ + /* End of cleaning variable sigma */ + } /*if (f2py_success) of gaussian*/ + /* End of cleaning variable gaussian */ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + /* End of cleaning variable lambda_out */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of lambda_dynamic_value_single *********************/ + +/************************ calculate_spectral_function ************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function[] = "\ +spectralf = calculate_spectral_function(ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``calculate_spectral_function``.\ +\n\nParameters\n----------\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" +"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(d2_freq, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_calculate_spectral_function(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *d2_freq = NULL; + npy_intp d2_freq_Dims[1] = {-1}; + const int d2_freq_Rank = 1; + PyArrayObject *capi_d2_freq_as_array = NULL; + int capi_d2_freq_intent = 0; + PyObject *d2_freq_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[2] = {-1, -1}; + const int selfnrg_Rank = 2; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + PyObject *selfnrg_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + double *spectralf = NULL; + npy_intp spectralf_Dims[2] = {-1, -1}; + const int spectralf_Rank = 2; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + static char *capi_kwlist[] = {"ener","d2_freq","selfnrg","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:thirdorder.third_order_cond.calculate_spectral_function",\ + capi_kwlist,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the 1st argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable d2_freq */ + ; + capi_d2_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the 2nd argument `d2_freq`"; + capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); + if (capi_d2_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.calculate_spectral_function() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(d2_freq, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.calculate_spectral_function() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(d2_freq, 0) == 3 * nat,"shape(d2_freq, 0) == 3 * nat","1st keyword nat","calculate_spectral_function:nat=%d",nat) { + /* Processing variable selfnrg */ + selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; + capi_selfnrg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the 3rd argument `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ener,d2_freq,selfnrg,&nat,&ne,spectralf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { + Py_XDECREF(capi_selfnrg_as_array); } + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + } /*CHECKSCALAR(shape(d2_freq, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { + Py_XDECREF(capi_d2_freq_as_array); } + } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ + /* End of cleaning variable d2_freq */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of calculate_spectral_function *********************/ + +/****************** calculate_spectral_function_mode_mixing ******************/ +static char doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing[] = "\ +spectralf = calculate_spectral_function_mode_mixing(ener,smear,wq,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_mode_mixing``.\ +\n\nParameters\n----------\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"wq : input rank-1 array('d') with bounds (3 * nat)\n" +"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" +"notransl : input int\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(smear, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,complex_double*,int*,complex_double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + double *wq = NULL; + npy_intp wq_Dims[1] = {-1}; + const int wq_Rank = 1; + PyArrayObject *capi_wq_as_array = NULL; + int capi_wq_intent = 0; + PyObject *wq_capi = Py_None; + complex_double *pi = NULL; + npy_intp pi_Dims[3] = {-1, -1, -1}; + const int pi_Rank = 3; + PyArrayObject *capi_pi_as_array = NULL; + int capi_pi_intent = 0; + PyObject *pi_capi = Py_None; + int notransl = 0; + PyObject *notransl_capi = Py_None; + complex_double *spectralf = NULL; + npy_intp spectralf_Dims[3] = {-1, -1, -1}; + const int spectralf_Rank = 3; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + static char *capi_kwlist[] = {"ener","smear","wq","pi","notransl","mass","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thirdorder.third_order_cond.calculate_spectral_function_mode_mixing",\ + capi_kwlist,&ener_capi,&smear_capi,&wq_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 1st argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable smear */ + ; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 2nd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable notransl */ + notransl = (int)PyObject_IsTrue(notransl_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.calculate_spectral_function_mode_mixing() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_mode_mixing:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.calculate_spectral_function_mode_mixing() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_mode_mixing:nat=%d",nat) { + /* Processing variable wq */ + wq_Dims[0]=3 * nat; + capi_wq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 3rd argument `wq`"; + capi_wq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,wq_Dims,wq_Rank, capi_wq_intent,wq_capi,capi_errmess); + if (capi_wq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + wq = (double *)(PyArray_DATA(capi_wq_as_array)); + + /* Processing variable pi */ + pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; + capi_pi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 4th argument `pi`"; + capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); + if (capi_pi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); + + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 6th argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ener,smear,wq,pi,¬ransl,spectralf,mass,&nat,&ne); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_pi_as_array!=pi_capi) { + Py_XDECREF(capi_pi_as_array); } + } /* if (capi_pi_as_array == NULL) ... else of pi */ + /* End of cleaning variable pi */ + if((PyObject *)capi_wq_as_array!=wq_capi) { + Py_XDECREF(capi_wq_as_array); } + } /* if (capi_wq_as_array == NULL) ... else of wq */ + /* End of cleaning variable wq */ + } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of notransl*/ + /* End of cleaning variable notransl */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************** end of calculate_spectral_function_mode_mixing ***************/ + +/******************* calculate_spectral_function_cartesian *******************/ +static char doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian[] = "\ +spectralf = calculate_spectral_function_cartesian(ener,smear,d2,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_cartesian``.\ +\n\nParameters\n----------\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"smear : input rank-1 array('d') with bounds (3 * nat)\n" +"d2 : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" +"notransl : input int\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(smear, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,complex_double*,int*,complex_double*,double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *smear = NULL; + npy_intp smear_Dims[1] = {-1}; + const int smear_Rank = 1; + PyArrayObject *capi_smear_as_array = NULL; + int capi_smear_intent = 0; + PyObject *smear_capi = Py_None; + complex_double *d2 = NULL; + npy_intp d2_Dims[2] = {-1, -1}; + const int d2_Rank = 2; + PyArrayObject *capi_d2_as_array = NULL; + int capi_d2_intent = 0; + PyObject *d2_capi = Py_None; + complex_double *pi = NULL; + npy_intp pi_Dims[3] = {-1, -1, -1}; + const int pi_Rank = 3; + PyArrayObject *capi_pi_as_array = NULL; + int capi_pi_intent = 0; + PyObject *pi_capi = Py_None; + int notransl = 0; + PyObject *notransl_capi = Py_None; + complex_double *spectralf = NULL; + npy_intp spectralf_Dims[3] = {-1, -1, -1}; + const int spectralf_Rank = 3; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + static char *capi_kwlist[] = {"ener","smear","d2","pi","notransl","mass","nat","ne",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thirdorder.third_order_cond.calculate_spectral_function_cartesian",\ + capi_kwlist,&ener_capi,&smear_capi,&d2_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 1st argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable smear */ + ; + capi_smear_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 2nd argument `smear`"; + capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); + if (capi_smear_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear = (double *)(PyArray_DATA(capi_smear_as_array)); + + /* Processing variable notransl */ + notransl = (int)PyObject_IsTrue(notransl_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.calculate_spectral_function_cartesian() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_cartesian:ne=%d",ne) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.calculate_spectral_function_cartesian() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_cartesian:nat=%d",nat) { + /* Processing variable d2 */ + d2_Dims[0]=3 * nat,d2_Dims[1]=3 * nat; + capi_d2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 3rd argument `d2`"; + capi_d2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d2_Dims,d2_Rank, capi_d2_intent,d2_capi,capi_errmess); + if (capi_d2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2 = (complex_double *)(PyArray_DATA(capi_d2_as_array)); + + /* Processing variable pi */ + pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; + capi_pi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 4th argument `pi`"; + capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); + if (capi_pi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); + + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 6th argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ener,smear,d2,pi,¬ransl,spectralf,mass,&nat,&ne); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_pi_as_array!=pi_capi) { + Py_XDECREF(capi_pi_as_array); } + } /* if (capi_pi_as_array == NULL) ... else of pi */ + /* End of cleaning variable pi */ + if((PyObject *)capi_d2_as_array!=d2_capi) { + Py_XDECREF(capi_d2_as_array); } + } /* if (capi_d2_as_array == NULL) ... else of d2 */ + /* End of cleaning variable d2 */ + } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of notransl*/ + /* End of cleaning variable notransl */ + if((PyObject *)capi_smear_as_array!=smear_capi) { + Py_XDECREF(capi_smear_as_array); } + } /* if (capi_smear_as_array == NULL) ... else of smear */ + /* End of cleaning variable smear */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************** end of calculate_spectral_function_cartesian ****************/ + +/********************************* bose_freq *********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_bose_freq[] = "\ +bose = bose_freq(t,freq,[n_mod])\n\nWrapper for ``bose_freq``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"freq : input rank-1 array('d') with bounds (n_mod)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bose : rank-1 array('d') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_bose_freq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + double *bose = NULL; + npy_intp bose_Dims[1] = {-1}; + const int bose_Rank = 1; + PyArrayObject *capi_bose_as_array = NULL; + int capi_bose_intent = 0; + static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thirdorder.third_order_cond.bose_freq",\ + capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.bose_freq() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + ; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.bose_freq: failed to create array from the 2nd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.bose_freq() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","bose_freq:n_mod=%d",n_mod) { + /* Processing variable bose */ + bose_Dims[0]=n_mod; + capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.bose_freq: failed to create array from the hidden `bose`"; + capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); + if (capi_bose_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bose = (double *)(PyArray_DATA(capi_bose_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,&n_mod,freq,bose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_bose_as_array == NULL) ... else of bose */ + /* End of cleaning variable bose */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of bose_freq ******************************/ + +/********************************** eq_freq **********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_eq_freq[] = "\ +bose = eq_freq(t,freq,[n_mod])\n\nWrapper for ``eq_freq``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"freq : input rank-1 array('d') with bounds (n_mod)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bose : rank-1 array('d') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_eq_freq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + double *bose = NULL; + npy_intp bose_Dims[1] = {-1}; + const int bose_Rank = 1; + PyArrayObject *capi_bose_as_array = NULL; + int capi_bose_intent = 0; + static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thirdorder.third_order_cond.eq_freq",\ + capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.eq_freq() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + ; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eq_freq: failed to create array from the 2nd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.eq_freq() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","eq_freq:n_mod=%d",n_mod) { + /* Processing variable bose */ + bose_Dims[0]=n_mod; + capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eq_freq: failed to create array from the hidden `bose`"; + capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); + if (capi_bose_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bose = (double *)(PyArray_DATA(capi_bose_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,&n_mod,freq,bose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_bose_as_array == NULL) ... else of bose */ + /* End of cleaning variable bose */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of eq_freq *******************************/ + +/*********************************** f_bose ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_f_bose[] = "\ +f_bose = f_bose(freq,t)\n\nWrapper for ``f_bose``.\ +\n\nParameters\n----------\n" +"freq : input float\n" +"t : input float\n" +"\nReturns\n-------\n" +"f_bose : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_f_bose(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double f_bosef2pywrap = 0; + double freq = 0; + PyObject *freq_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + static char *capi_kwlist[] = {"freq","t",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_cond.f_bose",\ + capi_kwlist,&freq_capi,&t_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable freq */ + f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_cond.f_bose() 1st argument (freq) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.f_bose() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable f_bosef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&f_bosef2pywrap,&freq,&t); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",f_bosef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f_bosef2pywrap */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of freq*/ + /* End of cleaning variable freq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of f_bose *******************************/ + +/********************************** df_bose **********************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_df_bose[] = "\ +df_bose = df_bose(freq,t)\n\nWrapper for ``df_bose``.\ +\n\nParameters\n----------\n" +"freq : input float\n" +"t : input float\n" +"\nReturns\n-------\n" +"df_bose : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_df_bose(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double df_bosef2pywrap = 0; + double freq = 0; + PyObject *freq_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + static char *capi_kwlist[] = {"freq","t",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_cond.df_bose",\ + capi_kwlist,&freq_capi,&t_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable freq */ + f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_cond.df_bose() 1st argument (freq) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.df_bose() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable df_bosef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&df_bosef2pywrap,&freq,&t); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",df_bosef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable df_bosef2pywrap */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of freq*/ + /* End of cleaning variable freq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of df_bose *******************************/ + +/***************************** gaussian_function *****************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_gaussian_function[] = "\ +gaussian_function = gaussian_function(x,sigma)\n\nWrapper for ``gaussian_function``.\ +\n\nParameters\n----------\n" +"x : input float\n" +"sigma : input float\n" +"\nReturns\n-------\n" +"gaussian_function : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_gaussian_function(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double gaussian_functionf2pywrap = 0; + double x = 0; + PyObject *x_capi = Py_None; + double sigma = 0; + PyObject *sigma_capi = Py_None; + static char *capi_kwlist[] = {"x","sigma",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_cond.gaussian_function",\ + capi_kwlist,&x_capi,&sigma_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + f2py_success = double_from_pyobj(&x,x_capi,"thirdorder.third_order_cond.gaussian_function() 1st argument (x) can't be converted to double"); + if (f2py_success) { + /* Processing variable sigma */ + f2py_success = double_from_pyobj(&sigma,sigma_capi,"thirdorder.third_order_cond.gaussian_function() 2nd argument (sigma) can't be converted to double"); + if (f2py_success) { + /* Processing variable gaussian_functionf2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&gaussian_functionf2pywrap,&x,&sigma); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",gaussian_functionf2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable gaussian_functionf2pywrap */ + } /*if (f2py_success) of sigma*/ + /* End of cleaning variable sigma */ + } /*if (f2py_success) of x*/ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of gaussian_function **************************/ + +/****************************** eliminate_transl ******************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_eliminate_transl[] = "\ +eliminate_transl(a,mass,[nat])\n\nWrapper for ``eliminate_transl``.\ +\n\nParameters\n----------\n" +"a : in/output rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(a, 0) / 3"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_cond_eliminate_transl(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"a","mass","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thirdorder.third_order_cond.eliminate_transl",\ + capi_kwlist,&a_capi,&mass_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eliminate_transl: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (complex_double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(a, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.eliminate_transl() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(a, 0) == 3 * nat,"shape(a, 0) == 3 * nat","1st keyword nat","eliminate_transl:nat=%d",nat) { + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eliminate_transl: failed to create array from the 2nd argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(a,mass,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /*CHECKSCALAR(shape(a, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of eliminate_transl **************************/ + +/************************************ cinv ************************************/ +static char doc_f2py_rout_thirdorder_third_order_cond_cinv[] = "\ +ainv = cinv(a)\n\nWrapper for ``cinv``.\ +\n\nParameters\n----------\n" +"a : input rank-2 array('D') with bounds (f2py_a_d0,f2py_a_d1)\n" +"\nReturns\n-------\n" +"ainv : rank-2 array('D') with bounds (size(a, 1),size(a, 2)) and cinvf2pywrap storage"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_cond_cinv(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *cinvf2pywrap = NULL; + npy_intp cinvf2pywrap_Dims[2] = {-1, -1}; + const int cinvf2pywrap_Rank = 2; + PyArrayObject *capi_cinvf2pywrap_as_array = NULL; + int capi_cinvf2pywrap_intent = 0; + complex_double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + int f2py_a_d0 = 0; + int f2py_a_d1 = 0; + static char *capi_kwlist[] = {"a",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:thirdorder.third_order_cond.cinv",\ + capi_kwlist,&a_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.cinv: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (complex_double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable cinvf2pywrap */ + cinvf2pywrap_Dims[0]=size(a, 1),cinvf2pywrap_Dims[1]=size(a, 2); + capi_cinvf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.cinv: failed to create array from the hidden `cinvf2pywrap`"; + capi_cinvf2pywrap_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,cinvf2pywrap_Dims,cinvf2pywrap_Rank, capi_cinvf2pywrap_intent,Py_None,capi_errmess); + if (capi_cinvf2pywrap_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + cinvf2pywrap = (complex_double *)(PyArray_DATA(capi_cinvf2pywrap_as_array)); + + /* Processing variable f2py_a_d0 */ + f2py_a_d0 = shape(a, 0); + /* Processing variable f2py_a_d1 */ + f2py_a_d1 = shape(a, 1); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(cinvf2pywrap,a,&f2py_a_d0,&f2py_a_d1); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_cinvf2pywrap_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f2py_a_d1 */ + /* End of cleaning variable f2py_a_d0 */ + } /* if (capi_cinvf2pywrap_as_array == NULL) ... else of cinvf2pywrap */ + /* End of cleaning variable cinvf2pywrap */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of cinv ********************************/ + +/*************************** compute_static_bubble ***************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_compute_static_bubble[] = "\ +bubble = compute_static_bubble(t,freq,is_gamma,d3,[n_mod])\n\nWrapper for ``compute_static_bubble``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-2 array('D') with bounds (n_mod,n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_static_bubble(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,complex_double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[2] = {-1, -1}; + const int bubble_Rank = 2; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"t","freq","is_gamma","d3","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|O:thirdorder.third_order_bubble.compute_static_bubble",\ + capi_kwlist,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_static_bubble() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the 2nd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the 3rd argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_static_bubble() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","compute_static_bubble:n_mod=%d",n_mod) { + /* Processing variable bubble */ + bubble_Dims[0]=n_mod,bubble_Dims[1]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the 4th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,freq,is_gamma,d3,&n_mod,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of compute_static_bubble ************************/ + +/*************************** compute_dynamic_bubble ***************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble[] = "\ +bubble = compute_dynamic_bubble(energies,sigma,static_limit,t,freq,is_gamma,d3,diag_approx,[ne,nsig,n_mod])\n\nWrapper for ``compute_dynamic_bubble``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (nsig)\n" +"static_limit : input int\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"diag_approx : input int\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nsig : input int, optional\n Default: shape(sigma, 0)\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-4 array('D') with bounds (ne,nsig,n_mod,n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + int static_limit = 0; + PyObject *static_limit_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int diag_approx = 0; + PyObject *diag_approx_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nsig = 0; + PyObject *nsig_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[4] = {-1, -1, -1, -1}; + const int bubble_Rank = 4; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","static_limit","t","freq","is_gamma","d3","diag_approx","ne","nsig","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|OOO:thirdorder.third_order_bubble.compute_dynamic_bubble",\ + capi_kwlist,&energies_capi,&sigma_capi,&static_limit_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&diag_approx_capi,&ne_capi,&nsig_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 4th argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 5th argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable static_limit */ + static_limit = (int)PyObject_IsTrue(static_limit_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 6th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable diag_approx */ + diag_approx = (int)PyObject_IsTrue(diag_approx_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_dynamic_bubble:ne=%d",ne) { + /* Processing variable nsig */ + if (nsig_capi == Py_None) nsig = shape(sigma, 0); else + f2py_success = int_from_pyobj(&nsig,nsig_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 2nd keyword (nsig) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == nsig,"shape(sigma, 0) == nsig","2nd keyword nsig","compute_dynamic_bubble:nsig=%d",nsig) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 3rd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","3rd keyword n_mod","compute_dynamic_bubble:n_mod=%d",n_mod) { + /* Processing variable bubble */ + bubble_Dims[0]=ne,bubble_Dims[1]=nsig,bubble_Dims[2]=n_mod,bubble_Dims[3]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 7th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(energies,sigma,&static_limit,&t,freq,is_gamma,d3,&diag_approx,&ne,&nsig,&n_mod,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*CHECKSCALAR(shape(sigma, 0) == nsig)*/ + } /*if (f2py_success) of nsig*/ + /* End of cleaning variable nsig */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of diag_approx*/ + /* End of cleaning variable diag_approx */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + } /*if (f2py_success) of static_limit*/ + /* End of cleaning variable static_limit */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of compute_dynamic_bubble ***********************/ + +/************************ compute_diag_dynamic_bubble ************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble[] = "\ +bubble = compute_diag_dynamic_bubble(energies,sigma,t,freq,is_gamma,d3,[ne,nsig,n_mod])\n\nWrapper for ``compute_diag_dynamic_bubble``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (nsig)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nsig : input int, optional\n Default: shape(sigma, 0)\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bubble : rank-3 array('D') with bounds (ne,nsig,n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,double*,double*,double*,int*,complex_double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int nsig = 0; + PyObject *nsig_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + complex_double *bubble = NULL; + npy_intp bubble_Dims[3] = {-1, -1, -1}; + const int bubble_Rank = 3; + PyArrayObject *capi_bubble_as_array = NULL; + int capi_bubble_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","ne","nsig","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OOO:thirdorder.third_order_bubble.compute_diag_dynamic_bubble",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&ne_capi,&nsig_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 4th argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 5th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_diag_dynamic_bubble:ne=%d",ne) { + /* Processing variable nsig */ + if (nsig_capi == Py_None) nsig = shape(sigma, 0); else + f2py_success = int_from_pyobj(&nsig,nsig_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 2nd keyword (nsig) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == nsig,"shape(sigma, 0) == nsig","2nd keyword nsig","compute_diag_dynamic_bubble:nsig=%d",nsig) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 3rd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","3rd keyword n_mod","compute_diag_dynamic_bubble:n_mod=%d",n_mod) { + /* Processing variable bubble */ + bubble_Dims[0]=ne,bubble_Dims[1]=nsig,bubble_Dims[2]=n_mod; + capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the hidden `bubble`"; + capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); + if (capi_bubble_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 6th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,energies,&nsig,sigma,&t,freq,is_gamma,d3,&n_mod,bubble); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + } /* if (capi_bubble_as_array == NULL) ... else of bubble */ + /* End of cleaning variable bubble */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*CHECKSCALAR(shape(sigma, 0) == nsig)*/ + } /*if (f2py_success) of nsig*/ + /* End of cleaning variable nsig */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/********************* end of compute_diag_dynamic_bubble *********************/ + +/************************** compute_perturb_selfnrg **************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg[] = "\ +selfnrg = compute_perturb_selfnrg(sigma,t,freq,is_gamma,d3,[nsig,n_mod])\n\nWrapper for ``compute_perturb_selfnrg``.\ +\n\nParameters\n----------\n" +"sigma : input rank-1 array('d') with bounds (nsig)\n" +"t : input float\n" +"freq : input rank-2 array('d') with bounds (n_mod,3)\n" +"is_gamma : input rank-1 array('i') with bounds (3)\n" +"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" +"\nOther Parameters\n----------------\n" +"nsig : input int, optional\n Default: shape(sigma, 0)\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"selfnrg : rank-2 array('D') with bounds (n_mod,nsig)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,double*,double*,int*,complex_double*,int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int nsig = 0; + PyObject *nsig_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[2] = {-1, -1}; + const int freq_Rank = 2; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + int *is_gamma = NULL; + npy_intp is_gamma_Dims[1] = {-1}; + const int is_gamma_Rank = 1; + PyArrayObject *capi_is_gamma_as_array = NULL; + int capi_is_gamma_intent = 0; + PyObject *is_gamma_capi = Py_None; + complex_double *d3 = NULL; + npy_intp d3_Dims[3] = {-1, -1, -1}; + const int d3_Rank = 3; + PyArrayObject *capi_d3_as_array = NULL; + int capi_d3_intent = 0; + PyObject *d3_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[2] = {-1, -1}; + const int selfnrg_Rank = 2; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + static char *capi_kwlist[] = {"sigma","t","freq","is_gamma","d3","nsig","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:thirdorder.third_order_bubble.compute_perturb_selfnrg",\ + capi_kwlist,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&nsig_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 1st argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_perturb_selfnrg() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + freq_Dims[1]=3; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 3rd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable is_gamma */ + is_gamma_Dims[0]=3; + capi_is_gamma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 4th argument `is_gamma`"; + capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); + if (capi_is_gamma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); + + /* Processing variable nsig */ + if (nsig_capi == Py_None) nsig = shape(sigma, 0); else + f2py_success = int_from_pyobj(&nsig,nsig_capi,"thirdorder.third_order_bubble.compute_perturb_selfnrg() 1st keyword (nsig) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == nsig,"shape(sigma, 0) == nsig","1st keyword nsig","compute_perturb_selfnrg:nsig=%d",nsig) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_perturb_selfnrg() 2nd keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","2nd keyword n_mod","compute_perturb_selfnrg:n_mod=%d",n_mod) { + /* Processing variable selfnrg */ + selfnrg_Dims[0]=n_mod,selfnrg_Dims[1]=nsig; + capi_selfnrg_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the hidden `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,Py_None,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable d3 */ + d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; + capi_d3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 5th argument `d3`"; + capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); + if (capi_d3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&nsig,sigma,&t,freq,is_gamma,d3,&n_mod,selfnrg); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_selfnrg_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_d3_as_array!=d3_capi) { + Py_XDECREF(capi_d3_as_array); } + } /* if (capi_d3_as_array == NULL) ... else of d3 */ + /* End of cleaning variable d3 */ + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*CHECKSCALAR(shape(sigma, 0) == nsig)*/ + } /*if (f2py_success) of nsig*/ + /* End of cleaning variable nsig */ + if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { + Py_XDECREF(capi_is_gamma_as_array); } + } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ + /* End of cleaning variable is_gamma */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of compute_perturb_selfnrg ***********************/ + +/***************************** compute_spectralf *****************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf[] = "\ +spectralf = compute_spectralf(smear_id,ener,d2,pi,notransl,mass,[nat,ne,nsmear])\n\nWrapper for ``compute_spectralf``.\ +\n\nParameters\n----------\n" +"smear_id : input rank-1 array('d') with bounds (nsmear)\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"d2 : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"pi : input rank-4 array('D') with bounds (ne,nsmear,3 * nat,3 * nat)\n" +"notransl : input int\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(d2, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"nsmear : input int, optional\n Default: shape(smear_id, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-2 array('d') with bounds (ne,nsmear)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_spectralf(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,complex_double*,complex_double*,int*,double*,double*,int*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *smear_id = NULL; + npy_intp smear_id_Dims[1] = {-1}; + const int smear_id_Rank = 1; + PyArrayObject *capi_smear_id_as_array = NULL; + int capi_smear_id_intent = 0; + PyObject *smear_id_capi = Py_None; + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + complex_double *d2 = NULL; + npy_intp d2_Dims[2] = {-1, -1}; + const int d2_Rank = 2; + PyArrayObject *capi_d2_as_array = NULL; + int capi_d2_intent = 0; + PyObject *d2_capi = Py_None; + complex_double *pi = NULL; + npy_intp pi_Dims[4] = {-1, -1, -1, -1}; + const int pi_Rank = 4; + PyArrayObject *capi_pi_as_array = NULL; + int capi_pi_intent = 0; + PyObject *pi_capi = Py_None; + int notransl = 0; + PyObject *notransl_capi = Py_None; + double *spectralf = NULL; + npy_intp spectralf_Dims[2] = {-1, -1}; + const int spectralf_Rank = 2; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nsmear = 0; + PyObject *nsmear_capi = Py_None; + static char *capi_kwlist[] = {"smear_id","ener","d2","pi","notransl","mass","nat","ne","nsmear",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OOO:thirdorder.third_order_bubble.compute_spectralf",\ + capi_kwlist,&smear_id_capi,&ener_capi,&d2_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi,&nsmear_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 2nd argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable smear_id */ + ; + capi_smear_id_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 1st argument `smear_id`"; + capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); + if (capi_smear_id_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); + + /* Processing variable d2 */ + ; + capi_d2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 3rd argument `d2`"; + capi_d2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d2_Dims,d2_Rank, capi_d2_intent,d2_capi,capi_errmess); + if (capi_d2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2 = (complex_double *)(PyArray_DATA(capi_d2_as_array)); + + /* Processing variable notransl */ + notransl = (int)PyObject_IsTrue(notransl_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_spectralf() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf:ne=%d",ne) { + /* Processing variable nsmear */ + if (nsmear_capi == Py_None) nsmear = shape(smear_id, 0); else + f2py_success = int_from_pyobj(&nsmear,nsmear_capi,"thirdorder.third_order_bubble.compute_spectralf() 3rd keyword (nsmear) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(smear_id, 0) == nsmear,"shape(smear_id, 0) == nsmear","3rd keyword nsmear","compute_spectralf:nsmear=%d",nsmear) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(d2, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_bubble.compute_spectralf() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(d2, 0) == 3 * nat,"shape(d2, 0) == 3 * nat","1st keyword nat","compute_spectralf:nat=%d",nat) { + /* Processing variable pi */ + pi_Dims[0]=ne,pi_Dims[1]=nsmear,pi_Dims[2]=3 * nat,pi_Dims[3]=3 * nat; + capi_pi_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 4th argument `pi`"; + capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); + if (capi_pi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=ne,spectralf_Dims[1]=nsmear; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); + + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 6th argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(smear_id,ener,d2,pi,¬ransl,spectralf,mass,&nat,&ne,&nsmear); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_pi_as_array!=pi_capi) { + Py_XDECREF(capi_pi_as_array); } + } /* if (capi_pi_as_array == NULL) ... else of pi */ + /* End of cleaning variable pi */ + } /*CHECKSCALAR(shape(d2, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(smear_id, 0) == nsmear)*/ + } /*if (f2py_success) of nsmear*/ + /* End of cleaning variable nsmear */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + } /*if (f2py_success) of notransl*/ + /* End of cleaning variable notransl */ + if((PyObject *)capi_d2_as_array!=d2_capi) { + Py_XDECREF(capi_d2_as_array); } + } /* if (capi_d2_as_array == NULL) ... else of d2 */ + /* End of cleaning variable d2 */ + if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { + Py_XDECREF(capi_smear_id_as_array); } + } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ + /* End of cleaning variable smear_id */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of compute_spectralf **************************/ + +/*************************** compute_spectralf_diag ***************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag[] = "\ +spectralf = compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,[nat,ne,nsmear])\n\nWrapper for ``compute_spectralf_diag``.\ +\n\nParameters\n----------\n" +"smear_id : input rank-1 array('d') with bounds (nsmear)\n" +"ener : input rank-1 array('d') with bounds (ne)\n" +"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" +"selfnrg : input rank-3 array('D') with bounds (ne,nsmear,3 * nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(d2_freq, 0) / 3\n" +"ne : input int, optional\n Default: shape(ener, 0)\n" +"nsmear : input int, optional\n Default: shape(smear_id, 0)\n" +"\nReturns\n-------\n" +"spectralf : rank-3 array('d') with bounds (ne,3 * nat,nsmear)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,complex_double*,int*,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *smear_id = NULL; + npy_intp smear_id_Dims[1] = {-1}; + const int smear_id_Rank = 1; + PyArrayObject *capi_smear_id_as_array = NULL; + int capi_smear_id_intent = 0; + PyObject *smear_id_capi = Py_None; + double *ener = NULL; + npy_intp ener_Dims[1] = {-1}; + const int ener_Rank = 1; + PyArrayObject *capi_ener_as_array = NULL; + int capi_ener_intent = 0; + PyObject *ener_capi = Py_None; + double *d2_freq = NULL; + npy_intp d2_freq_Dims[1] = {-1}; + const int d2_freq_Rank = 1; + PyArrayObject *capi_d2_freq_as_array = NULL; + int capi_d2_freq_intent = 0; + PyObject *d2_freq_capi = Py_None; + complex_double *selfnrg = NULL; + npy_intp selfnrg_Dims[3] = {-1, -1, -1}; + const int selfnrg_Rank = 3; + PyArrayObject *capi_selfnrg_as_array = NULL; + int capi_selfnrg_intent = 0; + PyObject *selfnrg_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + int ne = 0; + PyObject *ne_capi = Py_None; + int nsmear = 0; + PyObject *nsmear_capi = Py_None; + double *spectralf = NULL; + npy_intp spectralf_Dims[3] = {-1, -1, -1}; + const int spectralf_Rank = 3; + PyArrayObject *capi_spectralf_as_array = NULL; + int capi_spectralf_intent = 0; + static char *capi_kwlist[] = {"smear_id","ener","d2_freq","selfnrg","nat","ne","nsmear",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|OOO:thirdorder.third_order_bubble.compute_spectralf_diag",\ + capi_kwlist,&smear_id_capi,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi,&nsmear_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ener */ + ; + capi_ener_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 2nd argument `ener`"; + capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); + if (capi_ener_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ener = (double *)(PyArray_DATA(capi_ener_as_array)); + + /* Processing variable smear_id */ + ; + capi_smear_id_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 1st argument `smear_id`"; + capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); + if (capi_smear_id_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); + + /* Processing variable d2_freq */ + ; + capi_d2_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 3rd argument `d2_freq`"; + capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); + if (capi_d2_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(ener, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_spectralf_diag() 2nd keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf_diag:ne=%d",ne) { + /* Processing variable nsmear */ + if (nsmear_capi == Py_None) nsmear = shape(smear_id, 0); else + f2py_success = int_from_pyobj(&nsmear,nsmear_capi,"thirdorder.third_order_bubble.compute_spectralf_diag() 3rd keyword (nsmear) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(smear_id, 0) == nsmear,"shape(smear_id, 0) == nsmear","3rd keyword nsmear","compute_spectralf_diag:nsmear=%d",nsmear) { + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(d2_freq, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_bubble.compute_spectralf_diag() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(d2_freq, 0) == 3 * nat,"shape(d2_freq, 0) == 3 * nat","1st keyword nat","compute_spectralf_diag:nat=%d",nat) { + /* Processing variable selfnrg */ + selfnrg_Dims[0]=ne,selfnrg_Dims[1]=nsmear,selfnrg_Dims[2]=3 * nat; + capi_selfnrg_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 4th argument `selfnrg`"; + capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); + if (capi_selfnrg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); + + /* Processing variable spectralf */ + spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=nsmear; + capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the hidden `spectralf`"; + capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); + if (capi_spectralf_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(smear_id,ener,d2_freq,selfnrg,&nat,&ne,&nsmear,spectralf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ + /* End of cleaning variable spectralf */ + if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { + Py_XDECREF(capi_selfnrg_as_array); } + } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ + /* End of cleaning variable selfnrg */ + } /*CHECKSCALAR(shape(d2_freq, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + } /*CHECKSCALAR(shape(smear_id, 0) == nsmear)*/ + } /*if (f2py_success) of nsmear*/ + /* End of cleaning variable nsmear */ + } /*CHECKSCALAR(shape(ener, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { + Py_XDECREF(capi_d2_freq_as_array); } + } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ + /* End of cleaning variable d2_freq */ + if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { + Py_XDECREF(capi_smear_id_as_array); } + } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ + /* End of cleaning variable smear_id */ + if((PyObject *)capi_ener_as_array!=ener_capi) { + Py_XDECREF(capi_ener_as_array); } + } /* if (capi_ener_as_array == NULL) ... else of ener */ + /* End of cleaning variable ener */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of compute_spectralf_diag ***********************/ + +/*********************************** lambda ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_lambda[] = "\ +lambda_out = lambda(t,w_q2,w_q3)\n\nWrapper for ``lambda``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"\nReturns\n-------\n" +"lambda_out : float"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_lambda(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + double lambda_out = 0; + static char *capi_kwlist[] = {"t","w_q2","w_q3",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:thirdorder.third_order_bubble.lambda",\ + capi_kwlist,&t_capi,&w_q2_capi,&w_q3_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable lambda_out */ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.lambda() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda: failed to create array from the 2nd argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda: failed to create array from the 3rd argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,w_q2,w_q3,&lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",lambda_out); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + /* End of cleaning variable lambda_out */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of lambda *******************************/ + +/******************************* lambda_dynamic *******************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic[] = "\ +lambda_out = lambda_dynamic(energies,sigma,t,static_limit,w_q2,w_q3,[ne,nsigma])\n\nWrapper for ``lambda_dynamic``.\ +\n\nParameters\n----------\n" +"energies : input rank-1 array('d') with bounds (ne)\n" +"sigma : input rank-1 array('d') with bounds (nsigma)\n" +"t : input float\n" +"static_limit : input int\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"ne : input int, optional\n Default: shape(energies, 0)\n" +"nsigma : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"lambda_out : rank-2 array('D') with bounds (ne,nsigma)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_lambda_dynamic(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,double*,double*,int*,double*,double*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int ne = 0; + PyObject *ne_capi = Py_None; + double *energies = NULL; + npy_intp energies_Dims[1] = {-1}; + const int energies_Rank = 1; + PyArrayObject *capi_energies_as_array = NULL; + int capi_energies_intent = 0; + PyObject *energies_capi = Py_None; + int nsigma = 0; + PyObject *nsigma_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + int static_limit = 0; + PyObject *static_limit_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + complex_double *lambda_out = NULL; + npy_intp lambda_out_Dims[2] = {-1, -1}; + const int lambda_out_Rank = 2; + PyArrayObject *capi_lambda_out_as_array = NULL; + int capi_lambda_out_intent = 0; + static char *capi_kwlist[] = {"energies","sigma","t","static_limit","w_q2","w_q3","ne","nsigma",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|OO:thirdorder.third_order_bubble.lambda_dynamic",\ + capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&static_limit_capi,&w_q2_capi,&w_q3_capi,&ne_capi,&nsigma_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable static_limit */ + static_limit = (int)PyObject_IsTrue(static_limit_capi); + f2py_success = 1; + if (f2py_success) { + /* Processing variable energies */ + ; + capi_energies_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 1st argument `energies`"; + capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); + if (capi_energies_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + energies = (double *)(PyArray_DATA(capi_energies_as_array)); + + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.lambda_dynamic() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 5th argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 6th argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + + /* Processing variable ne */ + if (ne_capi == Py_None) ne = shape(energies, 0); else + f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.lambda_dynamic() 1st keyword (ne) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","lambda_dynamic:ne=%d",ne) { + /* Processing variable nsigma */ + if (nsigma_capi == Py_None) nsigma = shape(sigma, 0); else + f2py_success = int_from_pyobj(&nsigma,nsigma_capi,"thirdorder.third_order_bubble.lambda_dynamic() 2nd keyword (nsigma) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == nsigma,"shape(sigma, 0) == nsigma","2nd keyword nsigma","lambda_dynamic:nsigma=%d",nsigma) { + /* Processing variable lambda_out */ + lambda_out_Dims[0]=ne,lambda_out_Dims[1]=nsigma; + capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the hidden `lambda_out`"; + capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); + if (capi_lambda_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&ne,energies,&nsigma,sigma,&t,&static_limit,w_q2,w_q3,lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ + /* End of cleaning variable lambda_out */ + } /*CHECKSCALAR(shape(sigma, 0) == nsigma)*/ + } /*if (f2py_success) of nsigma*/ + /* End of cleaning variable nsigma */ + } /*CHECKSCALAR(shape(energies, 0) == ne)*/ + } /*if (f2py_success) of ne*/ + /* End of cleaning variable ne */ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ + if((PyObject *)capi_energies_as_array!=energies_capi) { + Py_XDECREF(capi_energies_as_array); } + } /* if (capi_energies_as_array == NULL) ... else of energies */ + /* End of cleaning variable energies */ + } /*if (f2py_success) of static_limit*/ + /* End of cleaning variable static_limit */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of lambda_dynamic ***************************/ + +/**************************** lambda_dynamic_value ****************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value[] = "\ +lambda_out = lambda_dynamic_value(value,sigma,t,w_q2,w_q3,[n_mod,nsigma])\n\nWrapper for ``lambda_dynamic_value``.\ +\n\nParameters\n----------\n" +"value : input rank-1 array('d') with bounds (n_mod)\n" +"sigma : input rank-1 array('d') with bounds (nsigma)\n" +"t : input float\n" +"w_q2 : input rank-1 array('d') with bounds (3)\n" +"w_q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(value, 0)\n" +"nsigma : input int, optional\n Default: shape(sigma, 0)\n" +"\nReturns\n-------\n" +"lambda_out : rank-2 array('D') with bounds (n_mod,nsigma)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,double*,int*,double*,double*,double*,double*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double *value = NULL; + npy_intp value_Dims[1] = {-1}; + const int value_Rank = 1; + PyArrayObject *capi_value_as_array = NULL; + int capi_value_intent = 0; + PyObject *value_capi = Py_None; + int nsigma = 0; + PyObject *nsigma_capi = Py_None; + double *sigma = NULL; + npy_intp sigma_Dims[1] = {-1}; + const int sigma_Rank = 1; + PyArrayObject *capi_sigma_as_array = NULL; + int capi_sigma_intent = 0; + PyObject *sigma_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + double *w_q2 = NULL; + npy_intp w_q2_Dims[1] = {-1}; + const int w_q2_Rank = 1; + PyArrayObject *capi_w_q2_as_array = NULL; + int capi_w_q2_intent = 0; + PyObject *w_q2_capi = Py_None; + double *w_q3 = NULL; + npy_intp w_q3_Dims[1] = {-1}; + const int w_q3_Rank = 1; + PyArrayObject *capi_w_q3_as_array = NULL; + int capi_w_q3_intent = 0; + PyObject *w_q3_capi = Py_None; + complex_double *lambda_out = NULL; + npy_intp lambda_out_Dims[2] = {-1, -1}; + const int lambda_out_Rank = 2; + PyArrayObject *capi_lambda_out_as_array = NULL; + int capi_lambda_out_intent = 0; + static char *capi_kwlist[] = {"value","sigma","t","w_q2","w_q3","n_mod","nsigma",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:thirdorder.third_order_bubble.lambda_dynamic_value",\ + capi_kwlist,&value_capi,&sigma_capi,&t_capi,&w_q2_capi,&w_q3_capi,&n_mod_capi,&nsigma_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable sigma */ + ; + capi_sigma_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 2nd argument `sigma`"; + capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); + if (capi_sigma_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); + + /* Processing variable value */ + ; + capi_value_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 1st argument `value`"; + capi_value_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,value_Dims,value_Rank, capi_value_intent,value_capi,capi_errmess); + if (capi_value_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + value = (double *)(PyArray_DATA(capi_value_as_array)); + + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.lambda_dynamic_value() 3rd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable w_q2 */ + w_q2_Dims[0]=3; + capi_w_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 4th argument `w_q2`"; + capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); + if (capi_w_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); + + /* Processing variable w_q3 */ + w_q3_Dims[0]=3; + capi_w_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 5th argument `w_q3`"; + capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); + if (capi_w_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); + + /* Processing variable nsigma */ + if (nsigma_capi == Py_None) nsigma = shape(sigma, 0); else + f2py_success = int_from_pyobj(&nsigma,nsigma_capi,"thirdorder.third_order_bubble.lambda_dynamic_value() 2nd keyword (nsigma) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(sigma, 0) == nsigma,"shape(sigma, 0) == nsigma","2nd keyword nsigma","lambda_dynamic_value:nsigma=%d",nsigma) { + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(value, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.lambda_dynamic_value() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(value, 0) == n_mod,"shape(value, 0) == n_mod","1st keyword n_mod","lambda_dynamic_value:n_mod=%d",n_mod) { + /* Processing variable lambda_out */ + lambda_out_Dims[0]=n_mod,lambda_out_Dims[1]=nsigma; + capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the hidden `lambda_out`"; + capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); + if (capi_lambda_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&n_mod,value,&nsigma,sigma,&t,w_q2,w_q3,lambda_out); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ + /* End of cleaning variable lambda_out */ + } /*CHECKSCALAR(shape(value, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + } /*CHECKSCALAR(shape(sigma, 0) == nsigma)*/ + } /*if (f2py_success) of nsigma*/ + /* End of cleaning variable nsigma */ + if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { + Py_XDECREF(capi_w_q3_as_array); } + } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ + /* End of cleaning variable w_q3 */ + if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { + Py_XDECREF(capi_w_q2_as_array); } + } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ + /* End of cleaning variable w_q2 */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + if((PyObject *)capi_value_as_array!=value_capi) { + Py_XDECREF(capi_value_as_array); } + } /* if (capi_value_as_array == NULL) ... else of value */ + /* End of cleaning variable value */ + if((PyObject *)capi_sigma_as_array!=sigma_capi) { + Py_XDECREF(capi_sigma_as_array); } + } /* if (capi_sigma_as_array == NULL) ... else of sigma */ + /* End of cleaning variable sigma */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of lambda_dynamic_value ************************/ + +/********************************* bose_freq *********************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_bose_freq[] = "\ +bose = bose_freq(t,freq,[n_mod])\n\nWrapper for ``bose_freq``.\ +\n\nParameters\n----------\n" +"t : input float\n" +"freq : input rank-1 array('d') with bounds (n_mod)\n" +"\nOther Parameters\n----------------\n" +"n_mod : input int, optional\n Default: shape(freq, 0)\n" +"\nReturns\n-------\n" +"bose : rank-1 array('d') with bounds (n_mod)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_bose_freq(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double t = 0; + PyObject *t_capi = Py_None; + int n_mod = 0; + PyObject *n_mod_capi = Py_None; + double *freq = NULL; + npy_intp freq_Dims[1] = {-1}; + const int freq_Rank = 1; + PyArrayObject *capi_freq_as_array = NULL; + int capi_freq_intent = 0; + PyObject *freq_capi = Py_None; + double *bose = NULL; + npy_intp bose_Dims[1] = {-1}; + const int bose_Rank = 1; + PyArrayObject *capi_bose_as_array = NULL; + int capi_bose_intent = 0; + static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thirdorder.third_order_bubble.bose_freq",\ + capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.bose_freq() 1st argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable freq */ + ; + capi_freq_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.bose_freq: failed to create array from the 2nd argument `freq`"; + capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); + if (capi_freq_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + freq = (double *)(PyArray_DATA(capi_freq_as_array)); + + /* Processing variable n_mod */ + if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else + f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.bose_freq() 1st keyword (n_mod) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","bose_freq:n_mod=%d",n_mod) { + /* Processing variable bose */ + bose_Dims[0]=n_mod; + capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.bose_freq: failed to create array from the hidden `bose`"; + capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); + if (capi_bose_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bose = (double *)(PyArray_DATA(capi_bose_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&t,&n_mod,freq,bose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_bose_as_array == NULL) ... else of bose */ + /* End of cleaning variable bose */ + } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ + } /*if (f2py_success) of n_mod*/ + /* End of cleaning variable n_mod */ + if((PyObject *)capi_freq_as_array!=freq_capi) { + Py_XDECREF(capi_freq_as_array); } + } /* if (capi_freq_as_array == NULL) ... else of freq */ + /* End of cleaning variable freq */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of bose_freq ******************************/ + +/*********************************** f_bose ***********************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_f_bose[] = "\ +f_bose = f_bose(freq,t)\n\nWrapper for ``f_bose``.\ +\n\nParameters\n----------\n" +"freq : input float\n" +"t : input float\n" +"\nReturns\n-------\n" +"f_bose : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_f_bose(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double f_bosef2pywrap = 0; + double freq = 0; + PyObject *freq_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + static char *capi_kwlist[] = {"freq","t",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_bubble.f_bose",\ + capi_kwlist,&freq_capi,&t_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable freq */ + f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_bubble.f_bose() 1st argument (freq) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.f_bose() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable f_bosef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&f_bosef2pywrap,&freq,&t); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",f_bosef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable f_bosef2pywrap */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of freq*/ + /* End of cleaning variable freq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of f_bose *******************************/ + +/********************************** df_bose **********************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_df_bose[] = "\ +df_bose = df_bose(freq,t)\n\nWrapper for ``df_bose``.\ +\n\nParameters\n----------\n" +"freq : input float\n" +"t : input float\n" +"\nReturns\n-------\n" +"df_bose : float"; +/* #declfortranroutine# */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_df_bose(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double df_bosef2pywrap = 0; + double freq = 0; + PyObject *freq_capi = Py_None; + double t = 0; + PyObject *t_capi = Py_None; + static char *capi_kwlist[] = {"freq","t",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:thirdorder.third_order_bubble.df_bose",\ + capi_kwlist,&freq_capi,&t_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable freq */ + f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_bubble.df_bose() 1st argument (freq) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.df_bose() 2nd argument (t) can't be converted to double"); + if (f2py_success) { + /* Processing variable df_bosef2pywrap */ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&df_bosef2pywrap,&freq,&t); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",df_bosef2pywrap); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable df_bosef2pywrap */ + } /*if (f2py_success) of t*/ + /* End of cleaning variable t */ + } /*if (f2py_success) of freq*/ + /* End of cleaning variable freq */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of df_bose *******************************/ + +/********************************** invzmat **********************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_invzmat[] = "\ +invzmat(a,[n])\n\nWrapper for ``invzmat``.\ +\n\nParameters\n----------\n" +"a : in/output rank-2 array('D') with bounds (n,n)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(a, 0)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_invzmat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int*,complex_double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int n = 0; + PyObject *n_capi = Py_None; + complex_double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + static char *capi_kwlist[] = {"a","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|O:thirdorder.third_order_bubble.invzmat",\ + capi_kwlist,&a_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.invzmat: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (complex_double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(a, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"thirdorder.third_order_bubble.invzmat() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(a, 0) == n,"shape(a, 0) == n","1st keyword n","invzmat:n=%d",n) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(&n,a); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(a, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of invzmat *******************************/ + +/****************************** eliminate_transl ******************************/ +static char doc_f2py_rout_thirdorder_third_order_bubble_eliminate_transl[] = "\ +eliminate_transl(a,mass,[nat])\n\nWrapper for ``eliminate_transl``.\ +\n\nParameters\n----------\n" +"a : in/output rank-2 array('D') with bounds (3 * nat,3 * nat)\n" +"mass : input rank-1 array('d') with bounds (nat)\n" +"\nOther Parameters\n----------------\n" +"nat : input int, optional\n Default: shape(a, 0) / 3"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_bubble_eliminate_transl(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *a = NULL; + npy_intp a_Dims[2] = {-1, -1}; + const int a_Rank = 2; + PyArrayObject *capi_a_as_array = NULL; + int capi_a_intent = 0; + PyObject *a_capi = Py_None; + double *mass = NULL; + npy_intp mass_Dims[1] = {-1}; + const int mass_Rank = 1; + PyArrayObject *capi_mass_as_array = NULL; + int capi_mass_intent = 0; + PyObject *mass_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"a","mass","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:thirdorder.third_order_bubble.eliminate_transl",\ + capi_kwlist,&a_capi,&mass_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable a */ + ; + capi_a_intent |= F2PY_INTENT_INOUT; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.eliminate_transl: failed to create array from the 1st argument `a`"; + capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); + if (capi_a_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + a = (complex_double *)(PyArray_DATA(capi_a_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(a, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_bubble.eliminate_transl() 1st keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(a, 0) == 3 * nat,"shape(a, 0) == 3 * nat","1st keyword nat","eliminate_transl:nat=%d",nat) { + /* Processing variable mass */ + mass_Dims[0]=nat; + capi_mass_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.eliminate_transl: failed to create array from the 2nd argument `mass`"; + capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); + if (capi_mass_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mass = (double *)(PyArray_DATA(capi_mass_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(a,mass,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_mass_as_array!=mass_capi) { + Py_XDECREF(capi_mass_as_array); } + } /* if (capi_mass_as_array == NULL) ... else of mass */ + /* End of cleaning variable mass */ + } /*CHECKSCALAR(shape(a, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_a_as_array!=a_capi) { + Py_XDECREF(capi_a_as_array); } + } /* if (capi_a_as_array == NULL) ... else of a */ + /* End of cleaning variable a */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of eliminate_transl **************************/ + +/********************************** interpol **********************************/ +static char doc_f2py_rout_thirdorder_third_order_interpol_interpol[] = "\ +fc_interp = interpol(fc,r2,r3,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol``.\ +\n\nParameters\n----------\n" +"fc : input rank-4 array('D') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" +"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" +"q2 : input rank-1 array('d') with bounds (3)\n" +"q3 : input rank-1 array('d') with bounds (3)\n" +"\nOther Parameters\n----------------\n" +"n_blocks : input int, optional\n Default: shape(fc, 3)\n" +"nat : input int, optional\n Default: shape(fc, 0) / 3\n" +"\nReturns\n-------\n" +"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; +/* */ +static PyObject *f2py_rout_thirdorder_third_order_interpol_interpol(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(complex_double*,double*,double*,double*,double*,complex_double*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + complex_double *fc = NULL; + npy_intp fc_Dims[4] = {-1, -1, -1, -1}; + const int fc_Rank = 4; + PyArrayObject *capi_fc_as_array = NULL; + int capi_fc_intent = 0; + PyObject *fc_capi = Py_None; + double *r2 = NULL; + npy_intp r2_Dims[2] = {-1, -1}; + const int r2_Rank = 2; + PyArrayObject *capi_r2_as_array = NULL; + int capi_r2_intent = 0; + PyObject *r2_capi = Py_None; + double *r3 = NULL; + npy_intp r3_Dims[2] = {-1, -1}; + const int r3_Rank = 2; + PyArrayObject *capi_r3_as_array = NULL; + int capi_r3_intent = 0; + PyObject *r3_capi = Py_None; + double *q2 = NULL; + npy_intp q2_Dims[1] = {-1}; + const int q2_Rank = 1; + PyArrayObject *capi_q2_as_array = NULL; + int capi_q2_intent = 0; + PyObject *q2_capi = Py_None; + double *q3 = NULL; + npy_intp q3_Dims[1] = {-1}; + const int q3_Rank = 1; + PyArrayObject *capi_q3_as_array = NULL; + int capi_q3_intent = 0; + PyObject *q3_capi = Py_None; + complex_double *fc_interp = NULL; + npy_intp fc_interp_Dims[3] = {-1, -1, -1}; + const int fc_interp_Rank = 3; + PyArrayObject *capi_fc_interp_as_array = NULL; + int capi_fc_interp_intent = 0; + int n_blocks = 0; + PyObject *n_blocks_capi = Py_None; + int nat = 0; + PyObject *nat_capi = Py_None; + static char *capi_kwlist[] = {"fc","r2","r3","q2","q3","n_blocks","nat",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|OO:thirdorder.third_order_interpol.interpol",\ + capi_kwlist,&fc_capi,&r2_capi,&r3_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable fc */ + ; + capi_fc_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 1st argument `fc`"; + capi_fc_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); + if (capi_fc_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc = (complex_double *)(PyArray_DATA(capi_fc_as_array)); + + /* Processing variable q2 */ + q2_Dims[0]=3; + capi_q2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 4th argument `q2`"; + capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); + if (capi_q2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q2 = (double *)(PyArray_DATA(capi_q2_as_array)); + + /* Processing variable q3 */ + q3_Dims[0]=3; + capi_q3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 5th argument `q3`"; + capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); + if (capi_q3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + q3 = (double *)(PyArray_DATA(capi_q3_as_array)); + + /* Processing variable nat */ + if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else + f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_interpol.interpol() 2nd keyword (nat) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","2nd keyword nat","interpol:nat=%d",nat) { + /* Processing variable n_blocks */ + if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else + f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_interpol.interpol() 1st keyword (n_blocks) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","1st keyword n_blocks","interpol:n_blocks=%d",n_blocks) { + /* Processing variable r2 */ + r2_Dims[0]=3,r2_Dims[1]=n_blocks; + capi_r2_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 2nd argument `r2`"; + capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); + if (capi_r2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r2 = (double *)(PyArray_DATA(capi_r2_as_array)); + + /* Processing variable r3 */ + r3_Dims[0]=3,r3_Dims[1]=n_blocks; + capi_r3_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 3rd argument `r3`"; + capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); + if (capi_r3_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r3 = (double *)(PyArray_DATA(capi_r3_as_array)); + + /* Processing variable fc_interp */ + fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; + capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; + const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the hidden `fc_interp`"; + capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); + if (capi_fc_interp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = thirdorder_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(fc,r2,r3,q2,q3,fc_interp,&n_blocks,&nat); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ + /* End of cleaning variable fc_interp */ + if((PyObject *)capi_r3_as_array!=r3_capi) { + Py_XDECREF(capi_r3_as_array); } + } /* if (capi_r3_as_array == NULL) ... else of r3 */ + /* End of cleaning variable r3 */ + if((PyObject *)capi_r2_as_array!=r2_capi) { + Py_XDECREF(capi_r2_as_array); } + } /* if (capi_r2_as_array == NULL) ... else of r2 */ + /* End of cleaning variable r2 */ + } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ + } /*if (f2py_success) of n_blocks*/ + /* End of cleaning variable n_blocks */ + } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ + } /*if (f2py_success) of nat*/ + /* End of cleaning variable nat */ + if((PyObject *)capi_q3_as_array!=q3_capi) { + Py_XDECREF(capi_q3_as_array); } + } /* if (capi_q3_as_array == NULL) ... else of q3 */ + /* End of cleaning variable q3 */ + if((PyObject *)capi_q2_as_array!=q2_capi) { + Py_XDECREF(capi_q2_as_array); } + } /* if (capi_q2_as_array == NULL) ... else of q2 */ + /* End of cleaning variable q2 */ + if((PyObject *)capi_fc_as_array!=fc_capi) { + Py_XDECREF(capi_fc_as_array); } + } /* if (capi_fc_as_array == NULL) ... else of fc */ + /* End of cleaning variable fc */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of interpol ******************************/ +/*eof body*/ + +/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ + +static FortranDataDef f2py_third_order_asr_def[] = { + {"perm_initialized",0,{{-1}},NPY_INT, 1}, + {"p",2,{{-1,-1}},NPY_INT, 1}, + {"r2index_initialized",0,{{-1}},NPY_INT, 1}, + {"index_blocks_r2",2,{{-1,-1}},NPY_INT, 1}, + {"num_blocks_r2",1,{{-1}},NPY_INT, 1}, + {"initialize_r2index",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_initialize_r2index,doc_f2py_rout_thirdorder_third_order_asr_initialize_r2index}, + {"initialize_perm",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_initialize_perm,doc_f2py_rout_thirdorder_third_order_asr_initialize_perm}, + {"geq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_geq,doc_f2py_rout_thirdorder_third_order_asr_geq}, + {"f",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_f,doc_f2py_rout_thirdorder_third_order_asr_f}, + {"impose_perm_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_impose_perm_sym,doc_f2py_rout_thirdorder_third_order_asr_impose_perm_sym}, + {"impose_asr_3rd",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_impose_asr_3rd,doc_f2py_rout_thirdorder_third_order_asr_impose_asr_3rd}, + {"impose_asr",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_impose_asr,doc_f2py_rout_thirdorder_third_order_asr_impose_asr}, + {NULL} +}; + +static void f2py_setup_third_order_asr(char *perm_initialized,void (*p)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *r2index_initialized,void (*index_blocks_r2)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),void (*num_blocks_r2)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *initialize_r2index,char *initialize_perm,char *geq,char *f,char *impose_perm_sym,char *impose_asr_3rd,char *impose_asr) { + int i_f2py=0; + f2py_third_order_asr_def[i_f2py++].data = perm_initialized; + f2py_third_order_asr_def[i_f2py++].func = p; + f2py_third_order_asr_def[i_f2py++].data = r2index_initialized; + f2py_third_order_asr_def[i_f2py++].func = index_blocks_r2; + f2py_third_order_asr_def[i_f2py++].func = num_blocks_r2; + f2py_third_order_asr_def[i_f2py++].data = initialize_r2index; + f2py_third_order_asr_def[i_f2py++].data = initialize_perm; + f2py_third_order_asr_def[i_f2py++].data = geq; + f2py_third_order_asr_def[i_f2py++].data = f; + f2py_third_order_asr_def[i_f2py++].data = impose_perm_sym; + f2py_third_order_asr_def[i_f2py++].data = impose_asr_3rd; + f2py_third_order_asr_def[i_f2py++].data = impose_asr; +} +extern void F_FUNC_US(f2pyinitthird_order_asr,F2PYINITTHIRD_ORDER_ASR)(void (*)(char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_asr(void) { + F_FUNC_US(f2pyinitthird_order_asr,F2PYINITTHIRD_ORDER_ASR)(f2py_setup_third_order_asr); +} + + +static FortranDataDef f2py_third_order_centering_def[] = { + {"analysis",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_analysis,doc_f2py_rout_thirdorder_third_order_centering_analysis}, + {"center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_center,doc_f2py_rout_thirdorder_third_order_centering_center}, + {"center_sparse",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_center_sparse,doc_f2py_rout_thirdorder_third_order_centering_center_sparse}, + {"pre_center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_pre_center,doc_f2py_rout_thirdorder_third_order_centering_pre_center}, + {"assign",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_assign,doc_f2py_rout_thirdorder_third_order_centering_assign}, + {"within_dmax",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_within_dmax,doc_f2py_rout_thirdorder_third_order_centering_within_dmax}, + {"compute_perimeter",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_compute_perimeter,doc_f2py_rout_thirdorder_third_order_centering_compute_perimeter}, + {"three_to_one_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_three_to_one_len,doc_f2py_rout_thirdorder_third_order_centering_three_to_one_len}, + {"three_to_one",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_three_to_one,doc_f2py_rout_thirdorder_third_order_centering_three_to_one}, + {"one_to_three_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_one_to_three_len,doc_f2py_rout_thirdorder_third_order_centering_one_to_three_len}, + {"one_to_three",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_one_to_three,doc_f2py_rout_thirdorder_third_order_centering_one_to_three}, + {"min_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_min_el_wise_2,doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_2}, + {"max_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_max_el_wise_2,doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_2}, + {"min_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_min_el_wise_3,doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_3}, + {"max_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_max_el_wise_3,doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_3}, + {"cryst_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_cryst_to_cart,doc_f2py_rout_thirdorder_third_order_centering_cryst_to_cart}, + {NULL} +}; + +static void f2py_setup_third_order_centering(char *analysis,char *center,char *center_sparse,char *pre_center,char *assign,char *within_dmax,char *compute_perimeter,char *three_to_one_len,char *three_to_one,char *one_to_three_len,char *one_to_three,char *min_el_wise_2,char *max_el_wise_2,char *min_el_wise_3,char *max_el_wise_3,char *cryst_to_cart) { + int i_f2py=0; + f2py_third_order_centering_def[i_f2py++].data = analysis; + f2py_third_order_centering_def[i_f2py++].data = center; + f2py_third_order_centering_def[i_f2py++].data = center_sparse; + f2py_third_order_centering_def[i_f2py++].data = pre_center; + f2py_third_order_centering_def[i_f2py++].data = assign; + f2py_third_order_centering_def[i_f2py++].data = within_dmax; + f2py_third_order_centering_def[i_f2py++].data = compute_perimeter; + f2py_third_order_centering_def[i_f2py++].data = three_to_one_len; + f2py_third_order_centering_def[i_f2py++].data = three_to_one; + f2py_third_order_centering_def[i_f2py++].data = one_to_three_len; + f2py_third_order_centering_def[i_f2py++].data = one_to_three; + f2py_third_order_centering_def[i_f2py++].data = min_el_wise_2; + f2py_third_order_centering_def[i_f2py++].data = max_el_wise_2; + f2py_third_order_centering_def[i_f2py++].data = min_el_wise_3; + f2py_third_order_centering_def[i_f2py++].data = max_el_wise_3; + f2py_third_order_centering_def[i_f2py++].data = cryst_to_cart; +} +extern void F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_centering(void) { + F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(f2py_setup_third_order_centering); +} + + +static FortranDataDef f2py_third_order_cond_centering_def[] = { + {"check_permutation_symmetry",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry,doc_f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry}, + {"apply_permutation_symmetry",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry,doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry}, + {"apply_permutation_symmetry_local",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local,doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local}, + {"number_of_triplets",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets,doc_f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets}, + {"find_triplets",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_find_triplets,doc_f2py_rout_thirdorder_third_order_cond_centering_find_triplets}, + {"distribute_fc3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3,doc_f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3}, + {"apply_asr",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_apply_asr,doc_f2py_rout_thirdorder_third_order_cond_centering_apply_asr}, + {"find_unique_rvec",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec,doc_f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec}, + {"norm",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_norm,doc_f2py_rout_thirdorder_third_order_cond_centering_norm}, + {"norma2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_norma2,doc_f2py_rout_thirdorder_third_order_cond_centering_norma2}, + {"norma3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_norma3,doc_f2py_rout_thirdorder_third_order_cond_centering_norma3}, + {"dot",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_dot,doc_f2py_rout_thirdorder_third_order_cond_centering_dot}, + {NULL} +}; + +static void f2py_setup_third_order_cond_centering(char *check_permutation_symmetry,char *apply_permutation_symmetry,char *apply_permutation_symmetry_local,char *number_of_triplets,char *find_triplets,char *distribute_fc3,char *apply_asr,char *find_unique_rvec,char *norm,char *norma2,char *norma3,char *dot) { + int i_f2py=0; + f2py_third_order_cond_centering_def[i_f2py++].data = check_permutation_symmetry; + f2py_third_order_cond_centering_def[i_f2py++].data = apply_permutation_symmetry; + f2py_third_order_cond_centering_def[i_f2py++].data = apply_permutation_symmetry_local; + f2py_third_order_cond_centering_def[i_f2py++].data = number_of_triplets; + f2py_third_order_cond_centering_def[i_f2py++].data = find_triplets; + f2py_third_order_cond_centering_def[i_f2py++].data = distribute_fc3; + f2py_third_order_cond_centering_def[i_f2py++].data = apply_asr; + f2py_third_order_cond_centering_def[i_f2py++].data = find_unique_rvec; + f2py_third_order_cond_centering_def[i_f2py++].data = norm; + f2py_third_order_cond_centering_def[i_f2py++].data = norma2; + f2py_third_order_cond_centering_def[i_f2py++].data = norma3; + f2py_third_order_cond_centering_def[i_f2py++].data = dot; +} +extern void F_FUNC_US(f2pyinitthird_order_cond_centering,F2PYINITTHIRD_ORDER_COND_CENTERING)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_cond_centering(void) { + F_FUNC_US(f2pyinitthird_order_cond_centering,F2PYINITTHIRD_ORDER_COND_CENTERING)(f2py_setup_third_order_cond_centering); +} + + +static FortranDataDef f2py_third_order_cond_def[] = { + {"interpol_v2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_interpol_v2,doc_f2py_rout_thirdorder_third_order_cond_interpol_v2}, + {"interpol_v3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_interpol_v3,doc_f2py_rout_thirdorder_third_order_cond_interpol_v3}, + {"compute_full_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single,doc_f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single}, + {"compute_diag_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single,doc_f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single}, + {"compute_perturb_selfnrg_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single,doc_f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single}, + {"compute_spectralf_diag_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single,doc_f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single}, + {"lambda_dynamic_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single,doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single}, + {"lambda_dynamic_value_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single,doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single}, + {"calculate_spectral_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_calculate_spectral_function,doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function}, + {"calculate_spectral_function_mode_mixing",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing,doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing}, + {"calculate_spectral_function_cartesian",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian,doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian}, + {"bose_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_bose_freq,doc_f2py_rout_thirdorder_third_order_cond_bose_freq}, + {"eq_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_eq_freq,doc_f2py_rout_thirdorder_third_order_cond_eq_freq}, + {"f_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_f_bose,doc_f2py_rout_thirdorder_third_order_cond_f_bose}, + {"df_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_df_bose,doc_f2py_rout_thirdorder_third_order_cond_df_bose}, + {"gaussian_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_gaussian_function,doc_f2py_rout_thirdorder_third_order_cond_gaussian_function}, + {"eliminate_transl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_eliminate_transl,doc_f2py_rout_thirdorder_third_order_cond_eliminate_transl}, + {"cinv",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_cinv,doc_f2py_rout_thirdorder_third_order_cond_cinv}, + {NULL} +}; + +static void f2py_setup_third_order_cond(char *interpol_v2,char *interpol_v3,char *compute_full_dynamic_bubble_single,char *compute_diag_dynamic_bubble_single,char *compute_perturb_selfnrg_single,char *compute_spectralf_diag_single,char *lambda_dynamic_single,char *lambda_dynamic_value_single,char *calculate_spectral_function,char *calculate_spectral_function_mode_mixing,char *calculate_spectral_function_cartesian,char *bose_freq,char *eq_freq,char *f_bose,char *df_bose,char *gaussian_function,char *eliminate_transl,char *cinv) { + int i_f2py=0; + f2py_third_order_cond_def[i_f2py++].data = interpol_v2; + f2py_third_order_cond_def[i_f2py++].data = interpol_v3; + f2py_third_order_cond_def[i_f2py++].data = compute_full_dynamic_bubble_single; + f2py_third_order_cond_def[i_f2py++].data = compute_diag_dynamic_bubble_single; + f2py_third_order_cond_def[i_f2py++].data = compute_perturb_selfnrg_single; + f2py_third_order_cond_def[i_f2py++].data = compute_spectralf_diag_single; + f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_single; + f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_value_single; + f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function; + f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_mode_mixing; + f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_cartesian; + f2py_third_order_cond_def[i_f2py++].data = bose_freq; + f2py_third_order_cond_def[i_f2py++].data = eq_freq; + f2py_third_order_cond_def[i_f2py++].data = f_bose; + f2py_third_order_cond_def[i_f2py++].data = df_bose; + f2py_third_order_cond_def[i_f2py++].data = gaussian_function; + f2py_third_order_cond_def[i_f2py++].data = eliminate_transl; + f2py_third_order_cond_def[i_f2py++].data = cinv; +} +extern void F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_cond(void) { + F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(f2py_setup_third_order_cond); +} + + +static FortranDataDef f2py_third_order_bubble_def[] = { + {"compute_static_bubble",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_static_bubble,doc_f2py_rout_thirdorder_third_order_bubble_compute_static_bubble}, + {"compute_dynamic_bubble",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble,doc_f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble}, + {"compute_diag_dynamic_bubble",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble,doc_f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble}, + {"compute_perturb_selfnrg",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg,doc_f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg}, + {"compute_spectralf",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_spectralf,doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf}, + {"compute_spectralf_diag",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag,doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag}, + {"lambda",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_lambda,doc_f2py_rout_thirdorder_third_order_bubble_lambda}, + {"lambda_dynamic",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_lambda_dynamic,doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic}, + {"lambda_dynamic_value",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value,doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value}, + {"bose_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_bose_freq,doc_f2py_rout_thirdorder_third_order_bubble_bose_freq}, + {"f_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_f_bose,doc_f2py_rout_thirdorder_third_order_bubble_f_bose}, + {"df_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_df_bose,doc_f2py_rout_thirdorder_third_order_bubble_df_bose}, + {"invzmat",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_invzmat,doc_f2py_rout_thirdorder_third_order_bubble_invzmat}, + {"eliminate_transl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_eliminate_transl,doc_f2py_rout_thirdorder_third_order_bubble_eliminate_transl}, + {NULL} +}; + +static void f2py_setup_third_order_bubble(char *compute_static_bubble,char *compute_dynamic_bubble,char *compute_diag_dynamic_bubble,char *compute_perturb_selfnrg,char *compute_spectralf,char *compute_spectralf_diag,char *lambda,char *lambda_dynamic,char *lambda_dynamic_value,char *bose_freq,char *f_bose,char *df_bose,char *invzmat,char *eliminate_transl) { + int i_f2py=0; + f2py_third_order_bubble_def[i_f2py++].data = compute_static_bubble; + f2py_third_order_bubble_def[i_f2py++].data = compute_dynamic_bubble; + f2py_third_order_bubble_def[i_f2py++].data = compute_diag_dynamic_bubble; + f2py_third_order_bubble_def[i_f2py++].data = compute_perturb_selfnrg; + f2py_third_order_bubble_def[i_f2py++].data = compute_spectralf; + f2py_third_order_bubble_def[i_f2py++].data = compute_spectralf_diag; + f2py_third_order_bubble_def[i_f2py++].data = lambda; + f2py_third_order_bubble_def[i_f2py++].data = lambda_dynamic; + f2py_third_order_bubble_def[i_f2py++].data = lambda_dynamic_value; + f2py_third_order_bubble_def[i_f2py++].data = bose_freq; + f2py_third_order_bubble_def[i_f2py++].data = f_bose; + f2py_third_order_bubble_def[i_f2py++].data = df_bose; + f2py_third_order_bubble_def[i_f2py++].data = invzmat; + f2py_third_order_bubble_def[i_f2py++].data = eliminate_transl; +} +extern void F_FUNC_US(f2pyinitthird_order_bubble,F2PYINITTHIRD_ORDER_BUBBLE)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); +static void f2py_init_third_order_bubble(void) { + F_FUNC_US(f2pyinitthird_order_bubble,F2PYINITTHIRD_ORDER_BUBBLE)(f2py_setup_third_order_bubble); +} + + +static FortranDataDef f2py_third_order_interpol_def[] = { + {"interpol",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_interpol_interpol,doc_f2py_rout_thirdorder_third_order_interpol_interpol}, + {NULL} +}; + +static void f2py_setup_third_order_interpol(char *interpol) { + int i_f2py=0; + f2py_third_order_interpol_def[i_f2py++].data = interpol; +} +extern void F_FUNC_US(f2pyinitthird_order_interpol,F2PYINITTHIRD_ORDER_INTERPOL)(void (*)(char *)); +static void f2py_init_third_order_interpol(void) { + F_FUNC_US(f2pyinitthird_order_interpol,F2PYINITTHIRD_ORDER_INTERPOL)(f2py_setup_third_order_interpol); +} + +/*need_f90modhooks*/ + +/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ + +/******************* See f2py2e/common_rules.py: buildhooks *******************/ + +/*need_commonhooks*/ + +/**************************** See f2py2e/rules.py ****************************/ + +static FortranDataDef f2py_routine_defs[] = { + +/*eof routine_defs*/ + {NULL} +}; + +static PyMethodDef f2py_module_methods[] = { + + {NULL,NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "thirdorder", + NULL, + -1, + f2py_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit_thirdorder(void) { + int i; + PyObject *m,*d, *s, *tmp; + m = thirdorder_module = PyModule_Create(&moduledef); + Py_SET_TYPE(&PyFortran_Type, &PyType_Type); + import_array(); + if (PyErr_Occurred()) + {PyErr_SetString(PyExc_ImportError, "can't initialize module thirdorder (failed to import numpy)"); return m;} + d = PyModule_GetDict(m); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + s = PyUnicode_FromString( + "This module 'thirdorder' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" +"Fortran 90/95 modules:\n"" third_order_asr --- perm_initialized,p,r2index_initialized,index_blocks_r2,num_blocks_r2,initialize_r2index(),initialize_perm(),geq(),f(),impose_perm_sym(),impose_asr_3rd(),impose_asr()"" third_order_centering --- analysis(),center(),center_sparse(),pre_center(),assign(),within_dmax(),compute_perimeter(),three_to_one_len(),three_to_one(),one_to_three_len(),one_to_three(),min_el_wise_2(),max_el_wise_2(),min_el_wise_3(),max_el_wise_3(),cryst_to_cart()"" third_order_cond_centering --- check_permutation_symmetry(),apply_permutation_symmetry(),apply_permutation_symmetry_local(),number_of_triplets(),find_triplets(),distribute_fc3(),apply_asr(),find_unique_rvec(),norm(),norma2(),norma3(),dot()"" third_order_cond --- interpol_v2(),interpol_v3(),compute_full_dynamic_bubble_single(),compute_diag_dynamic_bubble_single(),compute_perturb_selfnrg_single(),compute_spectralf_diag_single(),lambda_dynamic_single(),lambda_dynamic_value_single(),calculate_spectral_function(),calculate_spectral_function_mode_mixing(),calculate_spectral_function_cartesian(),bose_freq(),eq_freq(),f_bose(),df_bose(),gaussian_function(),eliminate_transl(),cinv()"" third_order_bubble --- compute_static_bubble(),compute_dynamic_bubble(),compute_diag_dynamic_bubble(),compute_perturb_selfnrg(),compute_spectralf(),compute_spectralf_diag(),lambda(),lambda_dynamic(),lambda_dynamic_value(),bose_freq(),f_bose(),df_bose(),invzmat(),eliminate_transl()"" third_order_interpol --- interpol()""."); + PyDict_SetItemString(d, "__doc__", s); + Py_DECREF(s); + s = PyUnicode_FromString("1.26.4"); + PyDict_SetItemString(d, "__f2py_numpy_version__", s); + Py_DECREF(s); + thirdorder_error = PyErr_NewException ("thirdorder.error", NULL, NULL); + /* + * Store the error object inside the dict, so that it could get deallocated. + * (in practice, this is a module, so it likely will not and cannot.) + */ + PyDict_SetItemString(d, "_thirdorder_error", thirdorder_error); + Py_DECREF(thirdorder_error); + for(i=0;f2py_routine_defs[i].name!=NULL;i++) { + tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); + PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); + Py_DECREF(tmp); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*eof initf2pywraphooks*/ + PyDict_SetItemString(d, "third_order_interpol", PyFortranObject_New(f2py_third_order_interpol_def,f2py_init_third_order_interpol)); + PyDict_SetItemString(d, "third_order_bubble", PyFortranObject_New(f2py_third_order_bubble_def,f2py_init_third_order_bubble)); + PyDict_SetItemString(d, "third_order_cond", PyFortranObject_New(f2py_third_order_cond_def,f2py_init_third_order_cond)); + PyDict_SetItemString(d, "third_order_cond_centering", PyFortranObject_New(f2py_third_order_cond_centering_def,f2py_init_third_order_cond_centering)); + PyDict_SetItemString(d, "third_order_centering", PyFortranObject_New(f2py_third_order_centering_def,f2py_init_third_order_centering)); + PyDict_SetItemString(d, "third_order_asr", PyFortranObject_New(f2py_third_order_asr_def,f2py_init_third_order_asr)); +/*eof initf90modhooks*/ + +/*eof initcommonhooks*/ + + +#ifdef F2PY_REPORT_ATEXIT + if (! PyErr_Occurred()) + on_exit(f2py_report_on_exit,(void*)"thirdorder"); +#endif + return m; +} +#ifdef __cplusplus +} +#endif diff --git a/meson.build.old_static_test b/meson.build.old_static_test new file mode 100644 index 00000000..097055fb --- /dev/null +++ b/meson.build.old_static_test @@ -0,0 +1,249 @@ +project('CellConstructor', + ['c','fortran'], + version: '1.5.0', + license: 'GPL', + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', + 'fortran_args=-cpp' + ] + ) + +# --- System and Python Dependencies --- +# Encuentra las instalaciones necesarias +py = import('python').find_installation(pure: false) +py_dep = py.dependency() +fc = meson.get_compiler('fortran') + +# Dependencias adicionales +#mpi_dep = dependency('mpi') +# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +lapack_dep = dependency('lapack') +blas_dep = dependency('blas') +openblas_dep = dependency('openblas', required: false) + +# --- MPI Detection --- +# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). +# Meson has a built-in MPI module. +mpi_args = [] +mpi_link_args = [] +mpi_compile_args = [] +has_mpi = false + +# Attempts to find the MPI dependency. +# You can specify a specific MPI compiler with the 'mpi_compiler' parameter +# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. +# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. +#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) +mpi_dep = dependency('mpi', required: false) + +if mpi_dep.found() + message('MPI environment detected correctly.') + has_mpi = true + # Meson handles adding appropriate flags. We just add the define. + # If you need specific MPI flags beyond what Meson adds automatically, + # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() + # and add them to extra_compile_args/extra_link_args. + mpi_compile_args += ['-D_MPI'] +else + # Here you can add warning logic if MPI is not found. + # Meson prints a warning if required: true and it is not found. + # For required: false, you can print your own warning. + warning('No MPI compiler found, please ensure MPI is installed and configured.') + warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') +endif +# Busca la librería quadmath, si está disponible +quadmath_dep = fc.find_library('quadmath', required: false) + +# --- CONFIGURACIÓN DE NUMPY --- +# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +incdir_numpy = run_command(py, + ['-c', 'import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +# f2py también requiere la cabecera fortranobject.h +incdir_f2py = run_command(py, + ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- +#if openblas_dep.found() +# message('openblas environment detected correctly.') +# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] +#else +# warning('No openblas found.') + list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] +#endif +# --- Definición de cada extensión de Python (Fortran) --- + +# Extensión 'symph' + +# Compilación del módulo Fortran: symph +fortran_sources_symph = [ + 'FModules/constants.f90', + 'FModules/error_handler.f90', + 'FModules/get_latvec.f90', + 'FModules/io_global.f90', + 'FModules/rotate_and_add_dyn.f90', + 'FModules/smallgq.f90', + 'FModules/symm_matrix.f90', + 'FModules/contract_two_phonon_propagator.f90', + 'FModules/fc_supercell_from_dyn.f90', + 'FModules/get_q_grid_fast.f90', + 'FModules/kind.f90', + 'FModules/star_q.f90', + 'FModules/symvector.f90', + 'FModules/cryst_to_car.f90', + 'FModules/flush_unit.f90', + 'FModules/get_translations.f90', + 'FModules/q2qstar_out.f90', + 'FModules/set_asr.f90', + 'FModules/symdynph_gq_new.f90', + 'FModules/trntnsc.f90', + 'FModules/eff_charge_interp.f90', + 'FModules/from_matdyn.f90', + 'FModules/interp.f90', + 'FModules/q_gen.f90', + 'FModules/set_tau.f90', + 'FModules/symm_base.f90', + 'FModules/unwrap_tensors.f90', + 'FModules/eqvect.f90', + 'FModules/get_equivalent_atoms.f90', + 'FModules/invmat.f90', + 'FModules/recips.f90', + 'FModules/sgam_ph.f90', + 'FModules/symmetry_high_rank.f90' +] + +symph_fortran_static_lib = static_library('symph_lib', fortran_sources_symph) + +py.extension_module('symph', + fortran_sources_symph, + include_directories: inc_np, + dependencies: list_dep, + link_with: symph_fortran_static_lib, + install: true +) + +# Extensión 'secondorder' + +# Compilación del módulo Fortran: secondorder +fortran_sources_secondorder = [ + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +] + +secondorder_fortran_static_lib = static_library('secondorder_lib', fortran_sources_secondorder) + +py.extension_module('secondorder', + fortran_sources_secondorder, + include_directories: inc_np, + dependencies: list_dep, + link_with: secondorder_fortran_static_lib, + install: true +) + +# Extensión 'thirdorder' + +# Compilación del módulo Fortran: thirdorder + +fortran_sources_thirdorder = [ + 'FModules/third_order_ASR.f90', + 'FModules/third_order_centering.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_dynbubble.f90', + 'FModules/third_order_interpol.f90' +] + +thirdorder_fortran_static_lib = static_library('thirdorder_lib', fortran_sources_thirdorder) + +py.extension_module('thirdorder', + fortran_sources_thirdorder, + include_directories: inc_np, + dependencies: list_dep, + link_with: thirdorder_fortran_static_lib, + install: true +) + +# Extensión 'thermal_conductivity' + +fortran_sources_thermal_conductivity = [ +'FModules/get_scattering_q_grid.f90', +'FModules/third_order_cond.f90', +'FModules/third_order_cond_centering.f90', +'FModules/get_lf.f90' +] + +thermal_conductivity_fortran_static_lib = static_library('thermal_conductivity_lib', fortran_sources_thermal_conductivity) + +py.extension_module('thermal_conductivity', + fortran_sources_thermal_conductivity, + include_directories: inc_np, + dependencies: list_dep, + link_with: thermal_conductivity_fortran_static_lib, + install: true +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if py.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +# Compilación del módulo C: cc_linalg +c_linalg_sources = [ + 'CModules/LinAlg.c', + wrapper_file +] + +py.extension_module('cc_linalg', + c_linalg_sources, + include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + dependencies: py_dep, + install: true +) + + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: py.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +py.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From f32a40dfdd4edf6c9db247ca21518a8e4cea990f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 16 Sep 2025 13:06:38 +0200 Subject: [PATCH 114/151] update tests --- meson.build.test_f2pywrappers | 268 ++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 meson.build.test_f2pywrappers diff --git a/meson.build.test_f2pywrappers b/meson.build.test_f2pywrappers new file mode 100644 index 00000000..2f3a469c --- /dev/null +++ b/meson.build.test_f2pywrappers @@ -0,0 +1,268 @@ +project('CellConstructor', + ['c','fortran'], + version: '1.5.0', + license: 'GPL', + default_options : [ + 'warning_level=1', + 'buildtype=release', + 'fortran_args=-O2', + 'fortran_args=-cpp' + ] + ) + +# --- System and Python Dependencies --- +# Encuentra las instalaciones necesarias +py = import('python').find_installation(pure: false) +py_dep = py.dependency() +fc = meson.get_compiler('fortran') + +# Dependencias adicionales +#mpi_dep = dependency('mpi') +# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +lapack_dep = dependency('lapack') +blas_dep = dependency('blas') +openblas_dep = dependency('openblas', required: false) + +# --- MPI Detection --- +# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). +# Meson has a built-in MPI module. +mpi_args = [] +mpi_link_args = [] +mpi_compile_args = [] +has_mpi = false + +# Attempts to find the MPI dependency. +# You can specify a specific MPI compiler with the 'mpi_compiler' parameter +# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. +# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. +#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) +mpi_dep = dependency('mpi', required: false) + +if mpi_dep.found() + message('MPI environment detected correctly.') + has_mpi = true + # Meson handles adding appropriate flags. We just add the define. + # If you need specific MPI flags beyond what Meson adds automatically, + # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() + # and add them to extra_compile_args/extra_link_args. + mpi_compile_args += ['-D_MPI'] +else + # Here you can add warning logic if MPI is not found. + # Meson prints a warning if required: true and it is not found. + # For required: false, you can print your own warning. + warning('No MPI compiler found, please ensure MPI is installed and configured.') + warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') +endif +# Busca la librería quadmath, si está disponible +quadmath_dep = fc.find_library('quadmath', required: false) + +# --- CONFIGURACIÓN DE NUMPY --- +# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +incdir_numpy = run_command(py, + ['-c', 'import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +# f2py también requiere la cabecera fortranobject.h +incdir_f2py = run_command(py, + ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy, incdir_f2py) +# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- +#if openblas_dep.found() +# message('openblas environment detected correctly.') +# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] +#else +# warning('No openblas found.') + list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] +#endif +# --- Definición de cada extensión de Python (Fortran) --- + +fortranobject_c = incdir_f2py / 'fortranobject.c' + +# Extensión 'symph' + +# Compilación del módulo Fortran: symph +fortran_sources_symph = [ + 'FModules/constants.f90', + 'FModules/error_handler.f90', + 'FModules/get_latvec.f90', + 'FModules/io_global.f90', + 'FModules/rotate_and_add_dyn.f90', + 'FModules/smallgq.f90', + 'FModules/symm_matrix.f90', + 'FModules/contract_two_phonon_propagator.f90', + 'FModules/fc_supercell_from_dyn.f90', + 'FModules/get_q_grid_fast.f90', + 'FModules/kind.f90', + 'FModules/star_q.f90', + 'FModules/symvector.f90', + 'FModules/cryst_to_car.f90', + 'FModules/flush_unit.f90', + 'FModules/get_translations.f90', + 'FModules/q2qstar_out.f90', + 'FModules/set_asr.f90', + 'FModules/symdynph_gq_new.f90', + 'FModules/trntnsc.f90', + 'FModules/eff_charge_interp.f90', + 'FModules/from_matdyn.f90', + 'FModules/interp.f90', + 'FModules/q_gen.f90', + 'FModules/set_tau.f90', + 'FModules/symm_base.f90', + 'FModules/unwrap_tensors.f90', + 'FModules/eqvect.f90', + 'FModules/get_equivalent_atoms.f90', + 'FModules/invmat.f90', + 'FModules/recips.f90', + 'FModules/sgam_ph.f90', + 'FModules/symmetry_high_rank.f90' +] + +fortran_wrappers_symph = [ + 'f2py_wrappers/symph-f2pywrappers.f', + 'f2py_wrappers/symph-f2pywrappers2.f90', + 'f2py_wrappers/thirdordermodule.c' +] + +fortran_src_symph = fortran_sources_symph + fortran_wrappers_symph + +py.extension_module('symph', + fortran_src_symph, + include_directories: inc_np, + dependencies: list_dep, + install: true +) + +# Extensión 'secondorder' + +# Compilación del módulo Fortran: secondorder +fortran_sources_secondorder = [ + 'FModules/second_order_centering.f90', + 'FModules/second_order_ASR.f90' +] + +fortran_wrappers_secondorder = [ + 'f2py_wrappers/secondorder-f2pywrappers2.f90', + 'f2py_wrappers/secondordermodule.c' +] + +fortran_src_secondorder = fortran_sources_secondorder + fortran_wrappers_secondorder + +py.extension_module('secondorder', + fortran_src_secondorder, + include_directories: inc_np, + dependencies: list_dep, + install: true +) + +# Extensión 'thirdorder' + +# Compilación del módulo Fortran: thirdorder + +fortran_sources_thirdorder = [ + 'FModules/third_order_ASR.f90', + 'FModules/third_order_centering.f90', + 'FModules/third_order_cond_centering.f90', + 'FModules/third_order_cond.f90', + 'FModules/third_order_dynbubble.f90', + 'FModules/third_order_interpol.f90' +] + +fortran_wrappers_thirdorder = [ + 'f2py_wrappers/thirdordermodule.c', + 'f2py_wrappers/thirdorder-f2pywrappers2.f90' +] + +fortran_src_thirdorder = fortran_sources_thirdorder + fortran_wrappers_thirdorder + +py.extension_module('thirdorder', + fortran_src_thirdorder, + include_directories: inc_np, + dependencies: list_dep, + install: true +) + +# Extensión 'thermal_conductivity' + +fortran_sources_thermal_conductivity = [ +'FModules/get_lf.f90', +'FModules/get_scattering_q_grid.f90', +'FModules/third_order_centering.f90', +'FModules/third_order_cond.f90' +] + +fortran_wrappers_thermal_conductivity = [ + 'f2py_wrappers/thermal_conductivity-f2pywrappers2.f90', + 'f2py_wrappers/thermal_conductivitymodule.c' +] + +fortran_src_thermal_conductivity = fortran_sources_thermal_conductivity + fortran_wrappers_thermal_conductivity + +py.extension_module('thermal_conductivity', + fortran_src_thermal_conductivity, + include_directories: inc_np, + dependencies: list_dep, + install: true +) + +# --- Definición de la extensión C 'cc_linalg' --- +wrapper_file = '' +if py.version().version_compare('<3.0') + wrapper_file = 'CModules/wrapper.c' +else + wrapper_file = 'CModules/wrapper3.c' +endif + +# Compilación del módulo C: cc_linalg +c_linalg_sources = [ + 'CModules/LinAlg.c', + wrapper_file +] + +py.extension_module('cc_linalg', + c_linalg_sources, + include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + dependencies: py_dep, + install: true +) + + +# --- Instalación del paquete de Python 'cellconstructor' --- +install_data( + 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', + 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', + 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', + 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', + 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', + 'cellconstructor/Timer.py', + install_dir: py.get_install_dir() / 'cellconstructor', +) + +install_data( + 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' +) + +# --- Instalación de los scripts ejecutables --- +py.install_sources([ + 'scripts/symmetrize_dynmat.py', + 'scripts/cellconstructor_test.py', + 'scripts/view_scf_atoms.py' +]) + +# Set the tests by pytest. +pytest_exe = find_program('pytest', required: false) + +if pytest_exe.found() + test('pytest', pytest_exe, + args : ['-v'], + workdir : meson.project_source_root() + ) +else + message('pytest no encontrado; se omiten tests con pytest.') +endif From 8f11a52aca4f001d2aa35969fcd7247470520467 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Tue, 16 Sep 2025 16:18:20 +0200 Subject: [PATCH 115/151] New solution for fortranobject.c --- meson.build | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 39381a1f..1282b7eb 100644 --- a/meson.build +++ b/meson.build @@ -70,13 +70,24 @@ incdir_f2py = run_command(py, ).stdout().strip() inc_np = include_directories(incdir_numpy, incdir_f2py) + +# ===== INICIO DE LA SOLUCIÓN (VERSIÓN MODERNA) ===== +# Obtenemos la ruta base de la instalación de NumPy +numpy_path = run_command(py, + ['-c', 'import numpy; print(numpy.__path__[0])'], + check: true +).stdout().strip() +# Construimos la ruta completa al archivo fuente de f2py +f2py_c_source = join_paths(numpy_path, 'f2py', 'src', 'fortranobject.c') +# ===== FIN DE LA SOLUCIÓN ===== + # --- FIN DE LA CONFIGURACIÓN DE NUMPY --- #if openblas_dep.found() # message('openblas environment detected correctly.') # list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] #else # warning('No openblas found.') - list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] + list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep, blas_dep] #endif # --- Definición de cada extensión de Python (Fortran) --- @@ -121,6 +132,7 @@ fortran_sources_symph = [ py.extension_module('symph', fortran_sources_symph, + f2py_c_source, # <- Cambio aplicado include_directories: inc_np, dependencies: list_dep, install: true @@ -136,6 +148,7 @@ fortran_sources_secondorder = [ py.extension_module('secondorder', fortran_sources_secondorder, + f2py_c_source, # <- Cambio aplicado include_directories: inc_np, dependencies: list_dep, install: true @@ -156,6 +169,7 @@ fortran_sources_thirdorder = [ py.extension_module('thirdorder', fortran_sources_thirdorder, + f2py_c_source, # <- Cambio aplicado include_directories: inc_np, dependencies: list_dep, install: true @@ -172,6 +186,7 @@ thermal_conductivity_fortran_src = files( py.extension_module('thermal_conductivity', thermal_conductivity_fortran_src, + f2py_c_source, # <- Cambio aplicado include_directories: inc_np, dependencies: list_dep, install: true From 7611e2a5a3b6f752b2135757a558d607104b0ca9 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 08:44:09 +0200 Subject: [PATCH 116/151] Test fix --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index 1282b7eb..497004d5 100644 --- a/meson.build +++ b/meson.build @@ -133,6 +133,7 @@ fortran_sources_symph = [ py.extension_module('symph', fortran_sources_symph, f2py_c_source, # <- Cambio aplicado + c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true @@ -149,6 +150,7 @@ fortran_sources_secondorder = [ py.extension_module('secondorder', fortran_sources_secondorder, f2py_c_source, # <- Cambio aplicado + c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true @@ -170,6 +172,7 @@ fortran_sources_thirdorder = [ py.extension_module('thirdorder', fortran_sources_thirdorder, f2py_c_source, # <- Cambio aplicado + c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true @@ -187,6 +190,7 @@ thermal_conductivity_fortran_src = files( py.extension_module('thermal_conductivity', thermal_conductivity_fortran_src, f2py_c_source, # <- Cambio aplicado + c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true From 76b41e300b2a7da313490ab8f41691f2efab32ae Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 09:03:56 +0200 Subject: [PATCH 117/151] Removing manual configuration, lets meson work with all automatically. --- meson.build | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index 497004d5..ce4aab45 100644 --- a/meson.build +++ b/meson.build @@ -73,18 +73,18 @@ inc_np = include_directories(incdir_numpy, incdir_f2py) # ===== INICIO DE LA SOLUCIÓN (VERSIÓN MODERNA) ===== # Obtenemos la ruta base de la instalación de NumPy -numpy_path = run_command(py, - ['-c', 'import numpy; print(numpy.__path__[0])'], - check: true -).stdout().strip() +#numpy_path = run_command(py, +# ['-c', 'import numpy; print(numpy.__path__[0])'], +# check: true +#).stdout().strip() # Construimos la ruta completa al archivo fuente de f2py -f2py_c_source = join_paths(numpy_path, 'f2py', 'src', 'fortranobject.c') +#f2py_c_source = join_paths(numpy_path, 'f2py', 'src', 'fortranobject.c') # ===== FIN DE LA SOLUCIÓN ===== # --- FIN DE LA CONFIGURACIÓN DE NUMPY --- #if openblas_dep.found() # message('openblas environment detected correctly.') -# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] +# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep, blas_dep] #else # warning('No openblas found.') list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep, blas_dep] @@ -132,8 +132,8 @@ fortran_sources_symph = [ py.extension_module('symph', fortran_sources_symph, - f2py_c_source, # <- Cambio aplicado - c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" +# f2py_c_source, # <- Cambio aplicado +# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true @@ -149,8 +149,8 @@ fortran_sources_secondorder = [ py.extension_module('secondorder', fortran_sources_secondorder, - f2py_c_source, # <- Cambio aplicado - c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" +# f2py_c_source, # <- Cambio aplicado +# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true @@ -171,8 +171,8 @@ fortran_sources_thirdorder = [ py.extension_module('thirdorder', fortran_sources_thirdorder, - f2py_c_source, # <- Cambio aplicado - c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" +# f2py_c_source, # <- Cambio aplicado +# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true @@ -189,8 +189,8 @@ thermal_conductivity_fortran_src = files( py.extension_module('thermal_conductivity', thermal_conductivity_fortran_src, - f2py_c_source, # <- Cambio aplicado - c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" +# f2py_c_source, # <- Cambio aplicado +# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true From 94281cb9b57b76236b2399d29d0435e3528d6f03 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 09:10:57 +0200 Subject: [PATCH 118/151] Remove some unused files --- f2py_wrappers/README.md | 18 - f2py_wrappers/secondorder-f2pywrappers2.f90 | 137 - f2py_wrappers/secondordermodule.c | 2252 --- f2py_wrappers/symph-f2pywrappers.f | 27 - f2py_wrappers/symph-f2pywrappers2.f90 | 275 - f2py_wrappers/symphmodule.c | 13669 --------------- .../thermal_conductivity-f2pywrappers2.f90 | 400 - f2py_wrappers/thermal_conductivitymodule.c | 13977 ---------------- f2py_wrappers/thirdorder-f2pywrappers2.f90 | 585 - f2py_wrappers/thirdordermodule.c | 13066 --------------- meson.build.old_100 | 230 - meson.build.old_101 | 231 - 12 files changed, 44867 deletions(-) delete mode 100644 f2py_wrappers/README.md delete mode 100644 f2py_wrappers/secondorder-f2pywrappers2.f90 delete mode 100644 f2py_wrappers/secondordermodule.c delete mode 100644 f2py_wrappers/symph-f2pywrappers.f delete mode 100644 f2py_wrappers/symph-f2pywrappers2.f90 delete mode 100644 f2py_wrappers/symphmodule.c delete mode 100644 f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 delete mode 100644 f2py_wrappers/thermal_conductivitymodule.c delete mode 100644 f2py_wrappers/thirdorder-f2pywrappers2.f90 delete mode 100644 f2py_wrappers/thirdordermodule.c delete mode 100644 meson.build.old_100 delete mode 100644 meson.build.old_101 diff --git a/f2py_wrappers/README.md b/f2py_wrappers/README.md deleted file mode 100644 index 0928b801..00000000 --- a/f2py_wrappers/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# This directory contains the f2py constructed Wrappers for meson -If you change the contsnts of the FORTRAN sources take the corresponden files from the f2py runs: - -```Bash -python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c FModules/third_order_ASR.f90 FModules/third_order_centering.f90 FModules/third_order_cond_centering.f90 FModules/third_order_cond.f90 FModules/third_order_dynbubble.f90 FModules/third_order_interpol.f90 -m thirdorder -``` - -```Bash -python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c FModules/second_order_centering.f90 FModules/second_order_ASR.f90 -m secondorder -``` - -```Bash -python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c constants.f90 error_handler.f90 get_latvec.f90 io_global.f90 rotate_and_add_dyn.f90 smallgq.f90 symm_matrix.f90 contract_two_phonon_propagator.f90 fc_supercell_from_dyn.f90 get_q_grid_fast.f90 kind.f90 star_q.f90 symvector.f90 cryst_to_car.f90 flush_unit.f90 get_translations.f90 q2qstar_out.f90 set_asr.f90 symdynph_gq_new.f90 trntnsc.f90 eff_charge_interp.f90 from_matdyn.f90 interp.f90 q_gen.f90 set_tau.f90 symm_base.f90 unwrap_tensors.f90 eqvect.f90 get_equivalent_atoms.f90 invmat.f90 recips.f90 sgam_ph.f90 symmetry_high_rank.f90 -m symph -``` - -```Bash -python -m numpy.f2py --backend meson --build-dir meson_builddir --dep mpi -c get_lf.f90 get_scattering_q_grid.f90 third_order_centering.f90 third_order_cond.f90 -m thermal_conductivity -``` diff --git a/f2py_wrappers/secondorder-f2pywrappers2.f90 b/f2py_wrappers/secondorder-f2pywrappers2.f90 deleted file mode 100644 index 5a3a970b..00000000 --- a/f2py_wrappers/secondorder-f2pywrappers2.f90 +++ /dev/null @@ -1,137 +0,0 @@ -! -*- f90 -*- -! This file is autogenerated with f2py (version:1.26.4) -! It contains Fortran 90 wrappers to fortran functions. - - subroutine f2pywrap_second_order_centering_within_dmax (within_dma& - &xf2pywrap, v1, v2, d1, d2, tol) - use second_order_centering, only : within_dmax - real(kind=8) d1 - real(kind=8) d2 - real(kind=8) tol - real(kind=8) v1(3) - real(kind=8) v2(3) - logical within_dmaxf2pywrap - within_dmaxf2pywrap = .not.(.not.within_dmax(v1, v2, d1, d2, tol)) - end subroutine f2pywrap_second_order_centering_within_dmax - subroutine f2pywrap_second_order_centering_compute_perimeter (comp& - &ute_perimeterf2pywrap, v1, v2) - use second_order_centering, only : compute_perimeter - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) compute_perimeterf2pywrap - compute_perimeterf2pywrap = compute_perimeter(v1, v2) - end subroutine f2pywrap_second_order_centering_compute_perimeter - subroutine f2pywrap_second_order_centering_cryst_to_cart (cryst_to& - &_cartf2pywrap, v, alat) - use second_order_centering, only : cryst_to_cart - integer v(3) - real(kind=8) alat(3,3) - real(kind=8) cryst_to_cartf2pywrap(3) - cryst_to_cartf2pywrap = cryst_to_cart(v, alat) - end subroutine f2pywrap_second_order_centering_cryst_to_cart - - subroutine f2pyinitsecond_order_centering(f2pysetupfunc) - use second_order_centering, only : analysis - use second_order_centering, only : center - interface - subroutine f2pywrap_second_order_centering_within_dmax (within_dma& - &xf2pywrap, v1, v2, d1, d2, tol) - real(kind=8) d1 - real(kind=8) d2 - real(kind=8) tol - real(kind=8) v1(3) - real(kind=8) v2(3) - logical within_dmaxf2pywrap - end subroutine f2pywrap_second_order_centering_within_dmax - subroutine f2pywrap_second_order_centering_compute_perimeter (comp& - &ute_perimeterf2pywrap, v1, v2) - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) compute_perimeterf2pywrap - end subroutine f2pywrap_second_order_centering_compute_perimeter - subroutine f2pywrap_second_order_centering_cryst_to_cart (cryst_to& - &_cartf2pywrap, v, alat) - integer v(3) - real(kind=8) alat(3,3) - real(kind=8) cryst_to_cartf2pywrap(3) - end subroutine f2pywrap_second_order_centering_cryst_to_cart - end interface - external f2pysetupfunc - call f2pysetupfunc(analysis,center,f2pywrap_second_order_centering& - &_within_dmax,f2pywrap_second_order_centering_compute_perimeter,f2p& - &ywrap_second_order_centering_cryst_to_cart) - end subroutine f2pyinitsecond_order_centering - - subroutine f2py_second_order_asr_getdims_p(r,s,f2pysetdata,flag) - use second_order_asr, only: d => 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_second_order_asr_getdims_p - subroutine f2pywrap_second_order_asr_geq (geqf2pywrap, v1, v2, lat& - &, pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) - use second_order_asr, only : geq - logical pbc - integer f2py_v1_d0 - integer f2py_v2_d0 - integer f2py_lat_d0 - integer v1(f2py_v1_d0) - integer v2(f2py_v2_d0) - integer lat(f2py_lat_d0) - logical geqf2pywrap - geqf2pywrap = .not.(.not.geq(v1, v2, lat, pbc)) - end subroutine f2pywrap_second_order_asr_geq - - subroutine f2pyinitsecond_order_asr(f2pysetupfunc) - use second_order_asr, only : perm_initialized - use second_order_asr, only : p - use second_order_asr, only : initialize_perm - use second_order_asr, only : clear_all - use second_order_asr, only : impose_perm_sym - use second_order_asr, only : impose_asr_2nd - use second_order_asr, only : impose_asr - interface - subroutine f2pywrap_second_order_asr_geq (geqf2pywrap, v1, v2, lat& - &, pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) - logical pbc - integer f2py_v1_d0 - integer f2py_v2_d0 - integer f2py_lat_d0 - integer v1(f2py_v1_d0) - integer v2(f2py_v2_d0) - integer lat(f2py_lat_d0) - logical geqf2pywrap - end subroutine f2pywrap_second_order_asr_geq - end interface - external f2pysetupfunc - external f2py_second_order_asr_getdims_p - call f2pysetupfunc(perm_initialized,f2py_second_order_asr_getdims_& - &p,initialize_perm,clear_all,f2pywrap_second_order_asr_geq,impose_p& - &erm_sym,impose_asr_2nd,impose_asr) - end subroutine f2pyinitsecond_order_asr - - diff --git a/f2py_wrappers/secondordermodule.c b/f2py_wrappers/secondordermodule.c deleted file mode 100644 index 7420ff59..00000000 --- a/f2py_wrappers/secondordermodule.c +++ /dev/null @@ -1,2252 +0,0 @@ -/* File: secondordermodule.c - * This file is auto-generated with f2py (version:1.26.4). - * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, - * written by Pearu Peterson . - * Generation date: Fri Sep 12 12:33:34 2025 - * Do not edit this file directly unless you know what you are doing!!! - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ - -/* Unconditionally included */ -#include -#include - -/*********************** See f2py2e/cfuncs.py: includes ***********************/ -#include "fortranobject.h" -#include - -/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ -static PyObject *secondorder_error; -static PyObject *secondorder_module; - -/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ -/*need_typedefs*/ - -/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ -/*need_typedefs_generated*/ - -/********************** See f2py2e/cfuncs.py: cppmacros **********************/ - -/* See fortranobject.h for definitions. The macros here are provided for BC. */ -#define rank f2py_rank -#define shape f2py_shape -#define fshape f2py_shape -#define len f2py_len -#define flen f2py_flen -#define slen f2py_slen -#define size f2py_size - - -#define CHECKSCALAR(check,tcheck,name,show,var)\ - if (!(check)) {\ - char errstring[256];\ - sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ - PyErr_SetString(secondorder_error,errstring);\ - /*goto capi_fail;*/\ - } else - -#ifdef DEBUGCFUNCS -#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); -#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ - PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ - fprintf(stderr,"\n"); -#else -#define CFUNCSMESS(mess) -#define CFUNCSMESSPY(mess,obj) -#endif - - -#ifndef max -#define max(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) ((a < b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a,b) ((a < b) ? (a) : (b)) -#endif - - -#define CHECKARRAY(check,tcheck,name) \ - if (!(check)) {\ - PyErr_SetString(secondorder_error,"("tcheck") failed for "name);\ - /*goto capi_fail;*/\ - } else - -#if defined(PREPEND_FORTRAN) -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F -#else -#define F_FUNC(f,F) _##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F##_ -#else -#define F_FUNC(f,F) _##f##_ -#endif -#endif -#else -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F -#else -#define F_FUNC(f,F) f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F##_ -#else -#define F_FUNC(f,F) f##_ -#endif -#endif -#endif -#if defined(UNDERSCORE_G77) -#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) -#else -#define F_FUNC_US(f,F) F_FUNC(f,F) -#endif - - -/************************ See f2py2e/cfuncs.py: cfuncs ************************/ - -static int -int_from_pyobj(int* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - - if (PyLong_Check(obj)) { - *v = Npy__PyLong_AsInt(obj); - return !(*v == -1 && PyErr_Occurred()); - } - - tmp = PyNumber_Long(obj); - if (tmp) { - *v = Npy__PyLong_AsInt(tmp); - Py_DECREF(tmp); - return !(*v == -1 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (int_from_pyobj(v, tmp, errmess)) { - Py_DECREF(tmp); - return 1; - } - Py_DECREF(tmp); - } - - { - PyObject* err = PyErr_Occurred(); - if (err == NULL) { - err = secondorder_error; - } - PyErr_SetString(err, errmess); - } - return 0; -} - - -static int -double_from_pyobj(double* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - if (PyFloat_Check(obj)) { - *v = PyFloat_AsDouble(obj); - return !(*v == -1.0 && PyErr_Occurred()); - } - - tmp = PyNumber_Float(obj); - if (tmp) { - *v = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return !(*v == -1.0 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} - Py_DECREF(tmp); - } - { - PyObject* err = PyErr_Occurred(); - if (err==NULL) err = secondorder_error; - PyErr_SetString(err,errmess); - } - return 0; -} - - -/********************* See f2py2e/cfuncs.py: userincludes *********************/ -/*need_userincludes*/ - -/********************* See f2py2e/capi_rules.py: usercode *********************/ - - -/* See f2py2e/rules.py */ -/*eof externroutines*/ - -/******************** See f2py2e/capi_rules.py: usercode1 ********************/ - - -/******************* See f2py2e/cb_rules.py: buildcallback *******************/ -/*need_callbacks*/ - -/*********************** See f2py2e/rules.py: buildapi ***********************/ - -/********************************** analysis **********************************/ -static char doc_f2py_rout_secondorder_second_order_centering_analysis[] = "\ -weight,xr2 = analysis(far,tol,dmax,sc_size,xr2_list,alat,tau,tensor,[nat,n_blocks])\n\nWrapper for ``analysis``.\ -\n\nParameters\n----------\n" -"far : input int\n" -"tol : input float\n" -"dmax : input rank-1 array('d') with bounds (nat)\n" -"sc_size : input rank-1 array('i') with bounds (3)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"tau : input rank-2 array('d') with bounds (nat,3)\n" -"tensor : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(dmax, 0)\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"\nReturns\n-------\n" -"weight : rank-3 array('i') with bounds (nat,nat,n_blocks)\n" -"xr2 : rank-5 array('i') with bounds (3,1 + 4 * far + 4 * far * far,nat,nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_centering_analysis(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,int*,int*,double*,double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int far = 0; - PyObject *far_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - double *dmax = NULL; - npy_intp dmax_Dims[1] = {-1}; - const int dmax_Rank = 1; - PyArrayObject *capi_dmax_as_array = NULL; - int capi_dmax_intent = 0; - PyObject *dmax_capi = Py_None; - int *sc_size = NULL; - npy_intp sc_size_Dims[1] = {-1}; - const int sc_size_Rank = 1; - PyArrayObject *capi_sc_size_as_array = NULL; - int capi_sc_size_intent = 0; - PyObject *sc_size_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tensor = NULL; - npy_intp tensor_Dims[3] = {-1, -1, -1}; - const int tensor_Rank = 3; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[3] = {-1, -1, -1}; - const int weight_Rank = 3; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - int *xr2 = NULL; - npy_intp xr2_Dims[5] = {-1, -1, -1, -1, -1}; - const int xr2_Rank = 5; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"far","tol","dmax","sc_size","xr2_list","alat","tau","tensor","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:secondorder.second_order_centering.analysis",\ - capi_kwlist,&far_capi,&tol_capi,&dmax_capi,&sc_size_capi,&xr2_list_capi,&alat_capi,&tau_capi,&tensor_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"secondorder.second_order_centering.analysis() 1st argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable dmax */ - ; - capi_dmax_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 3rd argument `dmax`"; - capi_dmax_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dmax_Dims,dmax_Rank, capi_dmax_intent,dmax_capi,capi_errmess); - if (capi_dmax_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dmax = (double *)(PyArray_DATA(capi_dmax_as_array)); - - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 6th argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 5th argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"secondorder.second_order_centering.analysis() 2nd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable sc_size */ - sc_size_Dims[0]=3; - capi_sc_size_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 4th argument `sc_size`"; - capi_sc_size_as_array = ndarray_from_pyobj( NPY_INT,1,sc_size_Dims,sc_size_Rank, capi_sc_size_intent,sc_size_capi,capi_errmess); - if (capi_sc_size_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sc_size = (int *)(PyArray_DATA(capi_sc_size_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(dmax, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_centering.analysis() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(dmax, 0) == nat,"shape(dmax, 0) == nat","1st keyword nat","analysis:nat=%d",nat) { - /* Processing variable tau */ - tau_Dims[0]=nat,tau_Dims[1]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 7th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_centering.analysis() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","analysis:n_blocks=%d",n_blocks) { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_blocks; - capi_weight_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the hidden `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,Py_None,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=1 + 4 * far + 4 * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_blocks; - capi_xr2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the hidden `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,Py_None,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - /* Processing variable tensor */ - tensor_Dims[0]=3 * nat,tensor_Dims[1]=3 * nat,tensor_Dims[2]=n_blocks; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.analysis: failed to create array from the 8th argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&far,&tol,dmax,sc_size,xr2_list,alat,tau,tensor,weight,xr2,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NN",capi_weight_as_array,capi_xr2_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*CHECKSCALAR(shape(dmax, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_sc_size_as_array!=sc_size_capi) { - Py_XDECREF(capi_sc_size_as_array); } - } /* if (capi_sc_size_as_array == NULL) ... else of sc_size */ - /* End of cleaning variable sc_size */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - if((PyObject *)capi_dmax_as_array!=dmax_capi) { - Py_XDECREF(capi_dmax_as_array); } - } /* if (capi_dmax_as_array == NULL) ... else of dmax */ - /* End of cleaning variable dmax */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of analysis ******************************/ - -/*********************************** center ***********************************/ -static char doc_f2py_rout_secondorder_second_order_centering_center[] = "\ -centered = center(original,weight,xr2_list,xr2,far,[nat,n_blocks,n_blocks_old])\n\nWrapper for ``center``.\ -\n\nParameters\n----------\n" -"original : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks_old)\n" -"weight : input rank-3 array('i') with bounds (nat,nat,n_blocks_old)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2 : input rank-5 array('i') with bounds (3,1 + 4 * far + 4 * far * far,nat,nat,n_blocks_old)\n" -"far : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(original, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"n_blocks_old : input int, optional\n Default: shape(original, 2)\n" -"\nReturns\n-------\n" -"centered : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_centering_center(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *original = NULL; - npy_intp original_Dims[3] = {-1, -1, -1}; - const int original_Rank = 3; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[3] = {-1, -1, -1}; - const int weight_Rank = 3; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - PyObject *weight_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[5] = {-1, -1, -1, -1, -1}; - const int xr2_Rank = 5; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[3] = {-1, -1, -1}; - const int centered_Rank = 3; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int far = 0; - PyObject *far_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int n_blocks_old = 0; - PyObject *n_blocks_old_capi = Py_None; - static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","far","nat","n_blocks","n_blocks_old",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OOO:secondorder.second_order_centering.center",\ - capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&far_capi,&nat_capi,&n_blocks_capi,&n_blocks_old_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"secondorder.second_order_centering.center() 5th argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 3rd argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable original */ - ; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 1st argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(original, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_centering.center() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_centering.center() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","center:n_blocks=%d",n_blocks) { - /* Processing variable n_blocks_old */ - if (n_blocks_old_capi == Py_None) n_blocks_old = shape(original, 2); else - f2py_success = int_from_pyobj(&n_blocks_old,n_blocks_old_capi,"secondorder.second_order_centering.center() 3rd keyword (n_blocks_old) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 2) == n_blocks_old,"shape(original, 2) == n_blocks_old","3rd keyword n_blocks_old","center:n_blocks_old=%d",n_blocks_old) { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=n_blocks; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=1 + 4 * far + 4 * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_blocks_old; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 4th argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - CHECKARRAY(shape(xr2, 1) == 1 + 4 * far + 4 * far * far,"shape(xr2, 1) == 1 + 4 * far + 4 * far * far","4th argument xr2") { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_blocks_old; - capi_weight_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.center: failed to create array from the 2nd argument `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(original,weight,xr2_list,xr2,&nat,centered,&far,&n_blocks,&n_blocks_old); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_centered_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_weight_as_array!=weight_capi) { - Py_XDECREF(capi_weight_as_array); } - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKARRAY(shape(xr2, 1) == 1 + 4 * far + 4 * far * far)*/ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKSCALAR(shape(original, 2) == n_blocks_old)*/ - } /*if (f2py_success) of n_blocks_old*/ - /* End of cleaning variable n_blocks_old */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of center *******************************/ - -/******************************** within_dmax ********************************/ -static char doc_f2py_rout_secondorder_second_order_centering_within_dmax[] = "\ -within_dmax = within_dmax(v1,v2,d1,d2,tol)\n\nWrapper for ``within_dmax``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"d1 : input float\n" -"d2 : input float\n" -"tol : input float\n" -"\nReturns\n-------\n" -"within_dmax : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_secondorder_second_order_centering_within_dmax(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int within_dmaxf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - double d1 = 0; - PyObject *d1_capi = Py_None; - double d2 = 0; - PyObject *d2_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2","d1","d2","tol",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:secondorder.second_order_centering.within_dmax",\ - capi_kwlist,&v1_capi,&v2_capi,&d1_capi,&d2_capi,&tol_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.within_dmax: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.within_dmax: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable d1 */ - f2py_success = double_from_pyobj(&d1,d1_capi,"secondorder.second_order_centering.within_dmax() 3rd argument (d1) can't be converted to double"); - if (f2py_success) { - /* Processing variable d2 */ - f2py_success = double_from_pyobj(&d2,d2_capi,"secondorder.second_order_centering.within_dmax() 4th argument (d2) can't be converted to double"); - if (f2py_success) { - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"secondorder.second_order_centering.within_dmax() 5th argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable within_dmaxf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&within_dmaxf2pywrap,v1,v2,&d1,&d2,&tol); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",within_dmaxf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable within_dmaxf2pywrap */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - } /*if (f2py_success) of d2*/ - /* End of cleaning variable d2 */ - } /*if (f2py_success) of d1*/ - /* End of cleaning variable d1 */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of within_dmax *****************************/ - -/***************************** compute_perimeter *****************************/ -static char doc_f2py_rout_secondorder_second_order_centering_compute_perimeter[] = "\ -compute_perimeter = compute_perimeter(v1,v2)\n\nWrapper for ``compute_perimeter``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"compute_perimeter : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_secondorder_second_order_centering_compute_perimeter(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double compute_perimeterf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:secondorder.second_order_centering.compute_perimeter",\ - capi_kwlist,&v1_capi,&v2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.compute_perimeter: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.compute_perimeter: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable compute_perimeterf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&compute_perimeterf2pywrap,v1,v2); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",compute_perimeterf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable compute_perimeterf2pywrap */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of compute_perimeter **************************/ - -/******************************* cryst_to_cart *******************************/ -static char doc_f2py_rout_secondorder_second_order_centering_cryst_to_cart[] = "\ -cryst_to_cart = cryst_to_cart(v,alat)\n\nWrapper for ``cryst_to_cart``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"cryst_to_cart : rank-1 array('d') with bounds (3) and cryst_to_cartf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_secondorder_second_order_centering_cryst_to_cart(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *cryst_to_cartf2pywrap = NULL; - npy_intp cryst_to_cartf2pywrap_Dims[1] = {-1}; - const int cryst_to_cartf2pywrap_Rank = 1; - PyArrayObject *capi_cryst_to_cartf2pywrap_as_array = NULL; - int capi_cryst_to_cartf2pywrap_intent = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - static char *capi_kwlist[] = {"v","alat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:secondorder.second_order_centering.cryst_to_cart",\ - capi_kwlist,&v_capi,&alat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.cryst_to_cart: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.cryst_to_cart: failed to create array from the 2nd argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable cryst_to_cartf2pywrap */ - cryst_to_cartf2pywrap_Dims[0]=3; - capi_cryst_to_cartf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_centering.cryst_to_cart: failed to create array from the hidden `cryst_to_cartf2pywrap`"; - capi_cryst_to_cartf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cryst_to_cartf2pywrap_Dims,cryst_to_cartf2pywrap_Rank, capi_cryst_to_cartf2pywrap_intent,Py_None,capi_errmess); - if (capi_cryst_to_cartf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - cryst_to_cartf2pywrap = (double *)(PyArray_DATA(capi_cryst_to_cartf2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(cryst_to_cartf2pywrap,v,alat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_cryst_to_cartf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_cryst_to_cartf2pywrap_as_array == NULL) ... else of cryst_to_cartf2pywrap */ - /* End of cleaning variable cryst_to_cartf2pywrap */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of cryst_to_cart ****************************/ - -/****************************** initialize_perm ******************************/ -static char doc_f2py_rout_secondorder_second_order_asr_initialize_perm[] = "\ -initialize_perm(r2,sclat,pbc,[n_blocks])\n\nWrapper for ``initialize_perm``.\ -\n\nParameters\n----------\n" -"r2 : input rank-2 array('i') with bounds (3,n_blocks)\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(r2, 1)"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_asr_initialize_perm(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - static char *capi_kwlist[] = {"r2","sclat","pbc","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:secondorder.second_order_asr.initialize_perm",\ - capi_kwlist,&r2_capi,&sclat_capi,&pbc_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable r2 */ - r2_Dims[0]=3; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.initialize_perm: failed to create array from the 1st argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_INT,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (int *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.initialize_perm: failed to create array from the 2nd argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(r2, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.initialize_perm() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(r2, 1) == n_blocks,"shape(r2, 1) == n_blocks","1st keyword n_blocks","initialize_perm:n_blocks=%d",n_blocks) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(r2,&n_blocks,sclat,&pbc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(r2, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of initialize_perm ***************************/ - -/********************************* clear_all *********************************/ -static char doc_f2py_rout_secondorder_second_order_asr_clear_all[] = "\ -clear_all()\n\nWrapper for ``clear_all``.\ -\n"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_asr_clear_all(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(void)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:secondorder.second_order_asr.clear_all",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of clear_all ******************************/ - -/************************************ geq ************************************/ -static char doc_f2py_rout_secondorder_second_order_asr_geq[] = "\ -geq = geq(v1,v2,lat,pbc)\n\nWrapper for ``geq``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('i') with bounds (f2py_v1_d0)\n" -"v2 : input rank-1 array('i') with bounds (f2py_v2_d0)\n" -"lat : input rank-1 array('i') with bounds (f2py_lat_d0)\n" -"pbc : input int\n" -"\nReturns\n-------\n" -"geq : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_secondorder_second_order_asr_geq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int geqf2pywrap = 0; - int *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - int *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - int *lat = NULL; - npy_intp lat_Dims[1] = {-1}; - const int lat_Rank = 1; - PyArrayObject *capi_lat_as_array = NULL; - int capi_lat_intent = 0; - PyObject *lat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - int f2py_v1_d0 = 0; - int f2py_v2_d0 = 0; - int f2py_lat_d0 = 0; - static char *capi_kwlist[] = {"v1","v2","lat","pbc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:secondorder.second_order_asr.geq",\ - capi_kwlist,&v1_capi,&v2_capi,&lat_capi,&pbc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - ; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.geq: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_INT,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (int *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - ; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.geq: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_INT,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (int *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable lat */ - ; - capi_lat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.geq: failed to create array from the 3rd argument `lat`"; - capi_lat_as_array = ndarray_from_pyobj( NPY_INT,1,lat_Dims,lat_Rank, capi_lat_intent,lat_capi,capi_errmess); - if (capi_lat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat = (int *)(PyArray_DATA(capi_lat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable geqf2pywrap */ - /* Processing variable f2py_v1_d0 */ - f2py_v1_d0 = shape(v1, 0); - /* Processing variable f2py_v2_d0 */ - f2py_v2_d0 = shape(v2, 0); - /* Processing variable f2py_lat_d0 */ - f2py_lat_d0 = shape(lat, 0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&geqf2pywrap,v1,v2,lat,&pbc,&f2py_v1_d0,&f2py_v2_d0,&f2py_lat_d0); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",geqf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_lat_d0 */ - /* End of cleaning variable f2py_v2_d0 */ - /* End of cleaning variable f2py_v1_d0 */ - /* End of cleaning variable geqf2pywrap */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_lat_as_array!=lat_capi) { - Py_XDECREF(capi_lat_as_array); } - } /* if (capi_lat_as_array == NULL) ... else of lat */ - /* End of cleaning variable lat */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of geq *********************************/ - -/****************************** impose_perm_sym ******************************/ -static char doc_f2py_rout_secondorder_second_order_asr_impose_perm_sym[] = "\ -fcvar,fc_sym = impose_perm_sym(fc,r2,sclat,pbc,verbose,[nat,n_blocks])\n\nWrapper for ``impose_perm_sym``.\ -\n\nParameters\n----------\n" -"fc : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" -"r2 : input rank-2 array('i') with bounds (3,n_blocks)\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"verbose : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(fc, 2)\n" -"\nReturns\n-------\n" -"fcvar : float\n" -"fc_sym : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_asr_impose_perm_sym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[3] = {-1, -1, -1}; - const int fc_Rank = 3; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - int *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - double fcvar = 0; - double *fc_sym = NULL; - npy_intp fc_sym_Dims[3] = {-1, -1, -1}; - const int fc_sym_Rank = 3; - PyArrayObject *capi_fc_sym_as_array = NULL; - int capi_fc_sym_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"fc","r2","sclat","pbc","verbose","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:secondorder.second_order_asr.impose_perm_sym",\ - capi_kwlist,&fc_capi,&r2_capi,&sclat_capi,&pbc_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the 3rd argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable verbose */ - verbose = (int)PyObject_IsTrue(verbose_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable fcvar */ - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_asr.impose_perm_sym() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_perm_sym:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 2); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.impose_perm_sym() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 2) == n_blocks,"shape(fc, 2) == n_blocks","2nd keyword n_blocks","impose_perm_sym:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the 2nd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_INT,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (int *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable fc_sym */ - fc_sym_Dims[0]=3 * nat,fc_sym_Dims[1]=3 * nat,fc_sym_Dims[2]=n_blocks; - capi_fc_sym_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_perm_sym: failed to create array from the hidden `fc_sym`"; - capi_fc_sym_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_sym_Dims,fc_sym_Rank, capi_fc_sym_intent,Py_None,capi_errmess); - if (capi_fc_sym_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_sym = (double *)(PyArray_DATA(capi_fc_sym_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r2,sclat,&pbc,&verbose,&fcvar,fc_sym,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("dN",fcvar,capi_fc_sym_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_sym_as_array == NULL) ... else of fc_sym */ - /* End of cleaning variable fc_sym */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 2) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - /* End of cleaning variable fcvar */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of impose_perm_sym ***************************/ - -/******************************* impose_asr_2nd *******************************/ -static char doc_f2py_rout_secondorder_second_order_asr_impose_asr_2nd[] = "\ -fcvar,sum2nd,fc_asr = impose_asr_2nd(fc,pow,sclat,pbc,verbose,[nat,n_blocks])\n\nWrapper for ``impose_asr_2nd``.\ -\n\nParameters\n----------\n" -"fc : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" -"pow : input float\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"verbose : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(fc, 2)\n" -"\nReturns\n-------\n" -"fcvar : float\n" -"sum2nd : float\n" -"fc_asr : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_asr_impose_asr_2nd(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[3] = {-1, -1, -1}; - const int fc_Rank = 3; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - double pow = 0; - PyObject *pow_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - double fcvar = 0; - double sum2nd = 0; - double *fc_asr = NULL; - npy_intp fc_asr_Dims[3] = {-1, -1, -1}; - const int fc_asr_Rank = 3; - PyArrayObject *capi_fc_asr_as_array = NULL; - int capi_fc_asr_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"fc","pow","sclat","pbc","verbose","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:secondorder.second_order_asr.impose_asr_2nd",\ - capi_kwlist,&fc_capi,&pow_capi,&sclat_capi,&pbc_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr_2nd: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable pow */ - f2py_success = double_from_pyobj(&pow,pow_capi,"secondorder.second_order_asr.impose_asr_2nd() 2nd argument (pow) can't be converted to double"); - if (f2py_success) { - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr_2nd: failed to create array from the 3rd argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable verbose */ - verbose = (int)PyObject_IsTrue(verbose_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable fcvar */ - /* Processing variable sum2nd */ - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_asr.impose_asr_2nd() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_asr_2nd:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 2); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.impose_asr_2nd() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 2) == n_blocks,"shape(fc, 2) == n_blocks","2nd keyword n_blocks","impose_asr_2nd:n_blocks=%d",n_blocks) { - /* Processing variable fc_asr */ - fc_asr_Dims[0]=3 * nat,fc_asr_Dims[1]=3 * nat,fc_asr_Dims[2]=n_blocks; - capi_fc_asr_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr_2nd: failed to create array from the hidden `fc_asr`"; - capi_fc_asr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_asr_Dims,fc_asr_Rank, capi_fc_asr_intent,Py_None,capi_errmess); - if (capi_fc_asr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_asr = (double *)(PyArray_DATA(capi_fc_asr_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,&pow,sclat,&pbc,&verbose,&fcvar,&sum2nd,fc_asr,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("ddN",fcvar,sum2nd,capi_fc_asr_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_asr_as_array == NULL) ... else of fc_asr */ - /* End of cleaning variable fc_asr */ - } /*CHECKSCALAR(shape(fc, 2) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - /* End of cleaning variable sum2nd */ - /* End of cleaning variable fcvar */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - } /*if (f2py_success) of pow*/ - /* End of cleaning variable pow */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of impose_asr_2nd ***************************/ - -/********************************* impose_asr *********************************/ -static char doc_f2py_rout_secondorder_second_order_asr_impose_asr[] = "\ -fc_out = impose_asr(fc,r2,pow,sclat,pbc,threshold,maxite,verbose,[nat,n_blocks])\n\nWrapper for ``impose_asr``.\ -\n\nParameters\n----------\n" -"fc : input rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)\n" -"r2 : input rank-2 array('i') with bounds (3,n_blocks)\n" -"pow : input float\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"threshold : input float\n" -"maxite : input int\n" -"verbose : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(fc, 2)\n" -"\nReturns\n-------\n" -"fc_out : rank-3 array('d') with bounds (3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_secondorder_second_order_asr_impose_asr(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,int*,int*,double*,int*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[3] = {-1, -1, -1}; - const int fc_Rank = 3; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - int *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - double pow = 0; - PyObject *pow_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - double threshold = 0; - PyObject *threshold_capi = Py_None; - int maxite = 0; - PyObject *maxite_capi = Py_None; - double *fc_out = NULL; - npy_intp fc_out_Dims[3] = {-1, -1, -1}; - const int fc_out_Rank = 3; - PyArrayObject *capi_fc_out_as_array = NULL; - int capi_fc_out_intent = 0; - int verbose = 0; - PyObject *verbose_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"fc","r2","pow","sclat","pbc","threshold","maxite","verbose","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:secondorder.second_order_asr.impose_asr",\ - capi_kwlist,&fc_capi,&r2_capi,&pow_capi,&sclat_capi,&pbc_capi,&threshold_capi,&maxite_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable pow */ - f2py_success = double_from_pyobj(&pow,pow_capi,"secondorder.second_order_asr.impose_asr() 3rd argument (pow) can't be converted to double"); - if (f2py_success) { - /* Processing variable threshold */ - f2py_success = double_from_pyobj(&threshold,threshold_capi,"secondorder.second_order_asr.impose_asr() 6th argument (threshold) can't be converted to double"); - if (f2py_success) { - /* Processing variable maxite */ - f2py_success = int_from_pyobj(&maxite,maxite_capi,"secondorder.second_order_asr.impose_asr() 7th argument (maxite) can't be converted to int"); - if (f2py_success) { - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the 4th argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable verbose */ - verbose = (int)PyObject_IsTrue(verbose_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"secondorder.second_order_asr.impose_asr() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_asr:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 2); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"secondorder.second_order_asr.impose_asr() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 2) == n_blocks,"shape(fc, 2) == n_blocks","2nd keyword n_blocks","impose_asr:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the 2nd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_INT,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (int *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable fc_out */ - fc_out_Dims[0]=3 * nat,fc_out_Dims[1]=3 * nat,fc_out_Dims[2]=n_blocks; - capi_fc_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "secondorder.secondorder.second_order_asr.impose_asr: failed to create array from the hidden `fc_out`"; - capi_fc_out_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_out_Dims,fc_out_Rank, capi_fc_out_intent,Py_None,capi_errmess); - if (capi_fc_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = secondorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_out = (double *)(PyArray_DATA(capi_fc_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r2,&pow,sclat,&pbc,&threshold,&maxite,fc_out,&verbose,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_out_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_out_as_array == NULL) ... else of fc_out */ - /* End of cleaning variable fc_out */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 2) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - } /*if (f2py_success) of maxite*/ - /* End of cleaning variable maxite */ - } /*if (f2py_success) of threshold*/ - /* End of cleaning variable threshold */ - } /*if (f2py_success) of pow*/ - /* End of cleaning variable pow */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of impose_asr *****************************/ -/*eof body*/ - -/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ - -static FortranDataDef f2py_second_order_centering_def[] = { - {"analysis",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_analysis,doc_f2py_rout_secondorder_second_order_centering_analysis}, - {"center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_center,doc_f2py_rout_secondorder_second_order_centering_center}, - {"within_dmax",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_within_dmax,doc_f2py_rout_secondorder_second_order_centering_within_dmax}, - {"compute_perimeter",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_compute_perimeter,doc_f2py_rout_secondorder_second_order_centering_compute_perimeter}, - {"cryst_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_centering_cryst_to_cart,doc_f2py_rout_secondorder_second_order_centering_cryst_to_cart}, - {NULL} -}; - -static void f2py_setup_second_order_centering(char *analysis,char *center,char *within_dmax,char *compute_perimeter,char *cryst_to_cart) { - int i_f2py=0; - f2py_second_order_centering_def[i_f2py++].data = analysis; - f2py_second_order_centering_def[i_f2py++].data = center; - f2py_second_order_centering_def[i_f2py++].data = within_dmax; - f2py_second_order_centering_def[i_f2py++].data = compute_perimeter; - f2py_second_order_centering_def[i_f2py++].data = cryst_to_cart; -} -extern void F_FUNC_US(f2pyinitsecond_order_centering,F2PYINITSECOND_ORDER_CENTERING)(void (*)(char *,char *,char *,char *,char *)); -static void f2py_init_second_order_centering(void) { - F_FUNC_US(f2pyinitsecond_order_centering,F2PYINITSECOND_ORDER_CENTERING)(f2py_setup_second_order_centering); -} - - -static FortranDataDef f2py_second_order_asr_def[] = { - {"perm_initialized",0,{{-1}},NPY_INT, 1}, - {"p",1,{{-1}},NPY_INT, 1}, - {"initialize_perm",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_initialize_perm,doc_f2py_rout_secondorder_second_order_asr_initialize_perm}, - {"clear_all",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_clear_all,doc_f2py_rout_secondorder_second_order_asr_clear_all}, - {"geq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_geq,doc_f2py_rout_secondorder_second_order_asr_geq}, - {"impose_perm_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_impose_perm_sym,doc_f2py_rout_secondorder_second_order_asr_impose_perm_sym}, - {"impose_asr_2nd",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_impose_asr_2nd,doc_f2py_rout_secondorder_second_order_asr_impose_asr_2nd}, - {"impose_asr",-1,{{-1}},0,0,NULL,(void *)f2py_rout_secondorder_second_order_asr_impose_asr,doc_f2py_rout_secondorder_second_order_asr_impose_asr}, - {NULL} -}; - -static void f2py_setup_second_order_asr(char *perm_initialized,void (*p)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *initialize_perm,char *clear_all,char *geq,char *impose_perm_sym,char *impose_asr_2nd,char *impose_asr) { - int i_f2py=0; - f2py_second_order_asr_def[i_f2py++].data = perm_initialized; - f2py_second_order_asr_def[i_f2py++].func = p; - f2py_second_order_asr_def[i_f2py++].data = initialize_perm; - f2py_second_order_asr_def[i_f2py++].data = clear_all; - f2py_second_order_asr_def[i_f2py++].data = geq; - f2py_second_order_asr_def[i_f2py++].data = impose_perm_sym; - f2py_second_order_asr_def[i_f2py++].data = impose_asr_2nd; - f2py_second_order_asr_def[i_f2py++].data = impose_asr; -} -extern void F_FUNC_US(f2pyinitsecond_order_asr,F2PYINITSECOND_ORDER_ASR)(void (*)(char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *,char *,char *,char *,char *,char *)); -static void f2py_init_second_order_asr(void) { - F_FUNC_US(f2pyinitsecond_order_asr,F2PYINITSECOND_ORDER_ASR)(f2py_setup_second_order_asr); -} - -/*need_f90modhooks*/ - -/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ - -/******************* See f2py2e/common_rules.py: buildhooks *******************/ - -/*need_commonhooks*/ - -/**************************** See f2py2e/rules.py ****************************/ - -static FortranDataDef f2py_routine_defs[] = { - -/*eof routine_defs*/ - {NULL} -}; - -static PyMethodDef f2py_module_methods[] = { - - {NULL,NULL} -}; - -static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "secondorder", - NULL, - -1, - f2py_module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit_secondorder(void) { - int i; - PyObject *m,*d, *s, *tmp; - m = secondorder_module = PyModule_Create(&moduledef); - Py_SET_TYPE(&PyFortran_Type, &PyType_Type); - import_array(); - if (PyErr_Occurred()) - {PyErr_SetString(PyExc_ImportError, "can't initialize module secondorder (failed to import numpy)"); return m;} - d = PyModule_GetDict(m); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__version__", s); - Py_DECREF(s); - s = PyUnicode_FromString( - "This module 'secondorder' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" -"Fortran 90/95 modules:\n"" second_order_centering --- analysis(),center(),within_dmax(),compute_perimeter(),cryst_to_cart()"" second_order_asr --- perm_initialized,p,initialize_perm(),clear_all(),geq(),impose_perm_sym(),impose_asr_2nd(),impose_asr()""."); - PyDict_SetItemString(d, "__doc__", s); - Py_DECREF(s); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__f2py_numpy_version__", s); - Py_DECREF(s); - secondorder_error = PyErr_NewException ("secondorder.error", NULL, NULL); - /* - * Store the error object inside the dict, so that it could get deallocated. - * (in practice, this is a module, so it likely will not and cannot.) - */ - PyDict_SetItemString(d, "_secondorder_error", secondorder_error); - Py_DECREF(secondorder_error); - for(i=0;f2py_routine_defs[i].name!=NULL;i++) { - tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); - PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); - Py_DECREF(tmp); - } - - - - - - - - - - - -/*eof initf2pywraphooks*/ - PyDict_SetItemString(d, "second_order_asr", PyFortranObject_New(f2py_second_order_asr_def,f2py_init_second_order_asr)); - PyDict_SetItemString(d, "second_order_centering", PyFortranObject_New(f2py_second_order_centering_def,f2py_init_second_order_centering)); -/*eof initf90modhooks*/ - -/*eof initcommonhooks*/ - - -#ifdef F2PY_REPORT_ATEXIT - if (! PyErr_Occurred()) - on_exit(f2py_report_on_exit,(void*)"secondorder"); -#endif - return m; -} -#ifdef __cplusplus -} -#endif diff --git a/f2py_wrappers/symph-f2pywrappers.f b/f2py_wrappers/symph-f2pywrappers.f deleted file mode 100644 index 46685d0b..00000000 --- a/f2py_wrappers/symph-f2pywrappers.f +++ /dev/null @@ -1,27 +0,0 @@ -C -*- fortran -*- -C This file is autogenerated with f2py (version:1.26.4) -C It contains Fortran 77 wrappers to fortran functions. - - subroutine f2pywrapwsweight (wsweightf2pywrap, r, rws, nrws, - & nrwsx) - external wsweight - integer nrws - integer nrwsx - double precision r(3) - double precision rws(4,nrwsx) - double precision wsweightf2pywrap - double precision wsweight - wsweightf2pywrap = wsweight(r, rws, nrws, nrwsx) - end - - - subroutine f2pywrapeqvect (eqvectf2pywrap, x, y, f) - external eqvect - double precision x(3) - double precision y(3) - double precision f(3) - logical eqvectf2pywrap - logical eqvect - eqvectf2pywrap = .not.(.not.eqvect(x, y, f)) - end - diff --git a/f2py_wrappers/symph-f2pywrappers2.f90 b/f2py_wrappers/symph-f2pywrappers2.f90 deleted file mode 100644 index 1110596e..00000000 --- a/f2py_wrappers/symph-f2pywrappers2.f90 +++ /dev/null @@ -1,275 +0,0 @@ -! -*- f90 -*- -! This file is autogenerated with f2py (version:1.26.4) -! It contains Fortran 90 wrappers to fortran functions. - - subroutine f2pywrapget_latvec (tau_sc, tau, itau, latvec, nat, nat& - &_sc, nr, f2py_itau_d0) - integer nat - integer nat_sc - integer nr - integer f2py_itau_d0 - double precision tau_sc(3,nat_sc) - double precision tau(3,nat) - integer itau(f2py_itau_d0) - double precision latvec(nr,3) - interface - - subroutine get_latvec(tau_sc,tau,itau,latvec,nat,nat_sc,nr) - double precision, dimension(3,nat_sc),intent(in) :: tau_& - &sc - double precision, dimension(3, nat),intent(in) :: tau - integer, dimension(:),intent(in) :: itau - double precision, dimension(nr,3),intent(out) :: latvec - integer :: nat - integer :: nat_sc - integer :: nr - end subroutine get_latvec - end interface - call get_latvec(tau_sc, tau, itau, latvec, nat, nat_sc, nr) - end - - - - subroutine f2pyinitconstants(f2pysetupfunc) - use constants, only : pi - use constants, only : tpi - use constants, only : fpi - use constants, only : sqrtpi - use constants, only : sqrtpm1 - use constants, only : sqrt2 - use constants, only : h_planck_si - use constants, only : k_boltzmann_si - use constants, only : electron_si - use constants, only : electronvolt_si - use constants, only : electronmass_si - use constants, only : hartree_si - use constants, only : rydberg_si - use constants, only : bohr_radius_si - use constants, only : amu_si - use constants, only : c_si - use constants, only : munought_si - use constants, only : epsnought_si - use constants, only : k_boltzmann_au - use constants, only : k_boltzmann_ry - use constants, only : autoev - use constants, only : rytoev - use constants, only : amu_au - use constants, only : amu_ry - use constants, only : au_sec - use constants, only : au_ps - use constants, only : au_gpa - use constants, only : ry_kbar - use constants, only : debye_si - use constants, only : au_debye - use constants, only : ev_to_kelvin - use constants, only : ry_to_kelvin - use constants, only : evtonm - use constants, only : rytonm - use constants, only : c_au - use constants, only : eps4 - use constants, only : eps6 - use constants, only : eps8 - use constants, only : eps12 - use constants, only : eps14 - use constants, only : eps16 - use constants, only : eps24 - use constants, only : eps32 - use constants, only : gsmall - use constants, only : e2 - use constants, only : degspin - use constants, only : bohr_radius_cm - use constants, only : bohr_radius_angs - use constants, only : angstrom_au - use constants, only : dip_debye - use constants, only : au_terahertz - use constants, only : au_to_ohmcmm1 - use constants, only : ry_to_thz - use constants, only : ry_to_ghz - use constants, only : ry_to_cmm1 - use constants, only : avogadro - external f2pysetupfunc - call f2pysetupfunc(pi,tpi,fpi,sqrtpi,sqrtpm1,sqrt2,h_planck_si,k_b& - &oltzmann_si,electron_si,electronvolt_si,electronmass_si,hartree_si& - &,rydberg_si,bohr_radius_si,amu_si,c_si,munought_si,epsnought_si,k_& - &boltzmann_au,k_boltzmann_ry,autoev,rytoev,amu_au,amu_ry,au_sec,au_& - &ps,au_gpa,ry_kbar,debye_si,au_debye,ev_to_kelvin,ry_to_kelvin,evto& - &nm,rytonm,c_au,eps4,eps6,eps8,eps12,eps14,eps16,eps24,eps32,gsmall& - &,e2,degspin,bohr_radius_cm,bohr_radius_angs,angstrom_au,dip_debye,& - &au_terahertz,au_to_ohmcmm1,ry_to_thz,ry_to_ghz,ry_to_cmm1,avogadro& - &) - end subroutine f2pyinitconstants - - - subroutine f2pyinitio_global(f2pysetupfunc) - use io_global, only : stdout - use io_global, only : ionode - use io_global, only : ionode_id - use io_global, only : meta_ionode - use io_global, only : meta_ionode_id - use io_global, only : xmlinputunit - use io_global, only : xmloutputunit - use io_global, only : xmltmpunit - use io_global, only : io_global_start - use io_global, only : meta_io_global_start - use io_global, only : io_global_getionode - use io_global, only : io_global_getmeta - external f2pysetupfunc - call f2pysetupfunc(stdout,ionode,ionode_id,meta_ionode,meta_ionode& - &_id,xmlinputunit,xmloutputunit,xmltmpunit,io_global_start,meta_io_& - &global_start,io_global_getionode,io_global_getmeta) - end subroutine f2pyinitio_global - - - subroutine f2pyinitkinds(f2pysetupfunc) - use kinds, only : dp - use kinds, only : sgl - use kinds, only : i4b - use kinds, only : print_kind_info - external f2pysetupfunc - call f2pysetupfunc(dp,sgl,i4b,print_kind_info) - end subroutine f2pyinitkinds - - subroutine f2py_symm_base_getdims_irt(r,s,f2pysetdata,flag) - use symm_base, only: d => irt - - 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_symm_base_getdims_irt - subroutine f2pywrap_symm_base_copy_sym (copy_symf2pywrap, nrot_, s& - &ym) - use symm_base, only : copy_sym - integer nrot_ - logical sym(48) - integer copy_symf2pywrap - copy_symf2pywrap = copy_sym(nrot_, sym) - end subroutine f2pywrap_symm_base_copy_sym - subroutine f2pywrap_symm_base_is_group (is_groupf2pywrap) - use symm_base, only : is_group - logical is_groupf2pywrap - is_groupf2pywrap = .not.(.not.is_group()) - end subroutine f2pywrap_symm_base_is_group - subroutine f2pywrap_symm_base_eqvect (eqvectf2pywrap, x, y, f) - use symm_base, only : eqvect - double precision x(3) - double precision y(3) - double precision f(3) - logical eqvectf2pywrap - eqvectf2pywrap = .not.(.not.eqvect(x, y, f)) - end subroutine f2pywrap_symm_base_eqvect - subroutine f2pywrap_symm_base_checksym (checksymf2pywrap, irot, na& - &t, ityp, xau, rau, ft_) - use symm_base, only : checksym - integer irot - integer nat - integer ityp(nat) - double precision xau(3,nat) - double precision rau(3,nat) - double precision ft_(3) - logical checksymf2pywrap - checksymf2pywrap = .not.(.not.checksym(irot, nat, ityp, xau, rau, & - &ft_)) - end subroutine f2pywrap_symm_base_checksym - - subroutine f2pyinitsymm_base(f2pysetupfunc) - use symm_base, only : eps1 - use symm_base, only : eps2 - use symm_base, only : s - use symm_base, only : sr - use symm_base, only : sname - use symm_base, only : ft - use symm_base, only : ftau - use symm_base, only : nrot - use symm_base, only : nsym - use symm_base, only : nsym_ns - use symm_base, only : nsym_na - use symm_base, only : t_rev - use symm_base, only : no_t_rev - use symm_base, only : time_reversal - use symm_base, only : irt - use symm_base, only : invs - use symm_base, only : invsym - use symm_base, only : d1 - use symm_base, only : d2 - use symm_base, only : d3 - use symm_base, only : allfrac - use symm_base, only : nofrac - use symm_base, only : nosym - use symm_base, only : nosym_evc - use symm_base, only : at - use symm_base, only : bg - use symm_base, only : set_accep_threshold - use symm_base, only : get_accep_threshold - use symm_base, only : set_at_bg - use symm_base, only : inverse_s - use symm_base, only : set_sym_bl - use symm_base, only : find_sym - use symm_base, only : sgam_at - use symm_base, only : sgam_at_mag - use symm_base, only : set_sym - use symm_base, only : checkallsym - use symm_base, only : s_axis_to_cart - use symm_base, only : smallg_q - interface - subroutine f2pywrap_symm_base_copy_sym (copy_symf2pywrap, nrot_, s& - &ym) - integer nrot_ - logical sym(48) - integer copy_symf2pywrap - end subroutine f2pywrap_symm_base_copy_sym - subroutine f2pywrap_symm_base_is_group (is_groupf2pywrap, is_group& - &) - logical is_groupf2pywrap - end subroutine f2pywrap_symm_base_is_group - subroutine f2pywrap_symm_base_eqvect (eqvectf2pywrap, x, y, f) - double precision x(3) - double precision y(3) - double precision f(3) - logical eqvectf2pywrap - end subroutine f2pywrap_symm_base_eqvect - subroutine f2pywrap_symm_base_checksym (checksymf2pywrap, irot, na& - &t, ityp, xau, rau, ft_) - integer irot - integer nat - integer ityp(nat) - double precision xau(3,nat) - double precision rau(3,nat) - double precision ft_(3) - logical checksymf2pywrap - end subroutine f2pywrap_symm_base_checksym - end interface - external f2pysetupfunc - external f2py_symm_base_getdims_irt - call f2pysetupfunc(eps1,eps2,s,sr,sname,ft,ftau,nrot,nsym,nsym_ns,& - &nsym_na,t_rev,no_t_rev,time_reversal,f2py_symm_base_getdims_irt,in& - &vs,invsym,d1,d2,d3,allfrac,nofrac,nosym,nosym_evc,at,bg,set_accep_& - &threshold,get_accep_threshold,set_at_bg,inverse_s,set_sym_bl,find_& - &sym,sgam_at,sgam_at_mag,set_sym,f2pywrap_symm_base_copy_sym,f2pywr& - &ap_symm_base_is_group,f2pywrap_symm_base_eqvect,f2pywrap_symm_base& - &_checksym,checkallsym,s_axis_to_cart,smallg_q) - end subroutine f2pyinitsymm_base - - diff --git a/f2py_wrappers/symphmodule.c b/f2py_wrappers/symphmodule.c deleted file mode 100644 index e79cd690..00000000 --- a/f2py_wrappers/symphmodule.c +++ /dev/null @@ -1,13669 +0,0 @@ -/* File: symphmodule.c - * This file is auto-generated with f2py (version:1.26.4). - * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, - * written by Pearu Peterson . - * Generation date: Fri Sep 12 13:31:39 2025 - * Do not edit this file directly unless you know what you are doing!!! - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ - -/* Unconditionally included */ -#include -#include - -/*********************** See f2py2e/cfuncs.py: includes ***********************/ -#include "fortranobject.h" -#include -#include - -/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ -static PyObject *symph_error; -static PyObject *symph_module; - -/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ -typedef char * string; -typedef struct {double r,i;} complex_double; - -/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ -/*need_typedefs_generated*/ - -/********************** See f2py2e/cfuncs.py: cppmacros **********************/ -#define FAILNULL(p) do { \ - if ((p) == NULL) { \ - PyErr_SetString(PyExc_MemoryError, "NULL pointer found"); \ - goto capi_fail; \ - } \ -} while (0) - - -#define STRINGMALLOC(str,len)\ - if ((str = (string)malloc(len+1)) == NULL) {\ - PyErr_SetString(PyExc_MemoryError, "out of memory");\ - goto capi_fail;\ - } else {\ - (str)[len] = '\0';\ - } - - -#if defined(PREPEND_FORTRAN) -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F -#else -#define F_FUNC(f,F) _##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F##_ -#else -#define F_FUNC(f,F) _##f##_ -#endif -#endif -#else -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F -#else -#define F_FUNC(f,F) f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F##_ -#else -#define F_FUNC(f,F) f##_ -#endif -#endif -#endif -#if defined(UNDERSCORE_G77) -#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) -#else -#define F_FUNC_US(f,F) F_FUNC(f,F) -#endif - - -/* See fortranobject.h for definitions. The macros here are provided for BC. */ -#define rank f2py_rank -#define shape f2py_shape -#define fshape f2py_shape -#define len f2py_len -#define flen f2py_flen -#define slen f2py_slen -#define size f2py_size - - -#define STRINGFREE(str) do {if (!(str == NULL)) free(str);} while (0) - - -/* -STRINGPADN replaces null values with padding values from the right. - -`to` must have size of at least N bytes. - -If the `to[N-1]` has null value, then replace it and all the -preceding, nulls with the given padding. - -STRINGPADN(to, N, PADDING, NULLVALUE) is an inverse operation. -*/ -#define STRINGPADN(to, N, NULLVALUE, PADDING) \ - do { \ - int _m = (N); \ - char *_to = (to); \ - for (_m -= 1; _m >= 0 && _to[_m] == NULLVALUE; _m--) { \ - _to[_m] = PADDING; \ - } \ - } while (0) - - -#ifdef DEBUGCFUNCS -#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); -#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ - PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ - fprintf(stderr,"\n"); -#else -#define CFUNCSMESS(mess) -#define CFUNCSMESSPY(mess,obj) -#endif - - -#ifndef max -#define max(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) ((a < b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a,b) ((a < b) ? (a) : (b)) -#endif - - -#if defined(PREPEND_FORTRAN) -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F -#else -#define F_WRAPPEDFUNC(f,F) _f2pywrap##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F##_ -#else -#define F_WRAPPEDFUNC(f,F) _f2pywrap##f##_ -#endif -#endif -#else -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F -#else -#define F_WRAPPEDFUNC(f,F) f2pywrap##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F##_ -#else -#define F_WRAPPEDFUNC(f,F) f2pywrap##f##_ -#endif -#endif -#endif -#if defined(UNDERSCORE_G77) -#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f##_,F##_) -#else -#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f,F) -#endif - - -#define CHECKSCALAR(check,tcheck,name,show,var)\ - if (!(check)) {\ - char errstring[256];\ - sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ - PyErr_SetString(symph_error,errstring);\ - /*goto capi_fail;*/\ - } else - -#define CHECKARRAY(check,tcheck,name) \ - if (!(check)) {\ - PyErr_SetString(symph_error,"("tcheck") failed for "name);\ - /*goto capi_fail;*/\ - } else - -/* -STRINGCOPYN copies N bytes. - -`to` and `from` buffers must have sizes of at least N bytes. -*/ -#define STRINGCOPYN(to,from,N) \ - do { \ - int _m = (N); \ - char *_to = (to); \ - char *_from = (from); \ - FAILNULL(_to); FAILNULL(_from); \ - (void)strncpy(_to, _from, _m); \ - } while (0) - - -/************************ See f2py2e/cfuncs.py: cfuncs ************************/ - -/* - Create a new string buffer `str` of at most length `len` from a - Python string-like object `obj`. - - The string buffer has given size (len) or the size of inistr when len==-1. - - The string buffer is padded with blanks: in Fortran, trailing blanks - are insignificant contrary to C nulls. - */ -static int -string_from_pyobj(string *str, int *len, const string inistr, PyObject *obj, - const char *errmess) -{ - PyObject *tmp = NULL; - string buf = NULL; - npy_intp n = -1; -#ifdef DEBUGCFUNCS -fprintf(stderr,"string_from_pyobj(str='%s',len=%d,inistr='%s',obj=%p)\n", - (char*)str, *len, (char *)inistr, obj); -#endif - if (obj == Py_None) { - n = strlen(inistr); - buf = inistr; - } - else if (PyArray_Check(obj)) { - PyArrayObject *arr = (PyArrayObject *)obj; - if (!ISCONTIGUOUS(arr)) { - PyErr_SetString(PyExc_ValueError, - "array object is non-contiguous."); - goto capi_fail; - } - n = PyArray_NBYTES(arr); - buf = PyArray_DATA(arr); - n = strnlen(buf, n); - } - else { - if (PyBytes_Check(obj)) { - tmp = obj; - Py_INCREF(tmp); - } - else if (PyUnicode_Check(obj)) { - tmp = PyUnicode_AsASCIIString(obj); - } - else { - PyObject *tmp2; - tmp2 = PyObject_Str(obj); - if (tmp2) { - tmp = PyUnicode_AsASCIIString(tmp2); - Py_DECREF(tmp2); - } - else { - tmp = NULL; - } - } - if (tmp == NULL) goto capi_fail; - n = PyBytes_GET_SIZE(tmp); - buf = PyBytes_AS_STRING(tmp); - } - if (*len == -1) { - /* TODO: change the type of `len` so that we can remove this */ - if (n > NPY_MAX_INT) { - PyErr_SetString(PyExc_OverflowError, - "object too large for a 32-bit int"); - goto capi_fail; - } - *len = n; - } - else if (*len < n) { - /* discard the last (len-n) bytes of input buf */ - n = *len; - } - if (n < 0 || *len < 0 || buf == NULL) { - goto capi_fail; - } - STRINGMALLOC(*str, *len); // *str is allocated with size (*len + 1) - if (n < *len) { - /* - Pad fixed-width string with nulls. The caller will replace - nulls with blanks when the corresponding argument is not - intent(c). - */ - memset(*str + n, '\0', *len - n); - } - STRINGCOPYN(*str, buf, n); - Py_XDECREF(tmp); - return 1; -capi_fail: - Py_XDECREF(tmp); - { - PyObject* err = PyErr_Occurred(); - if (err == NULL) { - err = symph_error; - } - PyErr_SetString(err, errmess); - } - return 0; -} - - -static int -int_from_pyobj(int* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - - if (PyLong_Check(obj)) { - *v = Npy__PyLong_AsInt(obj); - return !(*v == -1 && PyErr_Occurred()); - } - - tmp = PyNumber_Long(obj); - if (tmp) { - *v = Npy__PyLong_AsInt(tmp); - Py_DECREF(tmp); - return !(*v == -1 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (int_from_pyobj(v, tmp, errmess)) { - Py_DECREF(tmp); - return 1; - } - Py_DECREF(tmp); - } - - { - PyObject* err = PyErr_Occurred(); - if (err == NULL) { - err = symph_error; - } - PyErr_SetString(err, errmess); - } - return 0; -} - - -static int -double_from_pyobj(double* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - if (PyFloat_Check(obj)) { - *v = PyFloat_AsDouble(obj); - return !(*v == -1.0 && PyErr_Occurred()); - } - - tmp = PyNumber_Float(obj); - if (tmp) { - *v = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return !(*v == -1.0 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} - Py_DECREF(tmp); - } - { - PyObject* err = PyErr_Occurred(); - if (err==NULL) err = symph_error; - PyErr_SetString(err,errmess); - } - return 0; -} - - -/********************* See f2py2e/cfuncs.py: userincludes *********************/ -/*need_userincludes*/ - -/********************* See f2py2e/capi_rules.py: usercode *********************/ - - -/* See f2py2e/rules.py */ -extern void F_FUNC(errore,ERRORE)(string,string,int*,size_t,size_t); -extern void F_FUNC(infomsg,INFOMSG)(string,string,size_t,size_t); -extern void F_WRAPPEDFUNC_US(get_latvec,GET_LATVEC)(double*,double*,int*,double*,int*,int*,int*,int*); -extern void F_FUNC_US(rotate_and_add_dyn,ROTATE_AND_ADD_DYN)(complex_double*,complex_double*,int*,int*,int*,int*,int*,double*,double*); -extern void F_FUNC_US(set_irotmq,SET_IROTMQ)(double*,int*,int*,int*,int*,int*,double*,double*,int*); -extern void F_FUNC(symmatrix,SYMMATRIX)(double*,int*,int*,double*,double*); -extern void F_FUNC_US(cart_to_crys_mat,CART_TO_CRYS_MAT)(double*,double*); -extern void F_FUNC_US(crys_to_cart_mat,CRYS_TO_CART_MAT)(double*,double*); -extern void F_FUNC_US(contract_two_ph_propagator,CONTRACT_TWO_PH_PROPAGATOR)(double*,double*,double*,double*,double*,complex_double*,int*,int*); -extern void F_FUNC_US(get_two_phonon_propagator,GET_TWO_PHONON_PROPAGATOR)(double*,double*,double*,double*,complex_double*,int*); -extern void F_FUNC_US(fc_supercell_from_dyn,FC_SUPERCELL_FROM_DYN)(complex_double*,double*,double*,double*,int*,double*,int*,int*); -extern void F_FUNC_US(fast_ft_real_space_from_dynq,FAST_FT_REAL_SPACE_FROM_DYNQ)(double*,double*,int*,int*,int*,int*,double*,complex_double*,complex_double*); -extern void F_FUNC_US(impose_trans_sc,IMPOSE_TRANS_SC)(double*,double*,int*,int*); -extern void F_FUNC_US(dyn_from_fc,DYN_FROM_FC)(double*,double*,double*,double*,int*,complex_double*,int*,int*); -extern void F_FUNC_US(get_q_grid,GET_Q_GRID)(double*,int*,double*,int*); -extern void F_FUNC_US(star_q,STAR_Q)(double*,double*,double*,int*,int*,int*,int*,double*,int*,int*,int*); -extern void F_FUNC(symvector,SYMVECTOR)(int*,int*,int*,int*,double*,double*,double*); -extern void F_FUNC_US(cryst_to_cart,CRYST_TO_CART)(int*,double*,double*,int*); -extern void F_FUNC_US(flush_unit,FLUSH_UNIT)(int*); -extern void F_FUNC_US(get_translations,GET_TRANSLATIONS)(double*,double*,int*,int*,int*); -extern void F_FUNC_US(q2qstar_out,Q2QSTAR_OUT)(complex_double*,double*,double*,int*,int*,int*,int*,int*,double*,int*,double*,int*,int*,int*,complex_double*); -extern void F_FUNC_US(set_asr,SET_ASR)(string,int*,int*,double*,complex_double*,double*,size_t); -extern void F_FUNC_US(sp_zeu,SP_ZEU)(double*,double*,int*,double*); -extern void F_FUNC(sp1,SP1)(double*,double*,int*,double*); -extern void F_FUNC(sp2,SP2)(double*,double*,int*,int*,double*); -extern void F_FUNC(sp3,SP3)(double*,double*,int*,int*,int*,double*); -extern void F_FUNC_US(symdynph_gq_new,SYMDYNPH_GQ_NEW)(double*,complex_double*,int*,int*,double*,int*,int*,int*,int*,int*); -extern void F_FUNC(trntnsc,TRNTNSC)(complex_double*,double*,double*,int*); -extern void F_FUNC_US(rgd_blk,RGD_BLK)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); -extern void F_FUNC_US(rgd_blk_diff_phase_conv,RGD_BLK_DIFF_PHASE_CONV)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); -extern void F_FUNC(nonanal,NONANAL)(int*,int*,int*,double*,double*,double*,double*,complex_double*); -extern void F_FUNC(trasl,TRASL)(complex_double*,complex_double*,int*,int*,int*,int*,int*,int*,int*,int*); -extern void F_FUNC_US(frc_blk,FRC_BLK)(complex_double*,double*,double*,int*,int*,int*,int*,double*,double*,double*,int*,int*); -extern void F_FUNC(wsinit,WSINIT)(double*,int*,int*,double*); -extern void F_WRAPPEDFUNC(wsweight,WSWEIGHT)(double*,double*,double*,int*,int*); -extern void F_FUNC_US(get_frc,GET_FRC)(double*,double*,double*,double*,int*,double*,int*,int*,int*,int*,int*); -extern void F_FUNC_US(asign_supercell_index_new,ASIGN_SUPERCELL_INDEX_NEW)(double*,double*,int*,int*,int*); -extern void F_FUNC_US(q_gen,Q_GEN)(int*,double*,double*,double*,double*,double*); -extern void F_FUNC_US(set_tau,SET_TAU)(int*,int*,double*,double*,double*,double*,int*,int*,int*); -extern void F_FUNC_US(threetosix_real,THREETOSIX_REAL)(double*,double*,int*); -extern void F_FUNC_US(sixtothree_real,SIXTOTHREE_REAL)(double*,double*,int*); -extern void F_WRAPPEDFUNC(eqvect,EQVECT)(int*,double*,double*,double*); -extern void F_FUNC_US(get_equivalent_atoms,GET_EQUIVALENT_ATOMS)(double*,double*,double*,int*,int*,int*,int*); -extern void F_FUNC_US(get_closest_vector,GET_CLOSEST_VECTOR)(double*,double*,double*); -extern void F_FUNC_US(get_gr_data,GET_GR_DATA)(double*,double*,int*,int*,int*,double*,double*,int*,double*,double*,int*,int*); -extern void F_FUNC_US(fix_coords_in_unit_cell,FIX_COORDS_IN_UNIT_CELL)(double*,double*,double*,int*); -extern void F_FUNC(matinv3,MATINV3)(double*,double*); -extern void F_FUNC(invmat,INVMAT)(int*,double*,double*); -extern void F_FUNC(recips,RECIPS)(double*,double*,double*,double*,double*,double*); -extern void F_FUNC_US(sgam_ph_new,SGAM_PH_NEW)(double*,double*,int*,int*,int*,double*,double*,int*); -extern void F_FUNC_US(get_tau_sc_latvec,GET_TAU_SC_LATVEC)(double*,double*,double*,int*,int*,int*); -extern void F_FUNC_US(permute_v3,PERMUTE_V3)(double*,int*); -extern void F_FUNC_US(permute_v4,PERMUTE_V4)(double*,int*); -extern void F_FUNC_US(trans_v2,TRANS_V2)(double*,int*,int*,int*); -extern void F_FUNC_US(trans_v3,TRANS_V3)(double*,int*,int*,int*); -extern void F_FUNC_US(trans_v4,TRANS_V4)(double*,int*,int*,int*); -extern void F_FUNC_US(sym_v2,SYM_V2)(double*,double*,double*,int*,int*,int*,int*); -extern void F_FUNC_US(sym_v3,SYM_V3)(double*,double*,int*,int*,int*,int*); -extern void F_FUNC_US(sym_v4,SYM_V4)(double*,double*,int*,int*,int*,int*); -extern void F_FUNC_US(print_symm,PRINT_SYMM)(int*,int*,int*,int*,int*); -/*eof externroutines*/ - -/******************** See f2py2e/capi_rules.py: usercode1 ********************/ - - -/******************* See f2py2e/cb_rules.py: buildcallback *******************/ -/*need_callbacks*/ - -/*********************** See f2py2e/rules.py: buildapi ***********************/ - -/*********************************** errore ***********************************/ -static char doc_f2py_rout_symph_errore[] = "\ -errore(calling_routine,message,ierr)\n\nWrapper for ``errore``.\ -\n\nParameters\n----------\n" -"calling_routine : input string(len=-1)\n" -"message : input string(len=-1)\n" -"ierr : input int"; -/* extern void F_FUNC(errore,ERRORE)(string,string,int*,size_t,size_t); */ -static PyObject *f2py_rout_symph_errore(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(string,string,int*,size_t,size_t)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - string calling_routine = NULL; - int slen(calling_routine); - PyObject *calling_routine_capi = Py_None; - string message = NULL; - int slen(message); - PyObject *message_capi = Py_None; - int ierr = 0; - PyObject *ierr_capi = Py_None; - static char *capi_kwlist[] = {"calling_routine","message","ierr",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:symph.errore",\ - capi_kwlist,&calling_routine_capi,&message_capi,&ierr_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable calling_routine */ - slen(calling_routine) = -1; - f2py_success = string_from_pyobj(&calling_routine,&slen(calling_routine),"",calling_routine_capi,"string_from_pyobj failed in converting 1st argument`calling_routine' of symph.errore to C string"); - if (f2py_success) { - STRINGPADN(calling_routine, slen(calling_routine), '\0', ' '); - /* Processing variable message */ - slen(message) = -1; - f2py_success = string_from_pyobj(&message,&slen(message),"",message_capi,"string_from_pyobj failed in converting 2nd argument`message' of symph.errore to C string"); - if (f2py_success) { - STRINGPADN(message, slen(message), '\0', ' '); - /* Processing variable ierr */ - f2py_success = int_from_pyobj(&ierr,ierr_capi,"symph.errore() 3rd argument (ierr) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(calling_routine,message,&ierr,slen(calling_routine),slen(message)); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of ierr*/ - /* End of cleaning variable ierr */ - STRINGFREE(message); - } /*if (f2py_success) of message*/ - /* End of cleaning variable message */ - STRINGFREE(calling_routine); - } /*if (f2py_success) of calling_routine*/ - /* End of cleaning variable calling_routine */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of errore *******************************/ - -/********************************** infomsg **********************************/ -static char doc_f2py_rout_symph_infomsg[] = "\ -infomsg(routine,message)\n\nWrapper for ``infomsg``.\ -\n\nParameters\n----------\n" -"routine : input string(len=-1)\n" -"message : input string(len=-1)"; -/* extern void F_FUNC(infomsg,INFOMSG)(string,string,size_t,size_t); */ -static PyObject *f2py_rout_symph_infomsg(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(string,string,size_t,size_t)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - string routine = NULL; - int slen(routine); - PyObject *routine_capi = Py_None; - string message = NULL; - int slen(message); - PyObject *message_capi = Py_None; - static char *capi_kwlist[] = {"routine","message",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.infomsg",\ - capi_kwlist,&routine_capi,&message_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable routine */ - slen(routine) = -1; - f2py_success = string_from_pyobj(&routine,&slen(routine),"",routine_capi,"string_from_pyobj failed in converting 1st argument`routine' of symph.infomsg to C string"); - if (f2py_success) { - STRINGPADN(routine, slen(routine), '\0', ' '); - /* Processing variable message */ - slen(message) = -1; - f2py_success = string_from_pyobj(&message,&slen(message),"",message_capi,"string_from_pyobj failed in converting 2nd argument`message' of symph.infomsg to C string"); - if (f2py_success) { - STRINGPADN(message, slen(message), '\0', ' '); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(routine,message,slen(routine),slen(message)); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - STRINGFREE(message); - } /*if (f2py_success) of message*/ - /* End of cleaning variable message */ - STRINGFREE(routine); - } /*if (f2py_success) of routine*/ - /* End of cleaning variable routine */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of infomsg *******************************/ - -/********************************* get_latvec *********************************/ -static char doc_f2py_rout_symph_get_latvec[] = "\ -latvec = get_latvec(tau_sc,tau,itau,nr,[nat,nat_sc])\n\nWrapper for ``get_latvec``.\ -\n\nParameters\n----------\n" -"tau_sc : input rank-2 array('d') with bounds (3,nat_sc)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"itau : input rank-1 array('i') with bounds (f2py_itau_d0)\n" -"nr : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)\n" -"nat_sc : input int, optional\n Default: shape(tau_sc, 1)\n" -"\nReturns\n-------\n" -"latvec : rank-2 array('d') with bounds (nr,3)"; -/* extern void F_WRAPPEDFUNC_US(get_latvec,GET_LATVEC)(double*,double*,int*,double*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_get_latvec(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tau_sc = NULL; - npy_intp tau_sc_Dims[2] = {-1, -1}; - const int tau_sc_Rank = 2; - PyArrayObject *capi_tau_sc_as_array = NULL; - int capi_tau_sc_intent = 0; - PyObject *tau_sc_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - int *itau = NULL; - npy_intp itau_Dims[1] = {-1}; - const int itau_Rank = 1; - PyArrayObject *capi_itau_as_array = NULL; - int capi_itau_intent = 0; - PyObject *itau_capi = Py_None; - double *latvec = NULL; - npy_intp latvec_Dims[2] = {-1, -1}; - const int latvec_Rank = 2; - PyArrayObject *capi_latvec_as_array = NULL; - int capi_latvec_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - int nr = 0; - PyObject *nr_capi = Py_None; - int f2py_itau_d0 = 0; - static char *capi_kwlist[] = {"tau_sc","tau","itau","nr","nat","nat_sc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|OO:symph.get_latvec",\ - capi_kwlist,&tau_sc_capi,&tau_capi,&itau_capi,&nr_capi,&nat_capi,&nat_sc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable tau_sc */ - tau_sc_Dims[0]=3; - capi_tau_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the 1st argument `tau_sc`"; - capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); - if (capi_tau_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); - - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the 2nd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable itau */ - ; - capi_itau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the 3rd argument `itau`"; - capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); - if (capi_itau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau = (int *)(PyArray_DATA(capi_itau_as_array)); - - /* Processing variable nr */ - f2py_success = int_from_pyobj(&nr,nr_capi,"symph.get_latvec() 4th argument (nr) can't be converted to int"); - if (f2py_success) { - /* Processing variable latvec */ - latvec_Dims[0]=nr,latvec_Dims[1]=3; - capi_latvec_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_latvec: failed to create array from the hidden `latvec`"; - capi_latvec_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,latvec_Dims,latvec_Rank, capi_latvec_intent,Py_None,capi_errmess); - if (capi_latvec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - latvec = (double *)(PyArray_DATA(capi_latvec_as_array)); - - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(tau_sc, 1); else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.get_latvec() 2nd keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau_sc, 1) == nat_sc,"shape(tau_sc, 1) == nat_sc","2nd keyword nat_sc","get_latvec:nat_sc=%d",nat_sc) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_latvec() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","get_latvec:nat=%d",nat) { - /* Processing variable f2py_itau_d0 */ - f2py_itau_d0 = shape(itau, 0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tau_sc,tau,itau,latvec,&nat,&nat_sc,&nr,&f2py_itau_d0); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_latvec_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_itau_d0 */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(tau_sc, 1) == nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - } /* if (capi_latvec_as_array == NULL) ... else of latvec */ - /* End of cleaning variable latvec */ - } /*if (f2py_success) of nr*/ - /* End of cleaning variable nr */ - if((PyObject *)capi_itau_as_array!=itau_capi) { - Py_XDECREF(capi_itau_as_array); } - } /* if (capi_itau_as_array == NULL) ... else of itau */ - /* End of cleaning variable itau */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { - Py_XDECREF(capi_tau_sc_as_array); } - } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ - /* End of cleaning variable tau_sc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of get_latvec *****************************/ - -/***************************** rotate_and_add_dyn *****************************/ -static char doc_f2py_rout_symph_rotate_and_add_dyn[] = "\ -phi2 = rotate_and_add_dyn(phi,isym,s,invs,irt,rtau,sxq,[nat])\n\nWrapper for ``rotate_and_add_dyn``.\ -\n\nParameters\n----------\n" -"phi : input rank-4 array('D') with bounds (3,3,nat,nat)\n" -"isym : input int\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"invs : input rank-1 array('i') with bounds (48)\n" -"irt : input rank-2 array('i') with bounds (48,nat)\n" -"rtau : input rank-3 array('d') with bounds (3,48,nat)\n" -"sxq : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(phi, 2)\n" -"\nReturns\n-------\n" -"phi2 : rank-4 array('D') with bounds (3,3,nat,nat)"; -/* extern void F_FUNC_US(rotate_and_add_dyn,ROTATE_AND_ADD_DYN)(complex_double*,complex_double*,int*,int*,int*,int*,int*,double*,double*); */ -static PyObject *f2py_rout_symph_rotate_and_add_dyn(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,complex_double*,int*,int*,int*,int*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *phi = NULL; - npy_intp phi_Dims[4] = {-1, -1, -1, -1}; - const int phi_Rank = 4; - PyArrayObject *capi_phi_as_array = NULL; - int capi_phi_intent = 0; - PyObject *phi_capi = Py_None; - complex_double *phi2 = NULL; - npy_intp phi2_Dims[4] = {-1, -1, -1, -1}; - const int phi2_Rank = 4; - PyArrayObject *capi_phi2_as_array = NULL; - int capi_phi2_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int isym = 0; - PyObject *isym_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *invs = NULL; - npy_intp invs_Dims[1] = {-1}; - const int invs_Rank = 1; - PyArrayObject *capi_invs_as_array = NULL; - int capi_invs_intent = 0; - PyObject *invs_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - double *rtau = NULL; - npy_intp rtau_Dims[3] = {-1, -1, -1}; - const int rtau_Rank = 3; - PyArrayObject *capi_rtau_as_array = NULL; - int capi_rtau_intent = 0; - PyObject *rtau_capi = Py_None; - double *sxq = NULL; - npy_intp sxq_Dims[1] = {-1}; - const int sxq_Rank = 1; - PyArrayObject *capi_sxq_as_array = NULL; - int capi_sxq_intent = 0; - PyObject *sxq_capi = Py_None; - static char *capi_kwlist[] = {"phi","isym","s","invs","irt","rtau","sxq","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:symph.rotate_and_add_dyn",\ - capi_kwlist,&phi_capi,&isym_capi,&s_capi,&invs_capi,&irt_capi,&rtau_capi,&sxq_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable isym */ - f2py_success = int_from_pyobj(&isym,isym_capi,"symph.rotate_and_add_dyn() 2nd argument (isym) can't be converted to int"); - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 3rd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable invs */ - invs_Dims[0]=48; - capi_invs_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 4th argument `invs`"; - capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); - if (capi_invs_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - invs = (int *)(PyArray_DATA(capi_invs_as_array)); - - /* Processing variable phi */ - phi_Dims[0]=3,phi_Dims[1]=3; - capi_phi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 1st argument `phi`"; - capi_phi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi_Dims,phi_Rank, capi_phi_intent,phi_capi,capi_errmess); - if (capi_phi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phi = (complex_double *)(PyArray_DATA(capi_phi_as_array)); - - /* Processing variable sxq */ - sxq_Dims[0]=3; - capi_sxq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 7th argument `sxq`"; - capi_sxq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sxq_Dims,sxq_Rank, capi_sxq_intent,sxq_capi,capi_errmess); - if (capi_sxq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sxq = (double *)(PyArray_DATA(capi_sxq_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(phi, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.rotate_and_add_dyn() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(phi, 2) == nat,"shape(phi, 2) == nat","1st keyword nat","rotate_and_add_dyn:nat=%d",nat) { - /* Processing variable irt */ - irt_Dims[0]=48,irt_Dims[1]=nat; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 5th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - - /* Processing variable phi2 */ - phi2_Dims[0]=3,phi2_Dims[1]=3,phi2_Dims[2]=nat,phi2_Dims[3]=nat; - capi_phi2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the hidden `phi2`"; - capi_phi2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi2_Dims,phi2_Rank, capi_phi2_intent,Py_None,capi_errmess); - if (capi_phi2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phi2 = (complex_double *)(PyArray_DATA(capi_phi2_as_array)); - - /* Processing variable rtau */ - rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; - capi_rtau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rotate_and_add_dyn: failed to create array from the 6th argument `rtau`"; - capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,rtau_capi,capi_errmess); - if (capi_rtau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(phi,phi2,&nat,&isym,s,invs,irt,rtau,sxq); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_phi2_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_rtau_as_array!=rtau_capi) { - Py_XDECREF(capi_rtau_as_array); } - } /* if (capi_rtau_as_array == NULL) ... else of rtau */ - /* End of cleaning variable rtau */ - } /* if (capi_phi2_as_array == NULL) ... else of phi2 */ - /* End of cleaning variable phi2 */ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*CHECKSCALAR(shape(phi, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_sxq_as_array!=sxq_capi) { - Py_XDECREF(capi_sxq_as_array); } - } /* if (capi_sxq_as_array == NULL) ... else of sxq */ - /* End of cleaning variable sxq */ - if((PyObject *)capi_phi_as_array!=phi_capi) { - Py_XDECREF(capi_phi_as_array); } - } /* if (capi_phi_as_array == NULL) ... else of phi */ - /* End of cleaning variable phi */ - if((PyObject *)capi_invs_as_array!=invs_capi) { - Py_XDECREF(capi_invs_as_array); } - } /* if (capi_invs_as_array == NULL) ... else of invs */ - /* End of cleaning variable invs */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of isym*/ - /* End of cleaning variable isym */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of rotate_and_add_dyn *************************/ - -/********************************* set_irotmq *********************************/ -static char doc_f2py_rout_symph_set_irotmq[] = "\ -irotmq = set_irotmq(xq,s,nsymq,nsym,minus_q,bg,at,lgamma)\n\nWrapper for ``set_irotmq``.\ -\n\nParameters\n----------\n" -"xq : input rank-1 array('d') with bounds (3)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"nsymq : input int\n" -"nsym : input int\n" -"minus_q : input int\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"lgamma : input int\n" -"\nReturns\n-------\n" -"irotmq : int"; -/* extern void F_FUNC_US(set_irotmq,SET_IROTMQ)(double*,int*,int*,int*,int*,int*,double*,double*,int*); */ -static PyObject *f2py_rout_symph_set_irotmq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,int*,double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *xq = NULL; - npy_intp xq_Dims[1] = {-1}; - const int xq_Rank = 1; - PyArrayObject *capi_xq_as_array = NULL; - int capi_xq_intent = 0; - PyObject *xq_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int nsymq = 0; - PyObject *nsymq_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int irotmq = 0; - int minus_q = 0; - PyObject *minus_q_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - int lgamma = 0; - PyObject *lgamma_capi = Py_None; - static char *capi_kwlist[] = {"xq","s","nsymq","nsym","minus_q","bg","at","lgamma",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|:symph.set_irotmq",\ - capi_kwlist,&xq_capi,&s_capi,&nsymq_capi,&nsym_capi,&minus_q_capi,&bg_capi,&at_capi,&lgamma_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 7th argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 6th argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable xq */ - xq_Dims[0]=3; - capi_xq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 1st argument `xq`"; - capi_xq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xq_Dims,xq_Rank, capi_xq_intent,xq_capi,capi_errmess); - if (capi_xq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xq = (double *)(PyArray_DATA(capi_xq_as_array)); - - /* Processing variable minus_q */ - minus_q = (int)PyObject_IsTrue(minus_q_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_irotmq: failed to create array from the 2nd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable nsymq */ - f2py_success = int_from_pyobj(&nsymq,nsymq_capi,"symph.set_irotmq() 3rd argument (nsymq) can't be converted to int"); - if (f2py_success) { - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.set_irotmq() 4th argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable lgamma */ - lgamma = (int)PyObject_IsTrue(lgamma_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable irotmq */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(xq,s,&nsymq,&nsym,&irotmq,&minus_q,bg,at,&lgamma); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",irotmq); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable irotmq */ - } /*if (f2py_success) of lgamma*/ - /* End of cleaning variable lgamma */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - } /*if (f2py_success) of nsymq*/ - /* End of cleaning variable nsymq */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of minus_q*/ - /* End of cleaning variable minus_q */ - if((PyObject *)capi_xq_as_array!=xq_capi) { - Py_XDECREF(capi_xq_as_array); } - } /* if (capi_xq_as_array == NULL) ... else of xq */ - /* End of cleaning variable xq */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of set_irotmq *****************************/ - -/********************************* symmatrix *********************************/ -static char doc_f2py_rout_symph_symmatrix[] = "\ -symmatrix(matr,s,nsym,at,bg)\n\nWrapper for ``symmatrix``.\ -\n\nParameters\n----------\n" -"matr : in/output rank-2 array('d') with bounds (3,3)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"nsym : input int\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)"; -/* extern void F_FUNC(symmatrix,SYMMATRIX)(double*,int*,int*,double*,double*); */ -static PyObject *f2py_rout_symph_symmatrix(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *matr = NULL; - npy_intp matr_Dims[2] = {-1, -1}; - const int matr_Rank = 2; - PyArrayObject *capi_matr_as_array = NULL; - int capi_matr_intent = 0; - PyObject *matr_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - static char *capi_kwlist[] = {"matr","s","nsym","at","bg",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:symph.symmatrix",\ - capi_kwlist,&matr_capi,&s_capi,&nsym_capi,&at_capi,&bg_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable matr */ - matr_Dims[0]=3,matr_Dims[1]=3; - capi_matr_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 1st argument `matr`"; - capi_matr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,matr_Dims,matr_Rank, capi_matr_intent,matr_capi,capi_errmess); - if (capi_matr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - matr = (double *)(PyArray_DATA(capi_matr_as_array)); - - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.symmatrix() 3rd argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 2nd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 4th argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symmatrix: failed to create array from the 5th argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(matr,s,&nsym,at,bg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - if((PyObject *)capi_matr_as_array!=matr_capi) { - Py_XDECREF(capi_matr_as_array); } - } /* if (capi_matr_as_array == NULL) ... else of matr */ - /* End of cleaning variable matr */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of symmatrix ******************************/ - -/****************************** cart_to_crys_mat ******************************/ -static char doc_f2py_rout_symph_cart_to_crys_mat[] = "\ -cart_to_crys_mat(matr,at)\n\nWrapper for ``cart_to_crys_mat``.\ -\n\nParameters\n----------\n" -"matr : in/output rank-2 array('d') with bounds (3,3)\n" -"at : input rank-2 array('d') with bounds (3,3)"; -/* extern void F_FUNC_US(cart_to_crys_mat,CART_TO_CRYS_MAT)(double*,double*); */ -static PyObject *f2py_rout_symph_cart_to_crys_mat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *matr = NULL; - npy_intp matr_Dims[2] = {-1, -1}; - const int matr_Rank = 2; - PyArrayObject *capi_matr_as_array = NULL; - int capi_matr_intent = 0; - PyObject *matr_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - static char *capi_kwlist[] = {"matr","at",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.cart_to_crys_mat",\ - capi_kwlist,&matr_capi,&at_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable matr */ - matr_Dims[0]=3,matr_Dims[1]=3; - capi_matr_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.cart_to_crys_mat: failed to create array from the 1st argument `matr`"; - capi_matr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,matr_Dims,matr_Rank, capi_matr_intent,matr_capi,capi_errmess); - if (capi_matr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - matr = (double *)(PyArray_DATA(capi_matr_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.cart_to_crys_mat: failed to create array from the 2nd argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(matr,at); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_matr_as_array!=matr_capi) { - Py_XDECREF(capi_matr_as_array); } - } /* if (capi_matr_as_array == NULL) ... else of matr */ - /* End of cleaning variable matr */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of cart_to_crys_mat **************************/ - -/****************************** crys_to_cart_mat ******************************/ -static char doc_f2py_rout_symph_crys_to_cart_mat[] = "\ -crys_to_cart_mat(matr,bg)\n\nWrapper for ``crys_to_cart_mat``.\ -\n\nParameters\n----------\n" -"matr : in/output rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)"; -/* extern void F_FUNC_US(crys_to_cart_mat,CRYS_TO_CART_MAT)(double*,double*); */ -static PyObject *f2py_rout_symph_crys_to_cart_mat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *matr = NULL; - npy_intp matr_Dims[2] = {-1, -1}; - const int matr_Rank = 2; - PyArrayObject *capi_matr_as_array = NULL; - int capi_matr_intent = 0; - PyObject *matr_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - static char *capi_kwlist[] = {"matr","bg",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.crys_to_cart_mat",\ - capi_kwlist,&matr_capi,&bg_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable matr */ - matr_Dims[0]=3,matr_Dims[1]=3; - capi_matr_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.crys_to_cart_mat: failed to create array from the 1st argument `matr`"; - capi_matr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,matr_Dims,matr_Rank, capi_matr_intent,matr_capi,capi_errmess); - if (capi_matr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - matr = (double *)(PyArray_DATA(capi_matr_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.crys_to_cart_mat: failed to create array from the 2nd argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(matr,bg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_matr_as_array!=matr_capi) { - Py_XDECREF(capi_matr_as_array); } - } /* if (capi_matr_as_array == NULL) ... else of matr */ - /* End of cleaning variable matr */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of crys_to_cart_mat **************************/ - -/************************* contract_two_ph_propagator *************************/ -static char doc_f2py_rout_symph_contract_two_ph_propagator[] = "\ -f_output = contract_two_ph_propagator(w_array,w_mu,t,smearing,m,[n_w,n_modes])\n\nWrapper for ``contract_two_ph_propagator``.\ -\n\nParameters\n----------\n" -"w_array : input rank-1 array('d') with bounds (n_w)\n" -"w_mu : input rank-1 array('d') with bounds (n_modes)\n" -"t : input float\n" -"smearing : input float\n" -"m : input rank-2 array('d') with bounds (n_modes,n_modes)\n" -"\nOther Parameters\n----------------\n" -"n_w : input int, optional\n Default: shape(w_array, 0)\n" -"n_modes : input int, optional\n Default: shape(w_mu, 0)\n" -"\nReturns\n-------\n" -"f_output : rank-1 array('D') with bounds (n_w)"; -/* extern void F_FUNC_US(contract_two_ph_propagator,CONTRACT_TWO_PH_PROPAGATOR)(double*,double*,double*,double*,double*,complex_double*,int*,int*); */ -static PyObject *f2py_rout_symph_contract_two_ph_propagator(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *w_array = NULL; - npy_intp w_array_Dims[1] = {-1}; - const int w_array_Rank = 1; - PyArrayObject *capi_w_array_as_array = NULL; - int capi_w_array_intent = 0; - PyObject *w_array_capi = Py_None; - double *w_mu = NULL; - npy_intp w_mu_Dims[1] = {-1}; - const int w_mu_Rank = 1; - PyArrayObject *capi_w_mu_as_array = NULL; - int capi_w_mu_intent = 0; - PyObject *w_mu_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double smearing = 0; - PyObject *smearing_capi = Py_None; - double *m = NULL; - npy_intp m_Dims[2] = {-1, -1}; - const int m_Rank = 2; - PyArrayObject *capi_m_as_array = NULL; - int capi_m_intent = 0; - PyObject *m_capi = Py_None; - complex_double *f_output = NULL; - npy_intp f_output_Dims[1] = {-1}; - const int f_output_Rank = 1; - PyArrayObject *capi_f_output_as_array = NULL; - int capi_f_output_intent = 0; - int n_w = 0; - PyObject *n_w_capi = Py_None; - int n_modes = 0; - PyObject *n_modes_capi = Py_None; - static char *capi_kwlist[] = {"w_array","w_mu","t","smearing","m","n_w","n_modes",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:symph.contract_two_ph_propagator",\ - capi_kwlist,&w_array_capi,&w_mu_capi,&t_capi,&smearing_capi,&m_capi,&n_w_capi,&n_modes_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_array */ - ; - capi_w_array_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the 1st argument `w_array`"; - capi_w_array_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_array_Dims,w_array_Rank, capi_w_array_intent,w_array_capi,capi_errmess); - if (capi_w_array_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_array = (double *)(PyArray_DATA(capi_w_array_as_array)); - - /* Processing variable w_mu */ - ; - capi_w_mu_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the 2nd argument `w_mu`"; - capi_w_mu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_mu_Dims,w_mu_Rank, capi_w_mu_intent,w_mu_capi,capi_errmess); - if (capi_w_mu_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_mu = (double *)(PyArray_DATA(capi_w_mu_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"symph.contract_two_ph_propagator() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable smearing */ - f2py_success = double_from_pyobj(&smearing,smearing_capi,"symph.contract_two_ph_propagator() 4th argument (smearing) can't be converted to double"); - if (f2py_success) { - /* Processing variable n_w */ - if (n_w_capi == Py_None) n_w = shape(w_array, 0); else - f2py_success = int_from_pyobj(&n_w,n_w_capi,"symph.contract_two_ph_propagator() 1st keyword (n_w) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_array, 0) == n_w,"shape(w_array, 0) == n_w","1st keyword n_w","contract_two_ph_propagator:n_w=%d",n_w) { - /* Processing variable n_modes */ - if (n_modes_capi == Py_None) n_modes = shape(w_mu, 0); else - f2py_success = int_from_pyobj(&n_modes,n_modes_capi,"symph.contract_two_ph_propagator() 2nd keyword (n_modes) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_mu, 0) == n_modes,"shape(w_mu, 0) == n_modes","2nd keyword n_modes","contract_two_ph_propagator:n_modes=%d",n_modes) { - /* Processing variable m */ - m_Dims[0]=n_modes,m_Dims[1]=n_modes; - capi_m_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the 5th argument `m`"; - capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); - if (capi_m_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m = (double *)(PyArray_DATA(capi_m_as_array)); - - /* Processing variable f_output */ - f_output_Dims[0]=n_w; - capi_f_output_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.contract_two_ph_propagator: failed to create array from the hidden `f_output`"; - capi_f_output_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,f_output_Dims,f_output_Rank, capi_f_output_intent,Py_None,capi_errmess); - if (capi_f_output_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f_output = (complex_double *)(PyArray_DATA(capi_f_output_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(w_array,w_mu,&t,&smearing,m,f_output,&n_w,&n_modes); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_f_output_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_f_output_as_array == NULL) ... else of f_output */ - /* End of cleaning variable f_output */ - if((PyObject *)capi_m_as_array!=m_capi) { - Py_XDECREF(capi_m_as_array); } - } /* if (capi_m_as_array == NULL) ... else of m */ - /* End of cleaning variable m */ - } /*CHECKSCALAR(shape(w_mu, 0) == n_modes)*/ - } /*if (f2py_success) of n_modes*/ - /* End of cleaning variable n_modes */ - } /*CHECKSCALAR(shape(w_array, 0) == n_w)*/ - } /*if (f2py_success) of n_w*/ - /* End of cleaning variable n_w */ - } /*if (f2py_success) of smearing*/ - /* End of cleaning variable smearing */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_w_mu_as_array!=w_mu_capi) { - Py_XDECREF(capi_w_mu_as_array); } - } /* if (capi_w_mu_as_array == NULL) ... else of w_mu */ - /* End of cleaning variable w_mu */ - if((PyObject *)capi_w_array_as_array!=w_array_capi) { - Py_XDECREF(capi_w_array_as_array); } - } /* if (capi_w_array_as_array == NULL) ... else of w_array */ - /* End of cleaning variable w_array */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of contract_two_ph_propagator *********************/ - -/************************* get_two_phonon_propagator *************************/ -static char doc_f2py_rout_symph_get_two_phonon_propagator[] = "\ -chi = get_two_phonon_propagator(w_value,ws,t,smearing,[n_w])\n\nWrapper for ``get_two_phonon_propagator``.\ -\n\nParameters\n----------\n" -"w_value : input float\n" -"ws : input rank-1 array('d') with bounds (n_w)\n" -"t : input float\n" -"smearing : input float\n" -"\nOther Parameters\n----------------\n" -"n_w : input int, optional\n Default: shape(ws, 0)\n" -"\nReturns\n-------\n" -"chi : rank-2 array('D') with bounds (n_w,n_w)"; -/* extern void F_FUNC_US(get_two_phonon_propagator,GET_TWO_PHONON_PROPAGATOR)(double*,double*,double*,double*,complex_double*,int*); */ -static PyObject *f2py_rout_symph_get_two_phonon_propagator(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,complex_double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double w_value = 0; - PyObject *w_value_capi = Py_None; - double *ws = NULL; - npy_intp ws_Dims[1] = {-1}; - const int ws_Rank = 1; - PyArrayObject *capi_ws_as_array = NULL; - int capi_ws_intent = 0; - PyObject *ws_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double smearing = 0; - PyObject *smearing_capi = Py_None; - complex_double *chi = NULL; - npy_intp chi_Dims[2] = {-1, -1}; - const int chi_Rank = 2; - PyArrayObject *capi_chi_as_array = NULL; - int capi_chi_intent = 0; - int n_w = 0; - PyObject *n_w_capi = Py_None; - static char *capi_kwlist[] = {"w_value","ws","t","smearing","n_w",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|O:symph.get_two_phonon_propagator",\ - capi_kwlist,&w_value_capi,&ws_capi,&t_capi,&smearing_capi,&n_w_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_value */ - f2py_success = double_from_pyobj(&w_value,w_value_capi,"symph.get_two_phonon_propagator() 1st argument (w_value) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"symph.get_two_phonon_propagator() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable smearing */ - f2py_success = double_from_pyobj(&smearing,smearing_capi,"symph.get_two_phonon_propagator() 4th argument (smearing) can't be converted to double"); - if (f2py_success) { - /* Processing variable ws */ - ; - capi_ws_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_two_phonon_propagator: failed to create array from the 2nd argument `ws`"; - capi_ws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ws_Dims,ws_Rank, capi_ws_intent,ws_capi,capi_errmess); - if (capi_ws_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ws = (double *)(PyArray_DATA(capi_ws_as_array)); - - /* Processing variable n_w */ - if (n_w_capi == Py_None) n_w = shape(ws, 0); else - f2py_success = int_from_pyobj(&n_w,n_w_capi,"symph.get_two_phonon_propagator() 1st keyword (n_w) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ws, 0) == n_w,"shape(ws, 0) == n_w","1st keyword n_w","get_two_phonon_propagator:n_w=%d",n_w) { - /* Processing variable chi */ - chi_Dims[0]=n_w,chi_Dims[1]=n_w; - capi_chi_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_two_phonon_propagator: failed to create array from the hidden `chi`"; - capi_chi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,chi_Dims,chi_Rank, capi_chi_intent,Py_None,capi_errmess); - if (capi_chi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - chi = (complex_double *)(PyArray_DATA(capi_chi_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&w_value,ws,&t,&smearing,chi,&n_w); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_chi_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_chi_as_array == NULL) ... else of chi */ - /* End of cleaning variable chi */ - } /*CHECKSCALAR(shape(ws, 0) == n_w)*/ - } /*if (f2py_success) of n_w*/ - /* End of cleaning variable n_w */ - if((PyObject *)capi_ws_as_array!=ws_capi) { - Py_XDECREF(capi_ws_as_array); } - } /* if (capi_ws_as_array == NULL) ... else of ws */ - /* End of cleaning variable ws */ - } /*if (f2py_success) of smearing*/ - /* End of cleaning variable smearing */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of w_value*/ - /* End of cleaning variable w_value */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************** end of get_two_phonon_propagator **********************/ - -/*************************** fc_supercell_from_dyn ***************************/ -static char doc_f2py_rout_symph_fc_supercell_from_dyn[] = "\ -phitot_sc = fc_supercell_from_dyn(phitot,q,tau,tau_sc,itau,[nat,nq])\n\nWrapper for ``fc_supercell_from_dyn``.\ -\n\nParameters\n----------\n" -"phitot : input rank-5 array('D') with bounds (nq,3,3,nat,nat)\n" -"q : input rank-2 array('d') with bounds (3,nq)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"tau_sc : input rank-2 array('d') with bounds (3,nat * nq)\n" -"itau : input rank-1 array('i') with bounds (nat * nq)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(phitot, 3)\n" -"nq : input int, optional\n Default: shape(phitot, 0)\n" -"\nReturns\n-------\n" -"phitot_sc : rank-4 array('d') with bounds (3,3,nat * nq,nat * nq)"; -/* extern void F_FUNC_US(fc_supercell_from_dyn,FC_SUPERCELL_FROM_DYN)(complex_double*,double*,double*,double*,int*,double*,int*,int*); */ -static PyObject *f2py_rout_symph_fc_supercell_from_dyn(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,double*,double*,int*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *phitot = NULL; - npy_intp phitot_Dims[5] = {-1, -1, -1, -1, -1}; - const int phitot_Rank = 5; - PyArrayObject *capi_phitot_as_array = NULL; - int capi_phitot_intent = 0; - PyObject *phitot_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[2] = {-1, -1}; - const int q_Rank = 2; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tau_sc = NULL; - npy_intp tau_sc_Dims[2] = {-1, -1}; - const int tau_sc_Rank = 2; - PyArrayObject *capi_tau_sc_as_array = NULL; - int capi_tau_sc_intent = 0; - PyObject *tau_sc_capi = Py_None; - int *itau = NULL; - npy_intp itau_Dims[1] = {-1}; - const int itau_Rank = 1; - PyArrayObject *capi_itau_as_array = NULL; - int capi_itau_intent = 0; - PyObject *itau_capi = Py_None; - double *phitot_sc = NULL; - npy_intp phitot_sc_Dims[4] = {-1, -1, -1, -1}; - const int phitot_sc_Rank = 4; - PyArrayObject *capi_phitot_sc_as_array = NULL; - int capi_phitot_sc_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int nq = 0; - PyObject *nq_capi = Py_None; - static char *capi_kwlist[] = {"phitot","q","tau","tau_sc","itau","nat","nq",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:symph.fc_supercell_from_dyn",\ - capi_kwlist,&phitot_capi,&q_capi,&tau_capi,&tau_sc_capi,&itau_capi,&nat_capi,&nq_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable phitot */ - phitot_Dims[1]=3,phitot_Dims[2]=3; - capi_phitot_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 1st argument `phitot`"; - capi_phitot_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phitot_Dims,phitot_Rank, capi_phitot_intent,phitot_capi,capi_errmess); - if (capi_phitot_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phitot = (complex_double *)(PyArray_DATA(capi_phitot_as_array)); - - /* Processing variable nq */ - if (nq_capi == Py_None) nq = shape(phitot, 0); else - f2py_success = int_from_pyobj(&nq,nq_capi,"symph.fc_supercell_from_dyn() 2nd keyword (nq) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(phitot, 0) == nq,"shape(phitot, 0) == nq","2nd keyword nq","fc_supercell_from_dyn:nq=%d",nq) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(phitot, 3); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.fc_supercell_from_dyn() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(phitot, 3) == nat,"shape(phitot, 3) == nat","1st keyword nat","fc_supercell_from_dyn:nat=%d",nat) { - /* Processing variable q */ - q_Dims[0]=3,q_Dims[1]=nq; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 2nd argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable tau */ - tau_Dims[0]=3,tau_Dims[1]=nat; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 3rd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable tau_sc */ - tau_sc_Dims[0]=3,tau_sc_Dims[1]=nat * nq; - capi_tau_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 4th argument `tau_sc`"; - capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); - if (capi_tau_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); - - /* Processing variable itau */ - itau_Dims[0]=nat * nq; - capi_itau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the 5th argument `itau`"; - capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); - if (capi_itau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau = (int *)(PyArray_DATA(capi_itau_as_array)); - - /* Processing variable phitot_sc */ - phitot_sc_Dims[0]=3,phitot_sc_Dims[1]=3,phitot_sc_Dims[2]=nat * nq,phitot_sc_Dims[3]=nat * nq; - capi_phitot_sc_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.fc_supercell_from_dyn: failed to create array from the hidden `phitot_sc`"; - capi_phitot_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,phitot_sc_Dims,phitot_sc_Rank, capi_phitot_sc_intent,Py_None,capi_errmess); - if (capi_phitot_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phitot_sc = (double *)(PyArray_DATA(capi_phitot_sc_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(phitot,q,tau,tau_sc,itau,phitot_sc,&nat,&nq); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_phitot_sc_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_phitot_sc_as_array == NULL) ... else of phitot_sc */ - /* End of cleaning variable phitot_sc */ - if((PyObject *)capi_itau_as_array!=itau_capi) { - Py_XDECREF(capi_itau_as_array); } - } /* if (capi_itau_as_array == NULL) ... else of itau */ - /* End of cleaning variable itau */ - if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { - Py_XDECREF(capi_tau_sc_as_array); } - } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ - /* End of cleaning variable tau_sc */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ - } /*CHECKSCALAR(shape(phitot, 3) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(phitot, 0) == nq)*/ - } /*if (f2py_success) of nq*/ - /* End of cleaning variable nq */ - if((PyObject *)capi_phitot_as_array!=phitot_capi) { - Py_XDECREF(capi_phitot_as_array); } - } /* if (capi_phitot_as_array == NULL) ... else of phitot */ - /* End of cleaning variable phitot */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of fc_supercell_from_dyn ************************/ - -/************************ fast_ft_real_space_from_dynq ************************/ -static char doc_f2py_rout_symph_fast_ft_real_space_from_dynq[] = "\ -fc_supercell = fast_ft_real_space_from_dynq(unit_cell_coords,super_cell_coords,itau,q_tot,dynq,[nat,nat_sc,nq])\n\nWrapper for ``fast_ft_real_space_from_dynq``.\ -\n\nParameters\n----------\n" -"unit_cell_coords : input rank-2 array('d') with bounds (nat,3)\n" -"super_cell_coords : input rank-2 array('d') with bounds (nat_sc,3)\n" -"itau : input rank-1 array('i') with bounds (nat_sc)\n" -"q_tot : input rank-2 array('d') with bounds (nq,3)\n" -"dynq : input rank-3 array('D') with bounds (nq,3 * nat,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(unit_cell_coords, 0)\n" -"nat_sc : input int, optional\n Default: shape(super_cell_coords, 0)\n" -"nq : input int, optional\n Default: shape(q_tot, 0)\n" -"\nReturns\n-------\n" -"fc_supercell : rank-2 array('D') with bounds (3 * nat_sc,3 * nat_sc)"; -/* extern void F_FUNC_US(fast_ft_real_space_from_dynq,FAST_FT_REAL_SPACE_FROM_DYNQ)(double*,double*,int*,int*,int*,int*,double*,complex_double*,complex_double*); */ -static PyObject *f2py_rout_symph_fast_ft_real_space_from_dynq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,int*,double*,complex_double*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *unit_cell_coords = NULL; - npy_intp unit_cell_coords_Dims[2] = {-1, -1}; - const int unit_cell_coords_Rank = 2; - PyArrayObject *capi_unit_cell_coords_as_array = NULL; - int capi_unit_cell_coords_intent = 0; - PyObject *unit_cell_coords_capi = Py_None; - double *super_cell_coords = NULL; - npy_intp super_cell_coords_Dims[2] = {-1, -1}; - const int super_cell_coords_Rank = 2; - PyArrayObject *capi_super_cell_coords_as_array = NULL; - int capi_super_cell_coords_intent = 0; - PyObject *super_cell_coords_capi = Py_None; - int *itau = NULL; - npy_intp itau_Dims[1] = {-1}; - const int itau_Rank = 1; - PyArrayObject *capi_itau_as_array = NULL; - int capi_itau_intent = 0; - PyObject *itau_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - int nq = 0; - PyObject *nq_capi = Py_None; - double *q_tot = NULL; - npy_intp q_tot_Dims[2] = {-1, -1}; - const int q_tot_Rank = 2; - PyArrayObject *capi_q_tot_as_array = NULL; - int capi_q_tot_intent = 0; - PyObject *q_tot_capi = Py_None; - complex_double *dynq = NULL; - npy_intp dynq_Dims[3] = {-1, -1, -1}; - const int dynq_Rank = 3; - PyArrayObject *capi_dynq_as_array = NULL; - int capi_dynq_intent = 0; - PyObject *dynq_capi = Py_None; - complex_double *fc_supercell = NULL; - npy_intp fc_supercell_Dims[2] = {-1, -1}; - const int fc_supercell_Rank = 2; - PyArrayObject *capi_fc_supercell_as_array = NULL; - int capi_fc_supercell_intent = 0; - static char *capi_kwlist[] = {"unit_cell_coords","super_cell_coords","itau","q_tot","dynq","nat","nat_sc","nq",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OOO:symph.fast_ft_real_space_from_dynq",\ - capi_kwlist,&unit_cell_coords_capi,&super_cell_coords_capi,&itau_capi,&q_tot_capi,&dynq_capi,&nat_capi,&nat_sc_capi,&nq_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable unit_cell_coords */ - unit_cell_coords_Dims[1]=3; - capi_unit_cell_coords_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 1st argument `unit_cell_coords`"; - capi_unit_cell_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_coords_Dims,unit_cell_coords_Rank, capi_unit_cell_coords_intent,unit_cell_coords_capi,capi_errmess); - if (capi_unit_cell_coords_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - unit_cell_coords = (double *)(PyArray_DATA(capi_unit_cell_coords_as_array)); - - /* Processing variable super_cell_coords */ - super_cell_coords_Dims[1]=3; - capi_super_cell_coords_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 2nd argument `super_cell_coords`"; - capi_super_cell_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,super_cell_coords_Dims,super_cell_coords_Rank, capi_super_cell_coords_intent,super_cell_coords_capi,capi_errmess); - if (capi_super_cell_coords_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - super_cell_coords = (double *)(PyArray_DATA(capi_super_cell_coords_as_array)); - - /* Processing variable q_tot */ - q_tot_Dims[1]=3; - capi_q_tot_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 4th argument `q_tot`"; - capi_q_tot_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_tot_Dims,q_tot_Rank, capi_q_tot_intent,q_tot_capi,capi_errmess); - if (capi_q_tot_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q_tot = (double *)(PyArray_DATA(capi_q_tot_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(unit_cell_coords, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.fast_ft_real_space_from_dynq() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(unit_cell_coords, 0) == nat,"shape(unit_cell_coords, 0) == nat","1st keyword nat","fast_ft_real_space_from_dynq:nat=%d",nat) { - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(super_cell_coords, 0); else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.fast_ft_real_space_from_dynq() 2nd keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(super_cell_coords, 0) == nat_sc,"shape(super_cell_coords, 0) == nat_sc","2nd keyword nat_sc","fast_ft_real_space_from_dynq:nat_sc=%d",nat_sc) { - /* Processing variable nq */ - if (nq_capi == Py_None) nq = shape(q_tot, 0); else - f2py_success = int_from_pyobj(&nq,nq_capi,"symph.fast_ft_real_space_from_dynq() 3rd keyword (nq) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(q_tot, 0) == nq,"shape(q_tot, 0) == nq","3rd keyword nq","fast_ft_real_space_from_dynq:nq=%d",nq) { - /* Processing variable itau */ - itau_Dims[0]=nat_sc; - capi_itau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 3rd argument `itau`"; - capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); - if (capi_itau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau = (int *)(PyArray_DATA(capi_itau_as_array)); - - /* Processing variable dynq */ - dynq_Dims[0]=nq,dynq_Dims[1]=3 * nat,dynq_Dims[2]=3 * nat; - capi_dynq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the 5th argument `dynq`"; - capi_dynq_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dynq_Dims,dynq_Rank, capi_dynq_intent,dynq_capi,capi_errmess); - if (capi_dynq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dynq = (complex_double *)(PyArray_DATA(capi_dynq_as_array)); - - /* Processing variable fc_supercell */ - fc_supercell_Dims[0]=3 * nat_sc,fc_supercell_Dims[1]=3 * nat_sc; - capi_fc_supercell_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.fast_ft_real_space_from_dynq: failed to create array from the hidden `fc_supercell`"; - capi_fc_supercell_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_supercell_Dims,fc_supercell_Rank, capi_fc_supercell_intent,Py_None,capi_errmess); - if (capi_fc_supercell_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_supercell = (complex_double *)(PyArray_DATA(capi_fc_supercell_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(unit_cell_coords,super_cell_coords,itau,&nat,&nat_sc,&nq,q_tot,dynq,fc_supercell); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_supercell_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_supercell_as_array == NULL) ... else of fc_supercell */ - /* End of cleaning variable fc_supercell */ - if((PyObject *)capi_dynq_as_array!=dynq_capi) { - Py_XDECREF(capi_dynq_as_array); } - } /* if (capi_dynq_as_array == NULL) ... else of dynq */ - /* End of cleaning variable dynq */ - if((PyObject *)capi_itau_as_array!=itau_capi) { - Py_XDECREF(capi_itau_as_array); } - } /* if (capi_itau_as_array == NULL) ... else of itau */ - /* End of cleaning variable itau */ - } /*CHECKSCALAR(shape(q_tot, 0) == nq)*/ - } /*if (f2py_success) of nq*/ - /* End of cleaning variable nq */ - } /*CHECKSCALAR(shape(super_cell_coords, 0) == nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - } /*CHECKSCALAR(shape(unit_cell_coords, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_q_tot_as_array!=q_tot_capi) { - Py_XDECREF(capi_q_tot_as_array); } - } /* if (capi_q_tot_as_array == NULL) ... else of q_tot */ - /* End of cleaning variable q_tot */ - if((PyObject *)capi_super_cell_coords_as_array!=super_cell_coords_capi) { - Py_XDECREF(capi_super_cell_coords_as_array); } - } /* if (capi_super_cell_coords_as_array == NULL) ... else of super_cell_coords */ - /* End of cleaning variable super_cell_coords */ - if((PyObject *)capi_unit_cell_coords_as_array!=unit_cell_coords_capi) { - Py_XDECREF(capi_unit_cell_coords_as_array); } - } /* if (capi_unit_cell_coords_as_array == NULL) ... else of unit_cell_coords */ - /* End of cleaning variable unit_cell_coords */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of fast_ft_real_space_from_dynq ********************/ - -/****************************** impose_trans_sc ******************************/ -static char doc_f2py_rout_symph_impose_trans_sc[] = "\ -impose_trans_sc(fc_sc,tau_sc_cryst,itau,[nat_sc])\n\nWrapper for ``impose_trans_sc``.\ -\n\nParameters\n----------\n" -"fc_sc : in/output rank-4 array('d') with bounds (3,3,nat_sc,nat_sc)\n" -"tau_sc_cryst : input rank-2 array('d') with bounds (3,nat_sc)\n" -"itau : input rank-1 array('i') with bounds (nat_sc)\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(fc_sc, 2)"; -/* extern void F_FUNC_US(impose_trans_sc,IMPOSE_TRANS_SC)(double*,double*,int*,int*); */ -static PyObject *f2py_rout_symph_impose_trans_sc(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc_sc = NULL; - npy_intp fc_sc_Dims[4] = {-1, -1, -1, -1}; - const int fc_sc_Rank = 4; - PyArrayObject *capi_fc_sc_as_array = NULL; - int capi_fc_sc_intent = 0; - PyObject *fc_sc_capi = Py_None; - double *tau_sc_cryst = NULL; - npy_intp tau_sc_cryst_Dims[2] = {-1, -1}; - const int tau_sc_cryst_Rank = 2; - PyArrayObject *capi_tau_sc_cryst_as_array = NULL; - int capi_tau_sc_cryst_intent = 0; - PyObject *tau_sc_cryst_capi = Py_None; - int *itau = NULL; - npy_intp itau_Dims[1] = {-1}; - const int itau_Rank = 1; - PyArrayObject *capi_itau_as_array = NULL; - int capi_itau_intent = 0; - PyObject *itau_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - static char *capi_kwlist[] = {"fc_sc","tau_sc_cryst","itau","nat_sc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:symph.impose_trans_sc",\ - capi_kwlist,&fc_sc_capi,&tau_sc_cryst_capi,&itau_capi,&nat_sc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc_sc */ - fc_sc_Dims[0]=3,fc_sc_Dims[1]=3; - capi_fc_sc_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.impose_trans_sc: failed to create array from the 1st argument `fc_sc`"; - capi_fc_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_sc_Dims,fc_sc_Rank, capi_fc_sc_intent,fc_sc_capi,capi_errmess); - if (capi_fc_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_sc = (double *)(PyArray_DATA(capi_fc_sc_as_array)); - - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(fc_sc, 2); else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.impose_trans_sc() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc_sc, 2) == nat_sc,"shape(fc_sc, 2) == nat_sc","1st keyword nat_sc","impose_trans_sc:nat_sc=%d",nat_sc) { - /* Processing variable tau_sc_cryst */ - tau_sc_cryst_Dims[0]=3,tau_sc_cryst_Dims[1]=nat_sc; - capi_tau_sc_cryst_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.impose_trans_sc: failed to create array from the 2nd argument `tau_sc_cryst`"; - capi_tau_sc_cryst_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_cryst_Dims,tau_sc_cryst_Rank, capi_tau_sc_cryst_intent,tau_sc_cryst_capi,capi_errmess); - if (capi_tau_sc_cryst_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc_cryst = (double *)(PyArray_DATA(capi_tau_sc_cryst_as_array)); - - /* Processing variable itau */ - itau_Dims[0]=nat_sc; - capi_itau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.impose_trans_sc: failed to create array from the 3rd argument `itau`"; - capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); - if (capi_itau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau = (int *)(PyArray_DATA(capi_itau_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc_sc,tau_sc_cryst,itau,&nat_sc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_itau_as_array!=itau_capi) { - Py_XDECREF(capi_itau_as_array); } - } /* if (capi_itau_as_array == NULL) ... else of itau */ - /* End of cleaning variable itau */ - if((PyObject *)capi_tau_sc_cryst_as_array!=tau_sc_cryst_capi) { - Py_XDECREF(capi_tau_sc_cryst_as_array); } - } /* if (capi_tau_sc_cryst_as_array == NULL) ... else of tau_sc_cryst */ - /* End of cleaning variable tau_sc_cryst */ - } /*CHECKSCALAR(shape(fc_sc, 2) == nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - if((PyObject *)capi_fc_sc_as_array!=fc_sc_capi) { - Py_XDECREF(capi_fc_sc_as_array); } - } /* if (capi_fc_sc_as_array == NULL) ... else of fc_sc */ - /* End of cleaning variable fc_sc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of impose_trans_sc ***************************/ - -/******************************** dyn_from_fc ********************************/ -static char doc_f2py_rout_symph_dyn_from_fc[] = "\ -dyn = dyn_from_fc(phitot_sc,q,tau,tau_sc,itau,nq,nat)\n\nWrapper for ``dyn_from_fc``.\ -\n\nParameters\n----------\n" -"phitot_sc : input rank-4 array('d') with bounds (3,3,nat * nq,nat * nq)\n" -"q : input rank-2 array('d') with bounds (3,nq)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"tau_sc : input rank-2 array('d') with bounds (3,nat * nq)\n" -"itau : input rank-1 array('i') with bounds (nat * nq)\n" -"nq : input int, optional\n Default: shape(q, 1)\n" -"nat : input int, optional\n Default: shape(tau, 1)\n" -"\nReturns\n-------\n" -"dyn : rank-5 array('D') with bounds (nq,3,3,nat,nat)"; -/* extern void F_FUNC_US(dyn_from_fc,DYN_FROM_FC)(double*,double*,double*,double*,int*,complex_double*,int*,int*); */ -static PyObject *f2py_rout_symph_dyn_from_fc(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *phitot_sc = NULL; - npy_intp phitot_sc_Dims[4] = {-1, -1, -1, -1}; - const int phitot_sc_Rank = 4; - PyArrayObject *capi_phitot_sc_as_array = NULL; - int capi_phitot_sc_intent = 0; - PyObject *phitot_sc_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[2] = {-1, -1}; - const int q_Rank = 2; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tau_sc = NULL; - npy_intp tau_sc_Dims[2] = {-1, -1}; - const int tau_sc_Rank = 2; - PyArrayObject *capi_tau_sc_as_array = NULL; - int capi_tau_sc_intent = 0; - PyObject *tau_sc_capi = Py_None; - int *itau = NULL; - npy_intp itau_Dims[1] = {-1}; - const int itau_Rank = 1; - PyArrayObject *capi_itau_as_array = NULL; - int capi_itau_intent = 0; - PyObject *itau_capi = Py_None; - complex_double *dyn = NULL; - npy_intp dyn_Dims[5] = {-1, -1, -1, -1, -1}; - const int dyn_Rank = 5; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - int nq = 0; - PyObject *nq_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"phitot_sc","q","tau","tau_sc","itau","nq","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|:symph.dyn_from_fc",\ - capi_kwlist,&phitot_sc_capi,&q_capi,&tau_capi,&tau_sc_capi,&itau_capi,&nq_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 2nd argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 3rd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable nq */ - if (nq_capi == Py_None) nq = shape(q, 1); else - f2py_success = int_from_pyobj(&nq,nq_capi,"symph.dyn_from_fc() 6th argument (nq) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(q, 1) == nq,"shape(q, 1) == nq","6th argument nq","dyn_from_fc:nq=%d",nq) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.dyn_from_fc() 7th argument (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","7th argument nat","dyn_from_fc:nat=%d",nat) { - /* Processing variable phitot_sc */ - phitot_sc_Dims[0]=3,phitot_sc_Dims[1]=3,phitot_sc_Dims[2]=nat * nq,phitot_sc_Dims[3]=nat * nq; - capi_phitot_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 1st argument `phitot_sc`"; - capi_phitot_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,phitot_sc_Dims,phitot_sc_Rank, capi_phitot_sc_intent,phitot_sc_capi,capi_errmess); - if (capi_phitot_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phitot_sc = (double *)(PyArray_DATA(capi_phitot_sc_as_array)); - - CHECKARRAY(shape(phitot_sc, 2) == nat * nq,"shape(phitot_sc, 2) == nat * nq","1st argument phitot_sc") { - CHECKARRAY(shape(phitot_sc, 2) == nat * nq,"shape(phitot_sc, 2) == nat * nq","1st argument phitot_sc") { - /* Processing variable tau_sc */ - tau_sc_Dims[0]=3,tau_sc_Dims[1]=nat * nq; - capi_tau_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 4th argument `tau_sc`"; - capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); - if (capi_tau_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); - - /* Processing variable itau */ - itau_Dims[0]=nat * nq; - capi_itau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the 5th argument `itau`"; - capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); - if (capi_itau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau = (int *)(PyArray_DATA(capi_itau_as_array)); - - /* Processing variable dyn */ - dyn_Dims[0]=nq,dyn_Dims[1]=3,dyn_Dims[2]=3,dyn_Dims[3]=nat,dyn_Dims[4]=nat; - capi_dyn_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.dyn_from_fc: failed to create array from the hidden `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,Py_None,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(phitot_sc,q,tau,tau_sc,itau,dyn,&nq,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_dyn_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - if((PyObject *)capi_itau_as_array!=itau_capi) { - Py_XDECREF(capi_itau_as_array); } - } /* if (capi_itau_as_array == NULL) ... else of itau */ - /* End of cleaning variable itau */ - if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { - Py_XDECREF(capi_tau_sc_as_array); } - } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ - /* End of cleaning variable tau_sc */ - } /*CHECKARRAY(shape(phitot_sc, 2) == nat * nq)*/ - } /*CHECKARRAY(shape(phitot_sc, 2) == nat * nq)*/ - if((PyObject *)capi_phitot_sc_as_array!=phitot_sc_capi) { - Py_XDECREF(capi_phitot_sc_as_array); } - } /* if (capi_phitot_sc_as_array == NULL) ... else of phitot_sc */ - /* End of cleaning variable phitot_sc */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(q, 1) == nq)*/ - } /*if (f2py_success) of nq*/ - /* End of cleaning variable nq */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of dyn_from_fc *****************************/ - -/********************************* get_q_grid *********************************/ -static char doc_f2py_rout_symph_get_q_grid[] = "\ -q_list = get_q_grid(bg,supercell_size,n_size)\n\nWrapper for ``get_q_grid``.\ -\n\nParameters\n----------\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"supercell_size : input rank-1 array('i') with bounds (3)\n" -"n_size : input int\n" -"\nReturns\n-------\n" -"q_list : rank-2 array('d') with bounds (3,n_size)"; -/* extern void F_FUNC_US(get_q_grid,GET_Q_GRID)(double*,int*,double*,int*); */ -static PyObject *f2py_rout_symph_get_q_grid(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - int *supercell_size = NULL; - npy_intp supercell_size_Dims[1] = {-1}; - const int supercell_size_Rank = 1; - PyArrayObject *capi_supercell_size_as_array = NULL; - int capi_supercell_size_intent = 0; - PyObject *supercell_size_capi = Py_None; - double *q_list = NULL; - npy_intp q_list_Dims[2] = {-1, -1}; - const int q_list_Rank = 2; - PyArrayObject *capi_q_list_as_array = NULL; - int capi_q_list_intent = 0; - int n_size = 0; - PyObject *n_size_capi = Py_None; - static char *capi_kwlist[] = {"bg","supercell_size","n_size",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:symph.get_q_grid",\ - capi_kwlist,&bg_capi,&supercell_size_capi,&n_size_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_q_grid: failed to create array from the 1st argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable supercell_size */ - supercell_size_Dims[0]=3; - capi_supercell_size_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_q_grid: failed to create array from the 2nd argument `supercell_size`"; - capi_supercell_size_as_array = ndarray_from_pyobj( NPY_INT,1,supercell_size_Dims,supercell_size_Rank, capi_supercell_size_intent,supercell_size_capi,capi_errmess); - if (capi_supercell_size_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - supercell_size = (int *)(PyArray_DATA(capi_supercell_size_as_array)); - - /* Processing variable n_size */ - f2py_success = int_from_pyobj(&n_size,n_size_capi,"symph.get_q_grid() 3rd argument (n_size) can't be converted to int"); - if (f2py_success) { - /* Processing variable q_list */ - q_list_Dims[0]=3,q_list_Dims[1]=n_size; - capi_q_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_q_grid: failed to create array from the hidden `q_list`"; - capi_q_list_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_list_Dims,q_list_Rank, capi_q_list_intent,Py_None,capi_errmess); - if (capi_q_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q_list = (double *)(PyArray_DATA(capi_q_list_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(bg,supercell_size,q_list,&n_size); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_q_list_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_q_list_as_array == NULL) ... else of q_list */ - /* End of cleaning variable q_list */ - } /*if (f2py_success) of n_size*/ - /* End of cleaning variable n_size */ - if((PyObject *)capi_supercell_size_as_array!=supercell_size_capi) { - Py_XDECREF(capi_supercell_size_as_array); } - } /* if (capi_supercell_size_as_array == NULL) ... else of supercell_size */ - /* End of cleaning variable supercell_size */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of get_q_grid *****************************/ - -/*********************************** star_q ***********************************/ -static char doc_f2py_rout_symph_star_q[] = "\ -nq,sxq,isq,imq = star_q(xq,at,bg,nsym,s,invs,verbosity)\n\nWrapper for ``star_q``.\ -\n\nParameters\n----------\n" -"xq : input rank-1 array('d') with bounds (3)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"nsym : input int\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"invs : input rank-1 array('i') with bounds (48)\n" -"verbosity : input int\n" -"\nReturns\n-------\n" -"nq : int\n" -"sxq : rank-2 array('d') with bounds (3,48)\n" -"isq : rank-1 array('i') with bounds (48)\n" -"imq : int"; -/* extern void F_FUNC_US(star_q,STAR_Q)(double*,double*,double*,int*,int*,int*,int*,double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_star_q(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *xq = NULL; - npy_intp xq_Dims[1] = {-1}; - const int xq_Rank = 1; - PyArrayObject *capi_xq_as_array = NULL; - int capi_xq_intent = 0; - PyObject *xq_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *invs = NULL; - npy_intp invs_Dims[1] = {-1}; - const int invs_Rank = 1; - PyArrayObject *capi_invs_as_array = NULL; - int capi_invs_intent = 0; - PyObject *invs_capi = Py_None; - int nq = 0; - double *sxq = NULL; - npy_intp sxq_Dims[2] = {-1, -1}; - const int sxq_Rank = 2; - PyArrayObject *capi_sxq_as_array = NULL; - int capi_sxq_intent = 0; - int *isq = NULL; - npy_intp isq_Dims[1] = {-1}; - const int isq_Rank = 1; - PyArrayObject *capi_isq_as_array = NULL; - int capi_isq_intent = 0; - int imq = 0; - int verbosity = 0; - PyObject *verbosity_capi = Py_None; - static char *capi_kwlist[] = {"xq","at","bg","nsym","s","invs","verbosity",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|:symph.star_q",\ - capi_kwlist,&xq_capi,&at_capi,&bg_capi,&nsym_capi,&s_capi,&invs_capi,&verbosity_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.star_q() 4th argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the 5th argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable invs */ - invs_Dims[0]=48; - capi_invs_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the 6th argument `invs`"; - capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); - if (capi_invs_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - invs = (int *)(PyArray_DATA(capi_invs_as_array)); - - /* Processing variable xq */ - xq_Dims[0]=3; - capi_xq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the 1st argument `xq`"; - capi_xq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xq_Dims,xq_Rank, capi_xq_intent,xq_capi,capi_errmess); - if (capi_xq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xq = (double *)(PyArray_DATA(capi_xq_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the 2nd argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the 3rd argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable nq */ - /* Processing variable isq */ - isq_Dims[0]=48; - capi_isq_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the hidden `isq`"; - capi_isq_as_array = ndarray_from_pyobj( NPY_INT,1,isq_Dims,isq_Rank, capi_isq_intent,Py_None,capi_errmess); - if (capi_isq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - isq = (int *)(PyArray_DATA(capi_isq_as_array)); - - /* Processing variable imq */ - /* Processing variable sxq */ - sxq_Dims[0]=3,sxq_Dims[1]=48; - capi_sxq_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.star_q: failed to create array from the hidden `sxq`"; - capi_sxq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sxq_Dims,sxq_Rank, capi_sxq_intent,Py_None,capi_errmess); - if (capi_sxq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sxq = (double *)(PyArray_DATA(capi_sxq_as_array)); - - /* Processing variable verbosity */ - verbosity = (int)PyObject_IsTrue(verbosity_capi); - f2py_success = 1; - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(xq,at,bg,&nsym,s,invs,&nq,sxq,isq,&imq,&verbosity); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("iNNi",nq,capi_sxq_as_array,capi_isq_as_array,imq); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of verbosity*/ - /* End of cleaning variable verbosity */ - } /* if (capi_sxq_as_array == NULL) ... else of sxq */ - /* End of cleaning variable sxq */ - /* End of cleaning variable imq */ - } /* if (capi_isq_as_array == NULL) ... else of isq */ - /* End of cleaning variable isq */ - /* End of cleaning variable nq */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_xq_as_array!=xq_capi) { - Py_XDECREF(capi_xq_as_array); } - } /* if (capi_xq_as_array == NULL) ... else of xq */ - /* End of cleaning variable xq */ - if((PyObject *)capi_invs_as_array!=invs_capi) { - Py_XDECREF(capi_invs_as_array); } - } /* if (capi_invs_as_array == NULL) ... else of invs */ - /* End of cleaning variable invs */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of star_q *******************************/ - -/********************************* symvector *********************************/ -static char doc_f2py_rout_symph_symvector[] = "\ -symvector(nsym,irt,s,at,bg,vect,[nat])\n\nWrapper for ``symvector``.\ -\n\nParameters\n----------\n" -"nsym : input int\n" -"irt : input rank-2 array('i') with bounds (48,nat)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"vect : in/output rank-2 array('d') with bounds (3,nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(irt, 1)"; -/* extern void F_FUNC(symvector,SYMVECTOR)(int*,int*,int*,int*,double*,double*,double*); */ -static PyObject *f2py_rout_symph_symvector(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - double *vect = NULL; - npy_intp vect_Dims[2] = {-1, -1}; - const int vect_Rank = 2; - PyArrayObject *capi_vect_as_array = NULL; - int capi_vect_intent = 0; - PyObject *vect_capi = Py_None; - static char *capi_kwlist[] = {"nsym","irt","s","at","bg","vect","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|O:symph.symvector",\ - capi_kwlist,&nsym_capi,&irt_capi,&s_capi,&at_capi,&bg_capi,&vect_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.symvector() 1st argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable irt */ - irt_Dims[0]=48; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symvector: failed to create array from the 2nd argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symvector: failed to create array from the 3rd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symvector: failed to create array from the 4th argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symvector: failed to create array from the 5th argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(irt, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symvector() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irt, 1) == nat,"shape(irt, 1) == nat","1st keyword nat","symvector:nat=%d",nat) { - /* Processing variable vect */ - vect_Dims[0]=3,vect_Dims[1]=nat; - capi_vect_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.symvector: failed to create array from the 6th argument `vect`"; - capi_vect_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vect_Dims,vect_Rank, capi_vect_intent,vect_capi,capi_errmess); - if (capi_vect_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - vect = (double *)(PyArray_DATA(capi_vect_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,&nsym,irt,s,at,bg,vect); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_vect_as_array!=vect_capi) { - Py_XDECREF(capi_vect_as_array); } - } /* if (capi_vect_as_array == NULL) ... else of vect */ - /* End of cleaning variable vect */ - } /*CHECKSCALAR(shape(irt, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of symvector ******************************/ - -/******************************* cryst_to_cart *******************************/ -static char doc_f2py_rout_symph_cryst_to_cart[] = "\ -cryst_to_cart(vec,trmat,iflag,[nvec])\n\nWrapper for ``cryst_to_cart``.\ -\n\nParameters\n----------\n" -"vec : in/output rank-2 array('d') with bounds (3,nvec)\n" -"trmat : input rank-2 array('d') with bounds (3,3)\n" -"iflag : input int\n" -"\nOther Parameters\n----------------\n" -"nvec : input int, optional\n Default: shape(vec, 1)"; -/* extern void F_FUNC_US(cryst_to_cart,CRYST_TO_CART)(int*,double*,double*,int*); */ -static PyObject *f2py_rout_symph_cryst_to_cart(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nvec = 0; - PyObject *nvec_capi = Py_None; - double *vec = NULL; - npy_intp vec_Dims[2] = {-1, -1}; - const int vec_Rank = 2; - PyArrayObject *capi_vec_as_array = NULL; - int capi_vec_intent = 0; - PyObject *vec_capi = Py_None; - double *trmat = NULL; - npy_intp trmat_Dims[2] = {-1, -1}; - const int trmat_Rank = 2; - PyArrayObject *capi_trmat_as_array = NULL; - int capi_trmat_intent = 0; - PyObject *trmat_capi = Py_None; - int iflag = 0; - PyObject *iflag_capi = Py_None; - static char *capi_kwlist[] = {"vec","trmat","iflag","nvec",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:symph.cryst_to_cart",\ - capi_kwlist,&vec_capi,&trmat_capi,&iflag_capi,&nvec_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable iflag */ - f2py_success = int_from_pyobj(&iflag,iflag_capi,"symph.cryst_to_cart() 3rd argument (iflag) can't be converted to int"); - if (f2py_success) { - /* Processing variable trmat */ - trmat_Dims[0]=3,trmat_Dims[1]=3; - capi_trmat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.cryst_to_cart: failed to create array from the 2nd argument `trmat`"; - capi_trmat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,trmat_Dims,trmat_Rank, capi_trmat_intent,trmat_capi,capi_errmess); - if (capi_trmat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - trmat = (double *)(PyArray_DATA(capi_trmat_as_array)); - - /* Processing variable vec */ - vec_Dims[0]=3; - capi_vec_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.cryst_to_cart: failed to create array from the 1st argument `vec`"; - capi_vec_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vec_Dims,vec_Rank, capi_vec_intent,vec_capi,capi_errmess); - if (capi_vec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - vec = (double *)(PyArray_DATA(capi_vec_as_array)); - - /* Processing variable nvec */ - if (nvec_capi == Py_None) nvec = shape(vec, 1); else - f2py_success = int_from_pyobj(&nvec,nvec_capi,"symph.cryst_to_cart() 1st keyword (nvec) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(vec, 1) == nvec,"shape(vec, 1) == nvec","1st keyword nvec","cryst_to_cart:nvec=%d",nvec) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nvec,vec,trmat,&iflag); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(vec, 1) == nvec)*/ - } /*if (f2py_success) of nvec*/ - /* End of cleaning variable nvec */ - if((PyObject *)capi_vec_as_array!=vec_capi) { - Py_XDECREF(capi_vec_as_array); } - } /* if (capi_vec_as_array == NULL) ... else of vec */ - /* End of cleaning variable vec */ - if((PyObject *)capi_trmat_as_array!=trmat_capi) { - Py_XDECREF(capi_trmat_as_array); } - } /* if (capi_trmat_as_array == NULL) ... else of trmat */ - /* End of cleaning variable trmat */ - } /*if (f2py_success) of iflag*/ - /* End of cleaning variable iflag */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of cryst_to_cart ****************************/ - -/********************************* flush_unit *********************************/ -static char doc_f2py_rout_symph_flush_unit[] = "\ -flush_unit(unit_tobeflushed)\n\nWrapper for ``flush_unit``.\ -\n\nParameters\n----------\n" -"unit_tobeflushed : input int"; -/* extern void F_FUNC_US(flush_unit,FLUSH_UNIT)(int*); */ -static PyObject *f2py_rout_symph_flush_unit(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int unit_tobeflushed = 0; - PyObject *unit_tobeflushed_capi = Py_None; - static char *capi_kwlist[] = {"unit_tobeflushed",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:symph.flush_unit",\ - capi_kwlist,&unit_tobeflushed_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable unit_tobeflushed */ - f2py_success = int_from_pyobj(&unit_tobeflushed,unit_tobeflushed_capi,"symph.flush_unit() 1st argument (unit_tobeflushed) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&unit_tobeflushed); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of unit_tobeflushed*/ - /* End of cleaning variable unit_tobeflushed */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of flush_unit *****************************/ - -/****************************** get_translations ******************************/ -static char doc_f2py_rout_symph_get_translations[] = "\ -trans = get_translations(pols,masses,[nmod,nat])\n\nWrapper for ``get_translations``.\ -\n\nParameters\n----------\n" -"pols : input rank-2 array('d') with bounds (3 * nat,nmod)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nmod : input int, optional\n Default: shape(pols, 1)\n" -"nat : input int, optional\n Default: shape(pols, 0) / 3\n" -"\nReturns\n-------\n" -"trans : rank-1 array('i') with bounds (nmod)"; -/* extern void F_FUNC_US(get_translations,GET_TRANSLATIONS)(double*,double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_get_translations(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *pols = NULL; - npy_intp pols_Dims[2] = {-1, -1}; - const int pols_Rank = 2; - PyArrayObject *capi_pols_as_array = NULL; - int capi_pols_intent = 0; - PyObject *pols_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - int nmod = 0; - PyObject *nmod_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int *trans = NULL; - npy_intp trans_Dims[1] = {-1}; - const int trans_Rank = 1; - PyArrayObject *capi_trans_as_array = NULL; - int capi_trans_intent = 0; - static char *capi_kwlist[] = {"pols","masses","nmod","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|OO:symph.get_translations",\ - capi_kwlist,&pols_capi,&masses_capi,&nmod_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable pols */ - ; - capi_pols_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_translations: failed to create array from the 1st argument `pols`"; - capi_pols_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pols_Dims,pols_Rank, capi_pols_intent,pols_capi,capi_errmess); - if (capi_pols_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pols = (double *)(PyArray_DATA(capi_pols_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(pols, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_translations() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(pols, 0) == 3 * nat,"shape(pols, 0) == 3 * nat","2nd keyword nat","get_translations:nat=%d",nat) { - /* Processing variable nmod */ - if (nmod_capi == Py_None) nmod = shape(pols, 1); else - f2py_success = int_from_pyobj(&nmod,nmod_capi,"symph.get_translations() 1st keyword (nmod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(pols, 1) == nmod,"shape(pols, 1) == nmod","1st keyword nmod","get_translations:nmod=%d",nmod) { - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_translations: failed to create array from the 2nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable trans */ - trans_Dims[0]=nmod; - capi_trans_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_translations: failed to create array from the hidden `trans`"; - capi_trans_as_array = ndarray_from_pyobj( NPY_INT,1,trans_Dims,trans_Rank, capi_trans_intent,Py_None,capi_errmess); - if (capi_trans_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - trans = (int *)(PyArray_DATA(capi_trans_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(pols,masses,&nmod,&nat,trans); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_trans_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_trans_as_array == NULL) ... else of trans */ - /* End of cleaning variable trans */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - } /*CHECKSCALAR(shape(pols, 1) == nmod)*/ - } /*if (f2py_success) of nmod*/ - /* End of cleaning variable nmod */ - } /*CHECKSCALAR(shape(pols, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_pols_as_array!=pols_capi) { - Py_XDECREF(capi_pols_as_array); } - } /* if (capi_pols_as_array == NULL) ... else of pols */ - /* End of cleaning variable pols */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of get_translations **************************/ - -/******************************** q2qstar_out ********************************/ -static char doc_f2py_rout_symph_q2qstar_out[] = "\ -dynqstar = q2qstar_out(dyn,at,bg,nsym,s,invs,irt,rtau,nq,sxq,isq,imq,nqtot,[nat])\n\nWrapper for ``q2qstar_out``.\ -\n\nParameters\n----------\n" -"dyn : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"nsym : input int\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"invs : input rank-1 array('i') with bounds (48)\n" -"irt : input rank-2 array('i') with bounds (48,nat)\n" -"rtau : input rank-3 array('d') with bounds (3,48,nat)\n" -"nq : input int\n" -"sxq : input rank-2 array('d') with bounds (3,48)\n" -"isq : input rank-1 array('i') with bounds (48)\n" -"imq : input int\n" -"nqtot : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(dyn, 0) / 3\n" -"\nReturns\n-------\n" -"dynqstar : rank-5 array('D') with bounds (nqtot,3,3,nat,nat)"; -/* extern void F_FUNC_US(q2qstar_out,Q2QSTAR_OUT)(complex_double*,double*,double*,int*,int*,int*,int*,int*,double*,int*,double*,int*,int*,int*,complex_double*); */ -static PyObject *f2py_rout_symph_q2qstar_out(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,double*,int*,int*,int*,int*,int*,double*,int*,double*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *dyn = NULL; - npy_intp dyn_Dims[2] = {-1, -1}; - const int dyn_Rank = 2; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - PyObject *dyn_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *invs = NULL; - npy_intp invs_Dims[1] = {-1}; - const int invs_Rank = 1; - PyArrayObject *capi_invs_as_array = NULL; - int capi_invs_intent = 0; - PyObject *invs_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - double *rtau = NULL; - npy_intp rtau_Dims[3] = {-1, -1, -1}; - const int rtau_Rank = 3; - PyArrayObject *capi_rtau_as_array = NULL; - int capi_rtau_intent = 0; - PyObject *rtau_capi = Py_None; - int nq = 0; - PyObject *nq_capi = Py_None; - double *sxq = NULL; - npy_intp sxq_Dims[2] = {-1, -1}; - const int sxq_Rank = 2; - PyArrayObject *capi_sxq_as_array = NULL; - int capi_sxq_intent = 0; - PyObject *sxq_capi = Py_None; - int *isq = NULL; - npy_intp isq_Dims[1] = {-1}; - const int isq_Rank = 1; - PyArrayObject *capi_isq_as_array = NULL; - int capi_isq_intent = 0; - PyObject *isq_capi = Py_None; - int imq = 0; - PyObject *imq_capi = Py_None; - int nqtot = 0; - PyObject *nqtot_capi = Py_None; - complex_double *dynqstar = NULL; - npy_intp dynqstar_Dims[5] = {-1, -1, -1, -1, -1}; - const int dynqstar_Rank = 5; - PyArrayObject *capi_dynqstar_as_array = NULL; - int capi_dynqstar_intent = 0; - static char *capi_kwlist[] = {"dyn","at","bg","nsym","s","invs","irt","rtau","nq","sxq","isq","imq","nqtot","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOO|O:symph.q2qstar_out",\ - capi_kwlist,&dyn_capi,&at_capi,&bg_capi,&nsym_capi,&s_capi,&invs_capi,&irt_capi,&rtau_capi,&nq_capi,&sxq_capi,&isq_capi,&imq_capi,&nqtot_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.q2qstar_out() 4th argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 5th argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable invs */ - invs_Dims[0]=48; - capi_invs_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 6th argument `invs`"; - capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); - if (capi_invs_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - invs = (int *)(PyArray_DATA(capi_invs_as_array)); - - /* Processing variable nq */ - f2py_success = int_from_pyobj(&nq,nq_capi,"symph.q2qstar_out() 9th argument (nq) can't be converted to int"); - if (f2py_success) { - /* Processing variable isq */ - isq_Dims[0]=48; - capi_isq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 11st argument `isq`"; - capi_isq_as_array = ndarray_from_pyobj( NPY_INT,1,isq_Dims,isq_Rank, capi_isq_intent,isq_capi,capi_errmess); - if (capi_isq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - isq = (int *)(PyArray_DATA(capi_isq_as_array)); - - /* Processing variable imq */ - f2py_success = int_from_pyobj(&imq,imq_capi,"symph.q2qstar_out() 12nd argument (imq) can't be converted to int"); - if (f2py_success) { - /* Processing variable nqtot */ - f2py_success = int_from_pyobj(&nqtot,nqtot_capi,"symph.q2qstar_out() 13rd argument (nqtot) can't be converted to int"); - if (f2py_success) { - /* Processing variable dyn */ - ; - capi_dyn_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 1st argument `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 2nd argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 3rd argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable sxq */ - sxq_Dims[0]=3,sxq_Dims[1]=48; - capi_sxq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 10th argument `sxq`"; - capi_sxq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sxq_Dims,sxq_Rank, capi_sxq_intent,sxq_capi,capi_errmess); - if (capi_sxq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sxq = (double *)(PyArray_DATA(capi_sxq_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(dyn, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.q2qstar_out() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(dyn, 0) == 3 * nat,"shape(dyn, 0) == 3 * nat","1st keyword nat","q2qstar_out:nat=%d",nat) { - /* Processing variable irt */ - irt_Dims[0]=48,irt_Dims[1]=nat; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 7th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - - /* Processing variable rtau */ - rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; - capi_rtau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the 8th argument `rtau`"; - capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,rtau_capi,capi_errmess); - if (capi_rtau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); - - /* Processing variable dynqstar */ - dynqstar_Dims[0]=nqtot,dynqstar_Dims[1]=3,dynqstar_Dims[2]=3,dynqstar_Dims[3]=nat,dynqstar_Dims[4]=nat; - capi_dynqstar_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.q2qstar_out: failed to create array from the hidden `dynqstar`"; - capi_dynqstar_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dynqstar_Dims,dynqstar_Rank, capi_dynqstar_intent,Py_None,capi_errmess); - if (capi_dynqstar_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dynqstar = (complex_double *)(PyArray_DATA(capi_dynqstar_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(dyn,at,bg,&nat,&nsym,s,invs,irt,rtau,&nq,sxq,isq,&imq,&nqtot,dynqstar); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_dynqstar_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_dynqstar_as_array == NULL) ... else of dynqstar */ - /* End of cleaning variable dynqstar */ - if((PyObject *)capi_rtau_as_array!=rtau_capi) { - Py_XDECREF(capi_rtau_as_array); } - } /* if (capi_rtau_as_array == NULL) ... else of rtau */ - /* End of cleaning variable rtau */ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*CHECKSCALAR(shape(dyn, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_sxq_as_array!=sxq_capi) { - Py_XDECREF(capi_sxq_as_array); } - } /* if (capi_sxq_as_array == NULL) ... else of sxq */ - /* End of cleaning variable sxq */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_dyn_as_array!=dyn_capi) { - Py_XDECREF(capi_dyn_as_array); } - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - } /*if (f2py_success) of nqtot*/ - /* End of cleaning variable nqtot */ - } /*if (f2py_success) of imq*/ - /* End of cleaning variable imq */ - if((PyObject *)capi_isq_as_array!=isq_capi) { - Py_XDECREF(capi_isq_as_array); } - } /* if (capi_isq_as_array == NULL) ... else of isq */ - /* End of cleaning variable isq */ - } /*if (f2py_success) of nq*/ - /* End of cleaning variable nq */ - if((PyObject *)capi_invs_as_array!=invs_capi) { - Py_XDECREF(capi_invs_as_array); } - } /* if (capi_invs_as_array == NULL) ... else of invs */ - /* End of cleaning variable invs */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of q2qstar_out *****************************/ - -/********************************** set_asr **********************************/ -static char doc_f2py_rout_symph_set_asr[] = "\ -set_asr(asr,axis,tau,dyn,zeu,[nat])\n\nWrapper for ``set_asr``.\ -\n\nParameters\n----------\n" -"asr : input string(len=10)\n" -"axis : input int\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"dyn : in/output rank-4 array('D') with bounds (3,3,nat,nat)\n" -"zeu : in/output rank-3 array('d') with bounds (3,3,nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)"; -/* extern void F_FUNC_US(set_asr,SET_ASR)(string,int*,int*,double*,complex_double*,double*,size_t); */ -static PyObject *f2py_rout_symph_set_asr(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(string,int*,int*,double*,complex_double*,double*,size_t)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - string asr = NULL; - int slen(asr); - PyObject *asr_capi = Py_None; - int axis = 0; - PyObject *axis_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - complex_double *dyn = NULL; - npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; - const int dyn_Rank = 4; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - PyObject *dyn_capi = Py_None; - double *zeu = NULL; - npy_intp zeu_Dims[3] = {-1, -1, -1}; - const int zeu_Rank = 3; - PyArrayObject *capi_zeu_as_array = NULL; - int capi_zeu_intent = 0; - PyObject *zeu_capi = Py_None; - static char *capi_kwlist[] = {"asr","axis","tau","dyn","zeu","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.set_asr",\ - capi_kwlist,&asr_capi,&axis_capi,&tau_capi,&dyn_capi,&zeu_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable asr */ - slen(asr) = 10; - f2py_success = string_from_pyobj(&asr,&slen(asr),"",asr_capi,"string_from_pyobj failed in converting 1st argument`asr' of symph.set_asr to C string"); - if (f2py_success) { - STRINGPADN(asr, slen(asr), '\0', ' '); - /* Processing variable axis */ - f2py_success = int_from_pyobj(&axis,axis_capi,"symph.set_asr() 2nd argument (axis) can't be converted to int"); - if (f2py_success) { - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_asr: failed to create array from the 3rd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.set_asr() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","set_asr:nat=%d",nat) { - /* Processing variable zeu */ - zeu_Dims[0]=3,zeu_Dims[1]=3,zeu_Dims[2]=nat; - capi_zeu_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.set_asr: failed to create array from the 5th argument `zeu`"; - capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); - if (capi_zeu_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); - - /* Processing variable dyn */ - dyn_Dims[0]=3,dyn_Dims[1]=3,dyn_Dims[2]=nat,dyn_Dims[3]=nat; - capi_dyn_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.set_asr: failed to create array from the 4th argument `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(asr,&axis,&nat,tau,dyn,zeu,slen(asr)); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_dyn_as_array!=dyn_capi) { - Py_XDECREF(capi_dyn_as_array); } - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - if((PyObject *)capi_zeu_as_array!=zeu_capi) { - Py_XDECREF(capi_zeu_as_array); } - } /* if (capi_zeu_as_array == NULL) ... else of zeu */ - /* End of cleaning variable zeu */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*if (f2py_success) of axis*/ - /* End of cleaning variable axis */ - STRINGFREE(asr); - } /*if (f2py_success) of asr*/ - /* End of cleaning variable asr */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of set_asr *******************************/ - -/*********************************** sp_zeu ***********************************/ -static char doc_f2py_rout_symph_sp_zeu[] = "\ -sp_zeu(zeu_u,zeu_v,scal,[nat])\n\nWrapper for ``sp_zeu``.\ -\n\nParameters\n----------\n" -"zeu_u : input rank-3 array('d') with bounds (3,3,nat)\n" -"zeu_v : input rank-3 array('d') with bounds (3,3,nat)\n" -"scal : input float\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(zeu_u, 2)"; -/* extern void F_FUNC_US(sp_zeu,SP_ZEU)(double*,double*,int*,double*); */ -static PyObject *f2py_rout_symph_sp_zeu(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *zeu_u = NULL; - npy_intp zeu_u_Dims[3] = {-1, -1, -1}; - const int zeu_u_Rank = 3; - PyArrayObject *capi_zeu_u_as_array = NULL; - int capi_zeu_u_intent = 0; - PyObject *zeu_u_capi = Py_None; - double *zeu_v = NULL; - npy_intp zeu_v_Dims[3] = {-1, -1, -1}; - const int zeu_v_Rank = 3; - PyArrayObject *capi_zeu_v_as_array = NULL; - int capi_zeu_v_intent = 0; - PyObject *zeu_v_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double scal = 0; - PyObject *scal_capi = Py_None; - static char *capi_kwlist[] = {"zeu_u","zeu_v","scal","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:symph.sp_zeu",\ - capi_kwlist,&zeu_u_capi,&zeu_v_capi,&scal_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable zeu_u */ - zeu_u_Dims[0]=3,zeu_u_Dims[1]=3; - capi_zeu_u_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp_zeu: failed to create array from the 1st argument `zeu_u`"; - capi_zeu_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_u_Dims,zeu_u_Rank, capi_zeu_u_intent,zeu_u_capi,capi_errmess); - if (capi_zeu_u_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - zeu_u = (double *)(PyArray_DATA(capi_zeu_u_as_array)); - - /* Processing variable scal */ - f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp_zeu() 3rd argument (scal) can't be converted to double"); - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(zeu_u, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp_zeu() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(zeu_u, 2) == nat,"shape(zeu_u, 2) == nat","1st keyword nat","sp_zeu:nat=%d",nat) { - /* Processing variable zeu_v */ - zeu_v_Dims[0]=3,zeu_v_Dims[1]=3,zeu_v_Dims[2]=nat; - capi_zeu_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp_zeu: failed to create array from the 2nd argument `zeu_v`"; - capi_zeu_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_v_Dims,zeu_v_Rank, capi_zeu_v_intent,zeu_v_capi,capi_errmess); - if (capi_zeu_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - zeu_v = (double *)(PyArray_DATA(capi_zeu_v_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(zeu_u,zeu_v,&nat,&scal); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_zeu_v_as_array!=zeu_v_capi) { - Py_XDECREF(capi_zeu_v_as_array); } - } /* if (capi_zeu_v_as_array == NULL) ... else of zeu_v */ - /* End of cleaning variable zeu_v */ - } /*CHECKSCALAR(shape(zeu_u, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of scal*/ - /* End of cleaning variable scal */ - if((PyObject *)capi_zeu_u_as_array!=zeu_u_capi) { - Py_XDECREF(capi_zeu_u_as_array); } - } /* if (capi_zeu_u_as_array == NULL) ... else of zeu_u */ - /* End of cleaning variable zeu_u */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of sp_zeu *******************************/ - -/************************************ sp1 ************************************/ -static char doc_f2py_rout_symph_sp1[] = "\ -sp1(u,v,scal,[nat])\n\nWrapper for ``sp1``.\ -\n\nParameters\n----------\n" -"u : input rank-4 array('d') with bounds (3,3,nat,nat)\n" -"v : input rank-4 array('d') with bounds (3,3,nat,nat)\n" -"scal : input float\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(u, 2)"; -/* extern void F_FUNC(sp1,SP1)(double*,double*,int*,double*); */ -static PyObject *f2py_rout_symph_sp1(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *u = NULL; - npy_intp u_Dims[4] = {-1, -1, -1, -1}; - const int u_Rank = 4; - PyArrayObject *capi_u_as_array = NULL; - int capi_u_intent = 0; - PyObject *u_capi = Py_None; - double *v = NULL; - npy_intp v_Dims[4] = {-1, -1, -1, -1}; - const int v_Rank = 4; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double scal = 0; - PyObject *scal_capi = Py_None; - static char *capi_kwlist[] = {"u","v","scal","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:symph.sp1",\ - capi_kwlist,&u_capi,&v_capi,&scal_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u */ - u_Dims[0]=3,u_Dims[1]=3; - capi_u_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp1: failed to create array from the 1st argument `u`"; - capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); - if (capi_u_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u = (double *)(PyArray_DATA(capi_u_as_array)); - - /* Processing variable scal */ - f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp1() 3rd argument (scal) can't be converted to double"); - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(u, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp1() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(u, 2) == nat,"shape(u, 2) == nat","1st keyword nat","sp1:nat=%d",nat) { - /* Processing variable v */ - v_Dims[0]=3,v_Dims[1]=3,v_Dims[2]=nat,v_Dims[3]=nat; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp1: failed to create array from the 2nd argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (double *)(PyArray_DATA(capi_v_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(u,v,&nat,&scal); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ - } /*CHECKSCALAR(shape(u, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of scal*/ - /* End of cleaning variable scal */ - if((PyObject *)capi_u_as_array!=u_capi) { - Py_XDECREF(capi_u_as_array); } - } /* if (capi_u_as_array == NULL) ... else of u */ - /* End of cleaning variable u */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of sp1 *********************************/ - -/************************************ sp2 ************************************/ -static char doc_f2py_rout_symph_sp2[] = "\ -sp2(u,v,ind_v,scal,[nat])\n\nWrapper for ``sp2``.\ -\n\nParameters\n----------\n" -"u : input rank-4 array('d') with bounds (3,3,nat,nat)\n" -"v : input rank-1 array('d') with bounds (2)\n" -"ind_v : input rank-2 array('i') with bounds (2,4)\n" -"scal : input float\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(u, 2)"; -/* extern void F_FUNC(sp2,SP2)(double*,double*,int*,int*,double*); */ -static PyObject *f2py_rout_symph_sp2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *u = NULL; - npy_intp u_Dims[4] = {-1, -1, -1, -1}; - const int u_Rank = 4; - PyArrayObject *capi_u_as_array = NULL; - int capi_u_intent = 0; - PyObject *u_capi = Py_None; - double *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int *ind_v = NULL; - npy_intp ind_v_Dims[2] = {-1, -1}; - const int ind_v_Rank = 2; - PyArrayObject *capi_ind_v_as_array = NULL; - int capi_ind_v_intent = 0; - PyObject *ind_v_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double scal = 0; - PyObject *scal_capi = Py_None; - static char *capi_kwlist[] = {"u","v","ind_v","scal","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|O:symph.sp2",\ - capi_kwlist,&u_capi,&v_capi,&ind_v_capi,&scal_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u */ - u_Dims[0]=3,u_Dims[1]=3; - capi_u_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp2: failed to create array from the 1st argument `u`"; - capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); - if (capi_u_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u = (double *)(PyArray_DATA(capi_u_as_array)); - - /* Processing variable ind_v */ - ind_v_Dims[0]=2,ind_v_Dims[1]=4; - capi_ind_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp2: failed to create array from the 3rd argument `ind_v`"; - capi_ind_v_as_array = ndarray_from_pyobj( NPY_INT,1,ind_v_Dims,ind_v_Rank, capi_ind_v_intent,ind_v_capi,capi_errmess); - if (capi_ind_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ind_v = (int *)(PyArray_DATA(capi_ind_v_as_array)); - - /* Processing variable v */ - v_Dims[0]=2; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp2: failed to create array from the 2nd argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (double *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable scal */ - f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp2() 4th argument (scal) can't be converted to double"); - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(u, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp2() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(u, 2) == nat,"shape(u, 2) == nat","1st keyword nat","sp2:nat=%d",nat) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(u,v,ind_v,&nat,&scal); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(u, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of scal*/ - /* End of cleaning variable scal */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ - if((PyObject *)capi_ind_v_as_array!=ind_v_capi) { - Py_XDECREF(capi_ind_v_as_array); } - } /* if (capi_ind_v_as_array == NULL) ... else of ind_v */ - /* End of cleaning variable ind_v */ - if((PyObject *)capi_u_as_array!=u_capi) { - Py_XDECREF(capi_u_as_array); } - } /* if (capi_u_as_array == NULL) ... else of u */ - /* End of cleaning variable u */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of sp2 *********************************/ - -/************************************ sp3 ************************************/ -static char doc_f2py_rout_symph_sp3[] = "\ -sp3(u,v,i,na,scal,[nat])\n\nWrapper for ``sp3``.\ -\n\nParameters\n----------\n" -"u : input rank-4 array('d') with bounds (3,3,nat,nat)\n" -"v : input rank-4 array('d') with bounds (3,3,nat,nat)\n" -"i : input int\n" -"na : input int\n" -"scal : input float\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(u, 2)"; -/* extern void F_FUNC(sp3,SP3)(double*,double*,int*,int*,int*,double*); */ -static PyObject *f2py_rout_symph_sp3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *u = NULL; - npy_intp u_Dims[4] = {-1, -1, -1, -1}; - const int u_Rank = 4; - PyArrayObject *capi_u_as_array = NULL; - int capi_u_intent = 0; - PyObject *u_capi = Py_None; - double *v = NULL; - npy_intp v_Dims[4] = {-1, -1, -1, -1}; - const int v_Rank = 4; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int i = 0; - PyObject *i_capi = Py_None; - int na = 0; - PyObject *na_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double scal = 0; - PyObject *scal_capi = Py_None; - static char *capi_kwlist[] = {"u","v","i","na","scal","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.sp3",\ - capi_kwlist,&u_capi,&v_capi,&i_capi,&na_capi,&scal_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable i */ - f2py_success = int_from_pyobj(&i,i_capi,"symph.sp3() 3rd argument (i) can't be converted to int"); - if (f2py_success) { - /* Processing variable na */ - f2py_success = int_from_pyobj(&na,na_capi,"symph.sp3() 4th argument (na) can't be converted to int"); - if (f2py_success) { - /* Processing variable u */ - u_Dims[0]=3,u_Dims[1]=3; - capi_u_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp3: failed to create array from the 1st argument `u`"; - capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); - if (capi_u_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u = (double *)(PyArray_DATA(capi_u_as_array)); - - /* Processing variable scal */ - f2py_success = double_from_pyobj(&scal,scal_capi,"symph.sp3() 5th argument (scal) can't be converted to double"); - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(u, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sp3() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(u, 2) == nat,"shape(u, 2) == nat","1st keyword nat","sp3:nat=%d",nat) { - /* Processing variable v */ - v_Dims[0]=3,v_Dims[1]=3,v_Dims[2]=nat,v_Dims[3]=nat; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sp3: failed to create array from the 2nd argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (double *)(PyArray_DATA(capi_v_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(u,v,&i,&na,&nat,&scal); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ - } /*CHECKSCALAR(shape(u, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of scal*/ - /* End of cleaning variable scal */ - if((PyObject *)capi_u_as_array!=u_capi) { - Py_XDECREF(capi_u_as_array); } - } /* if (capi_u_as_array == NULL) ... else of u */ - /* End of cleaning variable u */ - } /*if (f2py_success) of na*/ - /* End of cleaning variable na */ - } /*if (f2py_success) of i*/ - /* End of cleaning variable i */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of sp3 *********************************/ - -/****************************** symdynph_gq_new ******************************/ -static char doc_f2py_rout_symph_symdynph_gq_new[] = "\ -symdynph_gq_new(xq,phi,s,invs,rtau,irt,irotmq,minus_q,nsymq,[nat])\n\nWrapper for ``symdynph_gq_new``.\ -\n\nParameters\n----------\n" -"xq : input rank-1 array('d') with bounds (3)\n" -"phi : in/output rank-4 array('D') with bounds (3,3,nat,nat)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"invs : input rank-1 array('i') with bounds (48)\n" -"rtau : input rank-3 array('d') with bounds (3,48,nat)\n" -"irt : input rank-2 array('i') with bounds (48,nat)\n" -"irotmq : input int\n" -"minus_q : input int\n" -"nsymq : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(phi, 2)"; -/* extern void F_FUNC_US(symdynph_gq_new,SYMDYNPH_GQ_NEW)(double*,complex_double*,int*,int*,double*,int*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_symdynph_gq_new(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,complex_double*,int*,int*,double*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *xq = NULL; - npy_intp xq_Dims[1] = {-1}; - const int xq_Rank = 1; - PyArrayObject *capi_xq_as_array = NULL; - int capi_xq_intent = 0; - PyObject *xq_capi = Py_None; - complex_double *phi = NULL; - npy_intp phi_Dims[4] = {-1, -1, -1, -1}; - const int phi_Rank = 4; - PyArrayObject *capi_phi_as_array = NULL; - int capi_phi_intent = 0; - PyObject *phi_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *invs = NULL; - npy_intp invs_Dims[1] = {-1}; - const int invs_Rank = 1; - PyArrayObject *capi_invs_as_array = NULL; - int capi_invs_intent = 0; - PyObject *invs_capi = Py_None; - double *rtau = NULL; - npy_intp rtau_Dims[3] = {-1, -1, -1}; - const int rtau_Rank = 3; - PyArrayObject *capi_rtau_as_array = NULL; - int capi_rtau_intent = 0; - PyObject *rtau_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - int irotmq = 0; - PyObject *irotmq_capi = Py_None; - int minus_q = 0; - PyObject *minus_q_capi = Py_None; - int nsymq = 0; - PyObject *nsymq_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"xq","phi","s","invs","rtau","irt","irotmq","minus_q","nsymq","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOO|O:symph.symdynph_gq_new",\ - capi_kwlist,&xq_capi,&phi_capi,&s_capi,&invs_capi,&rtau_capi,&irt_capi,&irotmq_capi,&minus_q_capi,&nsymq_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nsymq */ - f2py_success = int_from_pyobj(&nsymq,nsymq_capi,"symph.symdynph_gq_new() 9th argument (nsymq) can't be converted to int"); - if (f2py_success) { - /* Processing variable irotmq */ - f2py_success = int_from_pyobj(&irotmq,irotmq_capi,"symph.symdynph_gq_new() 7th argument (irotmq) can't be converted to int"); - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 3rd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable invs */ - invs_Dims[0]=48; - capi_invs_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 4th argument `invs`"; - capi_invs_as_array = ndarray_from_pyobj( NPY_INT,1,invs_Dims,invs_Rank, capi_invs_intent,invs_capi,capi_errmess); - if (capi_invs_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - invs = (int *)(PyArray_DATA(capi_invs_as_array)); - - /* Processing variable xq */ - xq_Dims[0]=3; - capi_xq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 1st argument `xq`"; - capi_xq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xq_Dims,xq_Rank, capi_xq_intent,xq_capi,capi_errmess); - if (capi_xq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xq = (double *)(PyArray_DATA(capi_xq_as_array)); - - /* Processing variable minus_q */ - minus_q = (int)PyObject_IsTrue(minus_q_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable phi */ - phi_Dims[0]=3,phi_Dims[1]=3; - capi_phi_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 2nd argument `phi`"; - capi_phi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi_Dims,phi_Rank, capi_phi_intent,phi_capi,capi_errmess); - if (capi_phi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phi = (complex_double *)(PyArray_DATA(capi_phi_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(phi, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symdynph_gq_new() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(phi, 2) == nat,"shape(phi, 2) == nat","1st keyword nat","symdynph_gq_new:nat=%d",nat) { - /* Processing variable irt */ - irt_Dims[0]=48,irt_Dims[1]=nat; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 6th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - - /* Processing variable rtau */ - rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; - capi_rtau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symdynph_gq_new: failed to create array from the 5th argument `rtau`"; - capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,rtau_capi,capi_errmess); - if (capi_rtau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(xq,phi,s,invs,rtau,irt,&irotmq,&minus_q,&nsymq,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_rtau_as_array!=rtau_capi) { - Py_XDECREF(capi_rtau_as_array); } - } /* if (capi_rtau_as_array == NULL) ... else of rtau */ - /* End of cleaning variable rtau */ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*CHECKSCALAR(shape(phi, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_phi_as_array!=phi_capi) { - Py_XDECREF(capi_phi_as_array); } - } /* if (capi_phi_as_array == NULL) ... else of phi */ - /* End of cleaning variable phi */ - } /*if (f2py_success) of minus_q*/ - /* End of cleaning variable minus_q */ - if((PyObject *)capi_xq_as_array!=xq_capi) { - Py_XDECREF(capi_xq_as_array); } - } /* if (capi_xq_as_array == NULL) ... else of xq */ - /* End of cleaning variable xq */ - if((PyObject *)capi_invs_as_array!=invs_capi) { - Py_XDECREF(capi_invs_as_array); } - } /* if (capi_invs_as_array == NULL) ... else of invs */ - /* End of cleaning variable invs */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of irotmq*/ - /* End of cleaning variable irotmq */ - } /*if (f2py_success) of nsymq*/ - /* End of cleaning variable nsymq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of symdynph_gq_new ***************************/ - -/********************************** trntnsc **********************************/ -static char doc_f2py_rout_symph_trntnsc[] = "\ -trntnsc(phi,at,bg,iflg)\n\nWrapper for ``trntnsc``.\ -\n\nParameters\n----------\n" -"phi : input rank-2 array('D') with bounds (3,3)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"iflg : input int"; -/* extern void F_FUNC(trntnsc,TRNTNSC)(complex_double*,double*,double*,int*); */ -static PyObject *f2py_rout_symph_trntnsc(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *phi = NULL; - npy_intp phi_Dims[2] = {-1, -1}; - const int phi_Rank = 2; - PyArrayObject *capi_phi_as_array = NULL; - int capi_phi_intent = 0; - PyObject *phi_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - int iflg = 0; - PyObject *iflg_capi = Py_None; - static char *capi_kwlist[] = {"phi","at","bg","iflg",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:symph.trntnsc",\ - capi_kwlist,&phi_capi,&at_capi,&bg_capi,&iflg_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable iflg */ - f2py_success = int_from_pyobj(&iflg,iflg_capi,"symph.trntnsc() 4th argument (iflg) can't be converted to int"); - if (f2py_success) { - /* Processing variable phi */ - phi_Dims[0]=3,phi_Dims[1]=3; - capi_phi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trntnsc: failed to create array from the 1st argument `phi`"; - capi_phi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phi_Dims,phi_Rank, capi_phi_intent,phi_capi,capi_errmess); - if (capi_phi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phi = (complex_double *)(PyArray_DATA(capi_phi_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trntnsc: failed to create array from the 2nd argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trntnsc: failed to create array from the 3rd argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(phi,at,bg,&iflg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_phi_as_array!=phi_capi) { - Py_XDECREF(capi_phi_as_array); } - } /* if (capi_phi_as_array == NULL) ... else of phi */ - /* End of cleaning variable phi */ - } /*if (f2py_success) of iflg*/ - /* End of cleaning variable iflg */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of trntnsc *******************************/ - -/********************************** rgd_blk **********************************/ -static char doc_f2py_rout_symph_rgd_blk[] = "\ -rgd_blk(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,[nat])\n\nWrapper for ``rgd_blk``.\ -\n\nParameters\n----------\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"dyn : input rank-4 array('D') with bounds (3,3,nat,nat)\n" -"q : input rank-1 array('d') with bounds (3)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"epsil : input rank-2 array('d') with bounds (3,3)\n" -"zeu : input rank-3 array('d') with bounds (3,3,nat)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"omega : input float\n" -"alat : input float\n" -"loto_2d : input int\n" -"sign : input float\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(dyn, 2)"; -/* extern void F_FUNC_US(rgd_blk,RGD_BLK)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); */ -static PyObject *f2py_rout_symph_rgd_blk(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - complex_double *dyn = NULL; - npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; - const int dyn_Rank = 4; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - PyObject *dyn_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[1] = {-1}; - const int q_Rank = 1; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *epsil = NULL; - npy_intp epsil_Dims[2] = {-1, -1}; - const int epsil_Rank = 2; - PyArrayObject *capi_epsil_as_array = NULL; - int capi_epsil_intent = 0; - PyObject *epsil_capi = Py_None; - double *zeu = NULL; - npy_intp zeu_Dims[3] = {-1, -1, -1}; - const int zeu_Rank = 3; - PyArrayObject *capi_zeu_as_array = NULL; - int capi_zeu_intent = 0; - PyObject *zeu_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - double omega = 0; - PyObject *omega_capi = Py_None; - double alat = 0; - PyObject *alat_capi = Py_None; - int loto_2d = 0; - PyObject *loto_2d_capi = Py_None; - double sign = 0; - PyObject *sign_capi = Py_None; - static char *capi_kwlist[] = {"nr1","nr2","nr3","dyn","q","tau","epsil","zeu","bg","omega","alat","loto_2d","sign","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOO|O:symph.rgd_blk",\ - capi_kwlist,&nr1_capi,&nr2_capi,&nr3_capi,&dyn_capi,&q_capi,&tau_capi,&epsil_capi,&zeu_capi,&bg_capi,&omega_capi,&alat_capi,&loto_2d_capi,&sign_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.rgd_blk() 1st argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.rgd_blk() 2nd argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.rgd_blk() 3rd argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable dyn */ - dyn_Dims[0]=3,dyn_Dims[1]=3; - capi_dyn_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 4th argument `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 5th argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable epsil */ - epsil_Dims[0]=3,epsil_Dims[1]=3; - capi_epsil_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 7th argument `epsil`"; - capi_epsil_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,epsil_Dims,epsil_Rank, capi_epsil_intent,epsil_capi,capi_errmess); - if (capi_epsil_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - epsil = (double *)(PyArray_DATA(capi_epsil_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 9th argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable omega */ - f2py_success = double_from_pyobj(&omega,omega_capi,"symph.rgd_blk() 10th argument (omega) can't be converted to double"); - if (f2py_success) { - /* Processing variable alat */ - f2py_success = double_from_pyobj(&alat,alat_capi,"symph.rgd_blk() 11st argument (alat) can't be converted to double"); - if (f2py_success) { - /* Processing variable sign */ - f2py_success = double_from_pyobj(&sign,sign_capi,"symph.rgd_blk() 13rd argument (sign) can't be converted to double"); - if (f2py_success) { - /* Processing variable loto_2d */ - loto_2d = (int)PyObject_IsTrue(loto_2d_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(dyn, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.rgd_blk() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(dyn, 2) == nat,"shape(dyn, 2) == nat","1st keyword nat","rgd_blk:nat=%d",nat) { - /* Processing variable tau */ - tau_Dims[0]=3,tau_Dims[1]=nat; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 6th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable zeu */ - zeu_Dims[0]=3,zeu_Dims[1]=3,zeu_Dims[2]=nat; - capi_zeu_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk: failed to create array from the 8th argument `zeu`"; - capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); - if (capi_zeu_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nr1,&nr2,&nr3,&nat,dyn,q,tau,epsil,zeu,bg,&omega,&alat,&loto_2d,&sign); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_zeu_as_array!=zeu_capi) { - Py_XDECREF(capi_zeu_as_array); } - } /* if (capi_zeu_as_array == NULL) ... else of zeu */ - /* End of cleaning variable zeu */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*CHECKSCALAR(shape(dyn, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of loto_2d*/ - /* End of cleaning variable loto_2d */ - } /*if (f2py_success) of sign*/ - /* End of cleaning variable sign */ - } /*if (f2py_success) of alat*/ - /* End of cleaning variable alat */ - } /*if (f2py_success) of omega*/ - /* End of cleaning variable omega */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_epsil_as_array!=epsil_capi) { - Py_XDECREF(capi_epsil_as_array); } - } /* if (capi_epsil_as_array == NULL) ... else of epsil */ - /* End of cleaning variable epsil */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ - if((PyObject *)capi_dyn_as_array!=dyn_capi) { - Py_XDECREF(capi_dyn_as_array); } - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of rgd_blk *******************************/ - -/************************** rgd_blk_diff_phase_conv **************************/ -static char doc_f2py_rout_symph_rgd_blk_diff_phase_conv[] = "\ -rgd_blk_diff_phase_conv(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,[nat])\n\nWrapper for ``rgd_blk_diff_phase_conv``.\ -\n\nParameters\n----------\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"dyn : input rank-4 array('D') with bounds (3,3,nat,nat)\n" -"q : input rank-1 array('d') with bounds (3)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"epsil : input rank-2 array('d') with bounds (3,3)\n" -"zeu : input rank-3 array('d') with bounds (3,3,nat)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"omega : input float\n" -"alat : input float\n" -"loto_2d : input int\n" -"sign : input float\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(dyn, 2)"; -/* extern void F_FUNC_US(rgd_blk_diff_phase_conv,RGD_BLK_DIFF_PHASE_CONV)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*); */ -static PyObject *f2py_rout_symph_rgd_blk_diff_phase_conv(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,complex_double*,double*,double*,double*,double*,double*,double*,double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - complex_double *dyn = NULL; - npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; - const int dyn_Rank = 4; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - PyObject *dyn_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[1] = {-1}; - const int q_Rank = 1; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *epsil = NULL; - npy_intp epsil_Dims[2] = {-1, -1}; - const int epsil_Rank = 2; - PyArrayObject *capi_epsil_as_array = NULL; - int capi_epsil_intent = 0; - PyObject *epsil_capi = Py_None; - double *zeu = NULL; - npy_intp zeu_Dims[3] = {-1, -1, -1}; - const int zeu_Rank = 3; - PyArrayObject *capi_zeu_as_array = NULL; - int capi_zeu_intent = 0; - PyObject *zeu_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - double omega = 0; - PyObject *omega_capi = Py_None; - double alat = 0; - PyObject *alat_capi = Py_None; - int loto_2d = 0; - PyObject *loto_2d_capi = Py_None; - double sign = 0; - PyObject *sign_capi = Py_None; - static char *capi_kwlist[] = {"nr1","nr2","nr3","dyn","q","tau","epsil","zeu","bg","omega","alat","loto_2d","sign","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOO|O:symph.rgd_blk_diff_phase_conv",\ - capi_kwlist,&nr1_capi,&nr2_capi,&nr3_capi,&dyn_capi,&q_capi,&tau_capi,&epsil_capi,&zeu_capi,&bg_capi,&omega_capi,&alat_capi,&loto_2d_capi,&sign_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.rgd_blk_diff_phase_conv() 1st argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.rgd_blk_diff_phase_conv() 2nd argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.rgd_blk_diff_phase_conv() 3rd argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable dyn */ - dyn_Dims[0]=3,dyn_Dims[1]=3; - capi_dyn_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 4th argument `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 5th argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable epsil */ - epsil_Dims[0]=3,epsil_Dims[1]=3; - capi_epsil_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 7th argument `epsil`"; - capi_epsil_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,epsil_Dims,epsil_Rank, capi_epsil_intent,epsil_capi,capi_errmess); - if (capi_epsil_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - epsil = (double *)(PyArray_DATA(capi_epsil_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 9th argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable omega */ - f2py_success = double_from_pyobj(&omega,omega_capi,"symph.rgd_blk_diff_phase_conv() 10th argument (omega) can't be converted to double"); - if (f2py_success) { - /* Processing variable alat */ - f2py_success = double_from_pyobj(&alat,alat_capi,"symph.rgd_blk_diff_phase_conv() 11st argument (alat) can't be converted to double"); - if (f2py_success) { - /* Processing variable sign */ - f2py_success = double_from_pyobj(&sign,sign_capi,"symph.rgd_blk_diff_phase_conv() 13rd argument (sign) can't be converted to double"); - if (f2py_success) { - /* Processing variable loto_2d */ - loto_2d = (int)PyObject_IsTrue(loto_2d_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(dyn, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.rgd_blk_diff_phase_conv() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(dyn, 2) == nat,"shape(dyn, 2) == nat","1st keyword nat","rgd_blk_diff_phase_conv:nat=%d",nat) { - /* Processing variable tau */ - tau_Dims[0]=3,tau_Dims[1]=nat; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 6th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable zeu */ - zeu_Dims[0]=3,zeu_Dims[1]=3,zeu_Dims[2]=nat; - capi_zeu_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.rgd_blk_diff_phase_conv: failed to create array from the 8th argument `zeu`"; - capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); - if (capi_zeu_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nr1,&nr2,&nr3,&nat,dyn,q,tau,epsil,zeu,bg,&omega,&alat,&loto_2d,&sign); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_zeu_as_array!=zeu_capi) { - Py_XDECREF(capi_zeu_as_array); } - } /* if (capi_zeu_as_array == NULL) ... else of zeu */ - /* End of cleaning variable zeu */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*CHECKSCALAR(shape(dyn, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of loto_2d*/ - /* End of cleaning variable loto_2d */ - } /*if (f2py_success) of sign*/ - /* End of cleaning variable sign */ - } /*if (f2py_success) of alat*/ - /* End of cleaning variable alat */ - } /*if (f2py_success) of omega*/ - /* End of cleaning variable omega */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_epsil_as_array!=epsil_capi) { - Py_XDECREF(capi_epsil_as_array); } - } /* if (capi_epsil_as_array == NULL) ... else of epsil */ - /* End of cleaning variable epsil */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ - if((PyObject *)capi_dyn_as_array!=dyn_capi) { - Py_XDECREF(capi_dyn_as_array); } - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of rgd_blk_diff_phase_conv ***********************/ - -/********************************** nonanal **********************************/ -static char doc_f2py_rout_symph_nonanal[] = "\ -nonanal(itau_blk,epsil,q,zeu,omega,dyn,[nat,nat_blk])\n\nWrapper for ``nonanal``.\ -\n\nParameters\n----------\n" -"itau_blk : input rank-1 array('i') with bounds (nat)\n" -"epsil : input rank-2 array('d') with bounds (3,3)\n" -"q : input rank-1 array('d') with bounds (3)\n" -"zeu : input rank-3 array('d') with bounds (3,3,nat_blk)\n" -"omega : input float\n" -"dyn : in/output rank-4 array('D') with bounds (3,3,nat,nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(itau_blk, 0)\n" -"nat_blk : input int, optional\n Default: shape(zeu, 2)"; -/* extern void F_FUNC(nonanal,NONANAL)(int*,int*,int*,double*,double*,double*,double*,complex_double*); */ -static PyObject *f2py_rout_symph_nonanal(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,double*,double*,double*,double*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - int nat_blk = 0; - PyObject *nat_blk_capi = Py_None; - int *itau_blk = NULL; - npy_intp itau_blk_Dims[1] = {-1}; - const int itau_blk_Rank = 1; - PyArrayObject *capi_itau_blk_as_array = NULL; - int capi_itau_blk_intent = 0; - PyObject *itau_blk_capi = Py_None; - double *epsil = NULL; - npy_intp epsil_Dims[2] = {-1, -1}; - const int epsil_Rank = 2; - PyArrayObject *capi_epsil_as_array = NULL; - int capi_epsil_intent = 0; - PyObject *epsil_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[1] = {-1}; - const int q_Rank = 1; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *zeu = NULL; - npy_intp zeu_Dims[3] = {-1, -1, -1}; - const int zeu_Rank = 3; - PyArrayObject *capi_zeu_as_array = NULL; - int capi_zeu_intent = 0; - PyObject *zeu_capi = Py_None; - double omega = 0; - PyObject *omega_capi = Py_None; - complex_double *dyn = NULL; - npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; - const int dyn_Rank = 4; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - PyObject *dyn_capi = Py_None; - static char *capi_kwlist[] = {"itau_blk","epsil","q","zeu","omega","dyn","nat","nat_blk",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:symph.nonanal",\ - capi_kwlist,&itau_blk_capi,&epsil_capi,&q_capi,&zeu_capi,&omega_capi,&dyn_capi,&nat_capi,&nat_blk_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable itau_blk */ - ; - capi_itau_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 1st argument `itau_blk`"; - capi_itau_blk_as_array = ndarray_from_pyobj( NPY_INT,1,itau_blk_Dims,itau_blk_Rank, capi_itau_blk_intent,itau_blk_capi,capi_errmess); - if (capi_itau_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau_blk = (int *)(PyArray_DATA(capi_itau_blk_as_array)); - - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 3rd argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable epsil */ - epsil_Dims[0]=3,epsil_Dims[1]=3; - capi_epsil_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 2nd argument `epsil`"; - capi_epsil_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,epsil_Dims,epsil_Rank, capi_epsil_intent,epsil_capi,capi_errmess); - if (capi_epsil_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - epsil = (double *)(PyArray_DATA(capi_epsil_as_array)); - - /* Processing variable zeu */ - zeu_Dims[0]=3,zeu_Dims[1]=3; - capi_zeu_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 4th argument `zeu`"; - capi_zeu_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,zeu_Dims,zeu_Rank, capi_zeu_intent,zeu_capi,capi_errmess); - if (capi_zeu_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - zeu = (double *)(PyArray_DATA(capi_zeu_as_array)); - - /* Processing variable omega */ - f2py_success = double_from_pyobj(&omega,omega_capi,"symph.nonanal() 5th argument (omega) can't be converted to double"); - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(itau_blk, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.nonanal() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(itau_blk, 0) == nat,"shape(itau_blk, 0) == nat","1st keyword nat","nonanal:nat=%d",nat) { - /* Processing variable nat_blk */ - if (nat_blk_capi == Py_None) nat_blk = shape(zeu, 2); else - f2py_success = int_from_pyobj(&nat_blk,nat_blk_capi,"symph.nonanal() 2nd keyword (nat_blk) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(zeu, 2) == nat_blk,"shape(zeu, 2) == nat_blk","2nd keyword nat_blk","nonanal:nat_blk=%d",nat_blk) { - /* Processing variable dyn */ - dyn_Dims[0]=3,dyn_Dims[1]=3,dyn_Dims[2]=nat,dyn_Dims[3]=nat; - capi_dyn_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.nonanal: failed to create array from the 6th argument `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,dyn_capi,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,&nat_blk,itau_blk,epsil,q,zeu,&omega,dyn); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_dyn_as_array!=dyn_capi) { - Py_XDECREF(capi_dyn_as_array); } - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - } /*CHECKSCALAR(shape(zeu, 2) == nat_blk)*/ - } /*if (f2py_success) of nat_blk*/ - /* End of cleaning variable nat_blk */ - } /*CHECKSCALAR(shape(itau_blk, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of omega*/ - /* End of cleaning variable omega */ - if((PyObject *)capi_zeu_as_array!=zeu_capi) { - Py_XDECREF(capi_zeu_as_array); } - } /* if (capi_zeu_as_array == NULL) ... else of zeu */ - /* End of cleaning variable zeu */ - if((PyObject *)capi_epsil_as_array!=epsil_capi) { - Py_XDECREF(capi_epsil_as_array); } - } /* if (capi_epsil_as_array == NULL) ... else of epsil */ - /* End of cleaning variable epsil */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ - if((PyObject *)capi_itau_blk_as_array!=itau_blk_capi) { - Py_XDECREF(capi_itau_blk_as_array); } - } /* if (capi_itau_blk_as_array == NULL) ... else of itau_blk */ - /* End of cleaning variable itau_blk */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of nonanal *******************************/ - -/*********************************** trasl ***********************************/ -static char doc_f2py_rout_symph_trasl[] = "\ -phid = trasl(phiq,nq,nr1,nr2,nr3,m1,m2,m3,[nat])\n\nWrapper for ``trasl``.\ -\n\nParameters\n----------\n" -"phiq : input rank-5 array('D') with bounds (3,3,nat,nat,48)\n" -"nq : input int\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"m1 : input int\n" -"m2 : input int\n" -"m3 : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(phiq, 2)\n" -"\nReturns\n-------\n" -"phid : rank-7 array('D') with bounds (nr1,nr2,nr3,3,3,nat,nat)"; -/* extern void F_FUNC(trasl,TRASL)(complex_double*,complex_double*,int*,int*,int*,int*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_trasl(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,complex_double*,int*,int*,int*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *phid = NULL; - npy_intp phid_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int phid_Rank = 7; - PyArrayObject *capi_phid_as_array = NULL; - int capi_phid_intent = 0; - complex_double *phiq = NULL; - npy_intp phiq_Dims[5] = {-1, -1, -1, -1, -1}; - const int phiq_Rank = 5; - PyArrayObject *capi_phiq_as_array = NULL; - int capi_phiq_intent = 0; - PyObject *phiq_capi = Py_None; - int nq = 0; - PyObject *nq_capi = Py_None; - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int m1 = 0; - PyObject *m1_capi = Py_None; - int m2 = 0; - PyObject *m2_capi = Py_None; - int m3 = 0; - PyObject *m3_capi = Py_None; - static char *capi_kwlist[] = {"phiq","nq","nr1","nr2","nr3","m1","m2","m3","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|O:symph.trasl",\ - capi_kwlist,&phiq_capi,&nq_capi,&nr1_capi,&nr2_capi,&nr3_capi,&m1_capi,&m2_capi,&m3_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.trasl() 3rd argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.trasl() 4th argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.trasl() 5th argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable m1 */ - f2py_success = int_from_pyobj(&m1,m1_capi,"symph.trasl() 6th argument (m1) can't be converted to int"); - if (f2py_success) { - /* Processing variable m2 */ - f2py_success = int_from_pyobj(&m2,m2_capi,"symph.trasl() 7th argument (m2) can't be converted to int"); - if (f2py_success) { - /* Processing variable m3 */ - f2py_success = int_from_pyobj(&m3,m3_capi,"symph.trasl() 8th argument (m3) can't be converted to int"); - if (f2py_success) { - /* Processing variable nq */ - f2py_success = int_from_pyobj(&nq,nq_capi,"symph.trasl() 2nd argument (nq) can't be converted to int"); - if (f2py_success) { - /* Processing variable phiq */ - phiq_Dims[0]=3,phiq_Dims[1]=3,phiq_Dims[4]=48; - capi_phiq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trasl: failed to create array from the 1st argument `phiq`"; - capi_phiq_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phiq_Dims,phiq_Rank, capi_phiq_intent,phiq_capi,capi_errmess); - if (capi_phiq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phiq = (complex_double *)(PyArray_DATA(capi_phiq_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(phiq, 2); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.trasl() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(phiq, 2) == nat,"shape(phiq, 2) == nat","1st keyword nat","trasl:nat=%d",nat) { - /* Processing variable phid */ - phid_Dims[0]=nr1,phid_Dims[1]=nr2,phid_Dims[2]=nr3,phid_Dims[3]=3,phid_Dims[4]=3,phid_Dims[5]=nat,phid_Dims[6]=nat; - capi_phid_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.trasl: failed to create array from the hidden `phid`"; - capi_phid_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,phid_Dims,phid_Rank, capi_phid_intent,Py_None,capi_errmess); - if (capi_phid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phid = (complex_double *)(PyArray_DATA(capi_phid_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(phid,phiq,&nq,&nr1,&nr2,&nr3,&nat,&m1,&m2,&m3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_phid_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_phid_as_array == NULL) ... else of phid */ - /* End of cleaning variable phid */ - } /*CHECKSCALAR(shape(phiq, 2) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_phiq_as_array!=phiq_capi) { - Py_XDECREF(capi_phiq_as_array); } - } /* if (capi_phiq_as_array == NULL) ... else of phiq */ - /* End of cleaning variable phiq */ - } /*if (f2py_success) of nq*/ - /* End of cleaning variable nq */ - } /*if (f2py_success) of m3*/ - /* End of cleaning variable m3 */ - } /*if (f2py_success) of m2*/ - /* End of cleaning variable m2 */ - } /*if (f2py_success) of m1*/ - /* End of cleaning variable m1 */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of trasl ********************************/ - -/********************************** frc_blk **********************************/ -static char doc_f2py_rout_symph_frc_blk[] = "\ -dyn = frc_blk(q,tau,frc,at,rws,nrws,[nat,nr1,nr2,nr3,nrwsx])\n\nWrapper for ``frc_blk``.\ -\n\nParameters\n----------\n" -"q : input rank-1 array('d') with bounds (3)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"frc : input rank-7 array('d') with bounds (nr1,nr2,nr3,3,3,nat,nat)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"rws : input rank-2 array('d') with bounds (4,nrwsx)\n" -"nrws : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)\n" -"nr1 : input int, optional\n Default: shape(frc, 0)\n" -"nr2 : input int, optional\n Default: shape(frc, 1)\n" -"nr3 : input int, optional\n Default: shape(frc, 2)\n" -"nrwsx : input int, optional\n Default: shape(rws, 1)\n" -"\nReturns\n-------\n" -"dyn : rank-4 array('D') with bounds (3,3,nat,nat)"; -/* extern void F_FUNC_US(frc_blk,FRC_BLK)(complex_double*,double*,double*,int*,int*,int*,int*,double*,double*,double*,int*,int*); */ -static PyObject *f2py_rout_symph_frc_blk(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,double*,int*,int*,int*,int*,double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *dyn = NULL; - npy_intp dyn_Dims[4] = {-1, -1, -1, -1}; - const int dyn_Rank = 4; - PyArrayObject *capi_dyn_as_array = NULL; - int capi_dyn_intent = 0; - double *q = NULL; - npy_intp q_Dims[1] = {-1}; - const int q_Rank = 1; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - double *frc = NULL; - npy_intp frc_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int frc_Rank = 7; - PyArrayObject *capi_frc_as_array = NULL; - int capi_frc_intent = 0; - PyObject *frc_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *rws = NULL; - npy_intp rws_Dims[2] = {-1, -1}; - const int rws_Rank = 2; - PyArrayObject *capi_rws_as_array = NULL; - int capi_rws_intent = 0; - PyObject *rws_capi = Py_None; - int nrws = 0; - PyObject *nrws_capi = Py_None; - int nrwsx = 0; - PyObject *nrwsx_capi = Py_None; - static char *capi_kwlist[] = {"q","tau","frc","at","rws","nrws","nat","nr1","nr2","nr3","nrwsx",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OOOOO:symph.frc_blk",\ - capi_kwlist,&q_capi,&tau_capi,&frc_capi,&at_capi,&rws_capi,&nrws_capi,&nat_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nrwsx_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nrws */ - f2py_success = int_from_pyobj(&nrws,nrws_capi,"symph.frc_blk() 6th argument (nrws) can't be converted to int"); - if (f2py_success) { - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 2nd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 1st argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 4th argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable rws */ - rws_Dims[0]=4; - capi_rws_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 5th argument `rws`"; - capi_rws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rws_Dims,rws_Rank, capi_rws_intent,rws_capi,capi_errmess); - if (capi_rws_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rws = (double *)(PyArray_DATA(capi_rws_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.frc_blk() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","frc_blk:nat=%d",nat) { - /* Processing variable nrwsx */ - if (nrwsx_capi == Py_None) nrwsx = shape(rws, 1); else - f2py_success = int_from_pyobj(&nrwsx,nrwsx_capi,"symph.frc_blk() 5th keyword (nrwsx) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(rws, 1) == nrwsx,"shape(rws, 1) == nrwsx","5th keyword nrwsx","frc_blk:nrwsx=%d",nrwsx) { - /* Processing variable dyn */ - dyn_Dims[0]=3,dyn_Dims[1]=3,dyn_Dims[2]=nat,dyn_Dims[3]=nat; - capi_dyn_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the hidden `dyn`"; - capi_dyn_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,dyn_Dims,dyn_Rank, capi_dyn_intent,Py_None,capi_errmess); - if (capi_dyn_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dyn = (complex_double *)(PyArray_DATA(capi_dyn_as_array)); - - /* Processing variable frc */ - frc_Dims[3]=3,frc_Dims[4]=3,frc_Dims[5]=nat,frc_Dims[6]=nat; - capi_frc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.frc_blk: failed to create array from the 3rd argument `frc`"; - capi_frc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,frc_Dims,frc_Rank, capi_frc_intent,frc_capi,capi_errmess); - if (capi_frc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - frc = (double *)(PyArray_DATA(capi_frc_as_array)); - - /* Processing variable nr1 */ - if (nr1_capi == Py_None) nr1 = shape(frc, 0); else - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.frc_blk() 2nd keyword (nr1) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(frc, 0) == nr1,"shape(frc, 0) == nr1","2nd keyword nr1","frc_blk:nr1=%d",nr1) { - /* Processing variable nr2 */ - if (nr2_capi == Py_None) nr2 = shape(frc, 1); else - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.frc_blk() 3rd keyword (nr2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(frc, 1) == nr2,"shape(frc, 1) == nr2","3rd keyword nr2","frc_blk:nr2=%d",nr2) { - /* Processing variable nr3 */ - if (nr3_capi == Py_None) nr3 = shape(frc, 2); else - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.frc_blk() 4th keyword (nr3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(frc, 2) == nr3,"shape(frc, 2) == nr3","4th keyword nr3","frc_blk:nr3=%d",nr3) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(dyn,q,tau,&nat,&nr1,&nr2,&nr3,frc,at,rws,&nrws,&nrwsx); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_dyn_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(frc, 2) == nr3)*/ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*CHECKSCALAR(shape(frc, 1) == nr2)*/ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*CHECKSCALAR(shape(frc, 0) == nr1)*/ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ - if((PyObject *)capi_frc_as_array!=frc_capi) { - Py_XDECREF(capi_frc_as_array); } - } /* if (capi_frc_as_array == NULL) ... else of frc */ - /* End of cleaning variable frc */ - } /* if (capi_dyn_as_array == NULL) ... else of dyn */ - /* End of cleaning variable dyn */ - } /*CHECKSCALAR(shape(rws, 1) == nrwsx)*/ - } /*if (f2py_success) of nrwsx*/ - /* End of cleaning variable nrwsx */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_rws_as_array!=rws_capi) { - Py_XDECREF(capi_rws_as_array); } - } /* if (capi_rws_as_array == NULL) ... else of rws */ - /* End of cleaning variable rws */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*if (f2py_success) of nrws*/ - /* End of cleaning variable nrws */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of frc_blk *******************************/ - -/*********************************** wsinit ***********************************/ -static char doc_f2py_rout_symph_wsinit[] = "\ -nrws = wsinit(rws,atw,[nrwsx])\n\nWrapper for ``wsinit``.\ -\n\nParameters\n----------\n" -"rws : in/output rank-2 array('d') with bounds (4,nrwsx)\n" -"atw : input rank-2 array('d') with bounds (3,3)\n" -"\nOther Parameters\n----------------\n" -"nrwsx : input int, optional\n Default: shape(rws, 1)\n" -"\nReturns\n-------\n" -"nrws : int"; -/* extern void F_FUNC(wsinit,WSINIT)(double*,int*,int*,double*); */ -static PyObject *f2py_rout_symph_wsinit(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *rws = NULL; - npy_intp rws_Dims[2] = {-1, -1}; - const int rws_Rank = 2; - PyArrayObject *capi_rws_as_array = NULL; - int capi_rws_intent = 0; - PyObject *rws_capi = Py_None; - int nrwsx = 0; - PyObject *nrwsx_capi = Py_None; - int nrws = 0; - double *atw = NULL; - npy_intp atw_Dims[2] = {-1, -1}; - const int atw_Rank = 2; - PyArrayObject *capi_atw_as_array = NULL; - int capi_atw_intent = 0; - PyObject *atw_capi = Py_None; - static char *capi_kwlist[] = {"rws","atw","nrwsx",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:symph.wsinit",\ - capi_kwlist,&rws_capi,&atw_capi,&nrwsx_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable rws */ - rws_Dims[0]=4; - capi_rws_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.wsinit: failed to create array from the 1st argument `rws`"; - capi_rws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rws_Dims,rws_Rank, capi_rws_intent,rws_capi,capi_errmess); - if (capi_rws_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rws = (double *)(PyArray_DATA(capi_rws_as_array)); - - /* Processing variable atw */ - atw_Dims[0]=3,atw_Dims[1]=3; - capi_atw_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.wsinit: failed to create array from the 2nd argument `atw`"; - capi_atw_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,atw_Dims,atw_Rank, capi_atw_intent,atw_capi,capi_errmess); - if (capi_atw_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - atw = (double *)(PyArray_DATA(capi_atw_as_array)); - - /* Processing variable nrws */ - /* Processing variable nrwsx */ - if (nrwsx_capi == Py_None) nrwsx = shape(rws, 1); else - f2py_success = int_from_pyobj(&nrwsx,nrwsx_capi,"symph.wsinit() 1st keyword (nrwsx) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(rws, 1) == nrwsx,"shape(rws, 1) == nrwsx","1st keyword nrwsx","wsinit:nrwsx=%d",nrwsx) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(rws,&nrwsx,&nrws,atw); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",nrws); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(rws, 1) == nrwsx)*/ - } /*if (f2py_success) of nrwsx*/ - /* End of cleaning variable nrwsx */ - /* End of cleaning variable nrws */ - if((PyObject *)capi_atw_as_array!=atw_capi) { - Py_XDECREF(capi_atw_as_array); } - } /* if (capi_atw_as_array == NULL) ... else of atw */ - /* End of cleaning variable atw */ - if((PyObject *)capi_rws_as_array!=rws_capi) { - Py_XDECREF(capi_rws_as_array); } - } /* if (capi_rws_as_array == NULL) ... else of rws */ - /* End of cleaning variable rws */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of wsinit *******************************/ - -/********************************** wsweight **********************************/ -static char doc_f2py_rout_symph_wsweight[] = "\ -wsweight = wsweight(r,rws,nrws,[nrwsx])\n\nWrapper for ``wsweight``.\ -\n\nParameters\n----------\n" -"r : input rank-1 array('d') with bounds (3)\n" -"rws : input rank-2 array('d') with bounds (4,nrwsx)\n" -"nrws : input int\n" -"\nOther Parameters\n----------------\n" -"nrwsx : input int, optional\n Default: shape(rws, 1)\n" -"\nReturns\n-------\n" -"wsweight : float"; -/* extern void F_WRAPPEDFUNC(wsweight,WSWEIGHT)(double*,double*,double*,int*,int*); */ -static PyObject *f2py_rout_symph_wsweight(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double wsweight = 0; - double *r = NULL; - npy_intp r_Dims[1] = {-1}; - const int r_Rank = 1; - PyArrayObject *capi_r_as_array = NULL; - int capi_r_intent = 0; - PyObject *r_capi = Py_None; - double *rws = NULL; - npy_intp rws_Dims[2] = {-1, -1}; - const int rws_Rank = 2; - PyArrayObject *capi_rws_as_array = NULL; - int capi_rws_intent = 0; - PyObject *rws_capi = Py_None; - int nrws = 0; - PyObject *nrws_capi = Py_None; - int nrwsx = 0; - PyObject *nrwsx_capi = Py_None; - static char *capi_kwlist[] = {"r","rws","nrws","nrwsx",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:symph.wsweight",\ - capi_kwlist,&r_capi,&rws_capi,&nrws_capi,&nrwsx_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nrws */ - f2py_success = int_from_pyobj(&nrws,nrws_capi,"symph.wsweight() 3rd argument (nrws) can't be converted to int"); - if (f2py_success) { - /* Processing variable rws */ - rws_Dims[0]=4; - capi_rws_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.wsweight: failed to create array from the 2nd argument `rws`"; - capi_rws_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rws_Dims,rws_Rank, capi_rws_intent,rws_capi,capi_errmess); - if (capi_rws_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rws = (double *)(PyArray_DATA(capi_rws_as_array)); - - /* Processing variable r */ - r_Dims[0]=3; - capi_r_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.wsweight: failed to create array from the 1st argument `r`"; - capi_r_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_Dims,r_Rank, capi_r_intent,r_capi,capi_errmess); - if (capi_r_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r = (double *)(PyArray_DATA(capi_r_as_array)); - - /* Processing variable wsweight */ - /* Processing variable nrwsx */ - if (nrwsx_capi == Py_None) nrwsx = shape(rws, 1); else - f2py_success = int_from_pyobj(&nrwsx,nrwsx_capi,"symph.wsweight() 1st keyword (nrwsx) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(rws, 1) == nrwsx,"shape(rws, 1) == nrwsx","1st keyword nrwsx","wsweight:nrwsx=%d",nrwsx) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&wsweight,r,rws,&nrws,&nrwsx); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",wsweight); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(rws, 1) == nrwsx)*/ - } /*if (f2py_success) of nrwsx*/ - /* End of cleaning variable nrwsx */ - /* End of cleaning variable wsweight */ - if((PyObject *)capi_r_as_array!=r_capi) { - Py_XDECREF(capi_r_as_array); } - } /* if (capi_r_as_array == NULL) ... else of r */ - /* End of cleaning variable r */ - if((PyObject *)capi_rws_as_array!=rws_capi) { - Py_XDECREF(capi_rws_as_array); } - } /* if (capi_rws_as_array == NULL) ... else of rws */ - /* End of cleaning variable rws */ - } /*if (f2py_success) of nrws*/ - /* End of cleaning variable nrws */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of wsweight ******************************/ - -/********************************** get_frc **********************************/ -static char doc_f2py_rout_symph_get_frc[] = "\ -frc = get_frc(phi_sc,tau,tau_sc,at,itau,size1,size2,size3,[nat,natsc])\n\nWrapper for ``get_frc``.\ -\n\nParameters\n----------\n" -"phi_sc : input rank-4 array('d') with bounds (3,3,natsc,natsc)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"tau_sc : input rank-2 array('d') with bounds (3,natsc)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"itau : input rank-1 array('i') with bounds (natsc)\n" -"size1 : input int\n" -"size2 : input int\n" -"size3 : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)\n" -"natsc : input int, optional\n Default: shape(phi_sc, 2)\n" -"\nReturns\n-------\n" -"frc : rank-7 array('d') with bounds (size1,size2,size3,3,3,nat,nat)"; -/* extern void F_FUNC_US(get_frc,GET_FRC)(double*,double*,double*,double*,int*,double*,int*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_get_frc(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,double*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *phi_sc = NULL; - npy_intp phi_sc_Dims[4] = {-1, -1, -1, -1}; - const int phi_sc_Rank = 4; - PyArrayObject *capi_phi_sc_as_array = NULL; - int capi_phi_sc_intent = 0; - PyObject *phi_sc_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tau_sc = NULL; - npy_intp tau_sc_Dims[2] = {-1, -1}; - const int tau_sc_Rank = 2; - PyArrayObject *capi_tau_sc_as_array = NULL; - int capi_tau_sc_intent = 0; - PyObject *tau_sc_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - int *itau = NULL; - npy_intp itau_Dims[1] = {-1}; - const int itau_Rank = 1; - PyArrayObject *capi_itau_as_array = NULL; - int capi_itau_intent = 0; - PyObject *itau_capi = Py_None; - double *frc = NULL; - npy_intp frc_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int frc_Rank = 7; - PyArrayObject *capi_frc_as_array = NULL; - int capi_frc_intent = 0; - int size1 = 0; - PyObject *size1_capi = Py_None; - int size2 = 0; - PyObject *size2_capi = Py_None; - int size3 = 0; - PyObject *size3_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int natsc = 0; - PyObject *natsc_capi = Py_None; - static char *capi_kwlist[] = {"phi_sc","tau","tau_sc","at","itau","size1","size2","size3","nat","natsc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:symph.get_frc",\ - capi_kwlist,&phi_sc_capi,&tau_capi,&tau_sc_capi,&at_capi,&itau_capi,&size1_capi,&size2_capi,&size3_capi,&nat_capi,&natsc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable size1 */ - f2py_success = int_from_pyobj(&size1,size1_capi,"symph.get_frc() 6th argument (size1) can't be converted to int"); - if (f2py_success) { - /* Processing variable size2 */ - f2py_success = int_from_pyobj(&size2,size2_capi,"symph.get_frc() 7th argument (size2) can't be converted to int"); - if (f2py_success) { - /* Processing variable size3 */ - f2py_success = int_from_pyobj(&size3,size3_capi,"symph.get_frc() 8th argument (size3) can't be converted to int"); - if (f2py_success) { - /* Processing variable phi_sc */ - phi_sc_Dims[0]=3,phi_sc_Dims[1]=3; - capi_phi_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 1st argument `phi_sc`"; - capi_phi_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,phi_sc_Dims,phi_sc_Rank, capi_phi_sc_intent,phi_sc_capi,capi_errmess); - if (capi_phi_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - phi_sc = (double *)(PyArray_DATA(capi_phi_sc_as_array)); - - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 2nd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 4th argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_frc() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","get_frc:nat=%d",nat) { - /* Processing variable natsc */ - if (natsc_capi == Py_None) natsc = shape(phi_sc, 2); else - f2py_success = int_from_pyobj(&natsc,natsc_capi,"symph.get_frc() 2nd keyword (natsc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(phi_sc, 2) == natsc,"shape(phi_sc, 2) == natsc","2nd keyword natsc","get_frc:natsc=%d",natsc) { - /* Processing variable tau_sc */ - tau_sc_Dims[0]=3,tau_sc_Dims[1]=natsc; - capi_tau_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 3rd argument `tau_sc`"; - capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); - if (capi_tau_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); - - /* Processing variable itau */ - itau_Dims[0]=natsc; - capi_itau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_frc: failed to create array from the 5th argument `itau`"; - capi_itau_as_array = ndarray_from_pyobj( NPY_INT,1,itau_Dims,itau_Rank, capi_itau_intent,itau_capi,capi_errmess); - if (capi_itau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau = (int *)(PyArray_DATA(capi_itau_as_array)); - - /* Processing variable frc */ - frc_Dims[0]=size1,frc_Dims[1]=size2,frc_Dims[2]=size3,frc_Dims[3]=3,frc_Dims[4]=3,frc_Dims[5]=nat,frc_Dims[6]=nat; - capi_frc_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_frc: failed to create array from the hidden `frc`"; - capi_frc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,frc_Dims,frc_Rank, capi_frc_intent,Py_None,capi_errmess); - if (capi_frc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - frc = (double *)(PyArray_DATA(capi_frc_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(phi_sc,tau,tau_sc,at,itau,frc,&size1,&size2,&size3,&nat,&natsc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_frc_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_frc_as_array == NULL) ... else of frc */ - /* End of cleaning variable frc */ - if((PyObject *)capi_itau_as_array!=itau_capi) { - Py_XDECREF(capi_itau_as_array); } - } /* if (capi_itau_as_array == NULL) ... else of itau */ - /* End of cleaning variable itau */ - if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { - Py_XDECREF(capi_tau_sc_as_array); } - } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ - /* End of cleaning variable tau_sc */ - } /*CHECKSCALAR(shape(phi_sc, 2) == natsc)*/ - } /*if (f2py_success) of natsc*/ - /* End of cleaning variable natsc */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_phi_sc_as_array!=phi_sc_capi) { - Py_XDECREF(capi_phi_sc_as_array); } - } /* if (capi_phi_sc_as_array == NULL) ... else of phi_sc */ - /* End of cleaning variable phi_sc */ - } /*if (f2py_success) of size3*/ - /* End of cleaning variable size3 */ - } /*if (f2py_success) of size2*/ - /* End of cleaning variable size2 */ - } /*if (f2py_success) of size1*/ - /* End of cleaning variable size1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of get_frc *******************************/ - -/************************* asign_supercell_index_new *************************/ -static char doc_f2py_rout_symph_asign_supercell_index_new[] = "\ -l,m,n = asign_supercell_index_new(vect,at)\n\nWrapper for ``asign_supercell_index_new``.\ -\n\nParameters\n----------\n" -"vect : input rank-1 array('d') with bounds (3)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"l : int\n" -"m : int\n" -"n : int"; -/* extern void F_FUNC_US(asign_supercell_index_new,ASIGN_SUPERCELL_INDEX_NEW)(double*,double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_asign_supercell_index_new(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *vect = NULL; - npy_intp vect_Dims[1] = {-1}; - const int vect_Rank = 1; - PyArrayObject *capi_vect_as_array = NULL; - int capi_vect_intent = 0; - PyObject *vect_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - int l = 0; - int m = 0; - int n = 0; - static char *capi_kwlist[] = {"vect","at",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.asign_supercell_index_new",\ - capi_kwlist,&vect_capi,&at_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable vect */ - vect_Dims[0]=3; - capi_vect_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.asign_supercell_index_new: failed to create array from the 1st argument `vect`"; - capi_vect_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vect_Dims,vect_Rank, capi_vect_intent,vect_capi,capi_errmess); - if (capi_vect_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - vect = (double *)(PyArray_DATA(capi_vect_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.asign_supercell_index_new: failed to create array from the 2nd argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable l */ - /* Processing variable m */ - /* Processing variable n */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(vect,at,&l,&m,&n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("iii",l,m,n); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable n */ - /* End of cleaning variable m */ - /* End of cleaning variable l */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_vect_as_array!=vect_capi) { - Py_XDECREF(capi_vect_as_array); } - } /* if (capi_vect_as_array == NULL) ... else of vect */ - /* End of cleaning variable vect */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************** end of asign_supercell_index_new **********************/ - -/*********************************** q_gen ***********************************/ -static char doc_f2py_rout_symph_q_gen[] = "\ -qbid = q_gen(nsc,at_blk,bg_blk,at,bg)\n\nWrapper for ``q_gen``.\ -\n\nParameters\n----------\n" -"nsc : input int\n" -"at_blk : input rank-2 array('d') with bounds (3,3)\n" -"bg_blk : input rank-2 array('d') with bounds (3,3)\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"qbid : rank-2 array('d') with bounds (3,nsc)"; -/* extern void F_FUNC_US(q_gen,Q_GEN)(int*,double*,double*,double*,double*,double*); */ -static PyObject *f2py_rout_symph_q_gen(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nsc = 0; - PyObject *nsc_capi = Py_None; - double *qbid = NULL; - npy_intp qbid_Dims[2] = {-1, -1}; - const int qbid_Rank = 2; - PyArrayObject *capi_qbid_as_array = NULL; - int capi_qbid_intent = 0; - double *at_blk = NULL; - npy_intp at_blk_Dims[2] = {-1, -1}; - const int at_blk_Rank = 2; - PyArrayObject *capi_at_blk_as_array = NULL; - int capi_at_blk_intent = 0; - PyObject *at_blk_capi = Py_None; - double *bg_blk = NULL; - npy_intp bg_blk_Dims[2] = {-1, -1}; - const int bg_blk_Rank = 2; - PyArrayObject *capi_bg_blk_as_array = NULL; - int capi_bg_blk_intent = 0; - PyObject *bg_blk_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - static char *capi_kwlist[] = {"nsc","at_blk","bg_blk","at","bg",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:symph.q_gen",\ - capi_kwlist,&nsc_capi,&at_blk_capi,&bg_blk_capi,&at_capi,&bg_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nsc */ - f2py_success = int_from_pyobj(&nsc,nsc_capi,"symph.q_gen() 1st argument (nsc) can't be converted to int"); - if (f2py_success) { - /* Processing variable at_blk */ - at_blk_Dims[0]=3,at_blk_Dims[1]=3; - capi_at_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 2nd argument `at_blk`"; - capi_at_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_blk_Dims,at_blk_Rank, capi_at_blk_intent,at_blk_capi,capi_errmess); - if (capi_at_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at_blk = (double *)(PyArray_DATA(capi_at_blk_as_array)); - - /* Processing variable bg_blk */ - bg_blk_Dims[0]=3,bg_blk_Dims[1]=3; - capi_bg_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 3rd argument `bg_blk`"; - capi_bg_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_blk_Dims,bg_blk_Rank, capi_bg_blk_intent,bg_blk_capi,capi_errmess); - if (capi_bg_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg_blk = (double *)(PyArray_DATA(capi_bg_blk_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 4th argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.q_gen: failed to create array from the 5th argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable qbid */ - qbid_Dims[0]=3,qbid_Dims[1]=nsc; - capi_qbid_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.q_gen: failed to create array from the hidden `qbid`"; - capi_qbid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qbid_Dims,qbid_Rank, capi_qbid_intent,Py_None,capi_errmess); - if (capi_qbid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qbid = (double *)(PyArray_DATA(capi_qbid_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nsc,qbid,at_blk,bg_blk,at,bg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_qbid_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_qbid_as_array == NULL) ... else of qbid */ - /* End of cleaning variable qbid */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_bg_blk_as_array!=bg_blk_capi) { - Py_XDECREF(capi_bg_blk_as_array); } - } /* if (capi_bg_blk_as_array == NULL) ... else of bg_blk */ - /* End of cleaning variable bg_blk */ - if((PyObject *)capi_at_blk_as_array!=at_blk_capi) { - Py_XDECREF(capi_at_blk_as_array); } - } /* if (capi_at_blk_as_array == NULL) ... else of at_blk */ - /* End of cleaning variable at_blk */ - } /*if (f2py_success) of nsc*/ - /* End of cleaning variable nsc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of q_gen ********************************/ - -/********************************** set_tau **********************************/ -static char doc_f2py_rout_symph_set_tau[] = "\ -set_tau(at,at_blk,tau,tau_blk,ityp,ityp_blk,itau_blk,[nat,nat_blk])\n\nWrapper for ``set_tau``.\ -\n\nParameters\n----------\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"at_blk : input rank-2 array('d') with bounds (3,3)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"tau_blk : input rank-2 array('d') with bounds (3,nat_blk)\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"ityp_blk : input rank-1 array('i') with bounds (nat_blk)\n" -"itau_blk : input rank-1 array('i') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)\n" -"nat_blk : input int, optional\n Default: shape(tau_blk, 1)"; -/* extern void F_FUNC_US(set_tau,SET_TAU)(int*,int*,double*,double*,double*,double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_set_tau(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,double*,double*,double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - int nat_blk = 0; - PyObject *nat_blk_capi = Py_None; - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *at_blk = NULL; - npy_intp at_blk_Dims[2] = {-1, -1}; - const int at_blk_Rank = 2; - PyArrayObject *capi_at_blk_as_array = NULL; - int capi_at_blk_intent = 0; - PyObject *at_blk_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tau_blk = NULL; - npy_intp tau_blk_Dims[2] = {-1, -1}; - const int tau_blk_Rank = 2; - PyArrayObject *capi_tau_blk_as_array = NULL; - int capi_tau_blk_intent = 0; - PyObject *tau_blk_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - int *ityp_blk = NULL; - npy_intp ityp_blk_Dims[1] = {-1}; - const int ityp_blk_Rank = 1; - PyArrayObject *capi_ityp_blk_as_array = NULL; - int capi_ityp_blk_intent = 0; - PyObject *ityp_blk_capi = Py_None; - int *itau_blk = NULL; - npy_intp itau_blk_Dims[1] = {-1}; - const int itau_blk_Rank = 1; - PyArrayObject *capi_itau_blk_as_array = NULL; - int capi_itau_blk_intent = 0; - PyObject *itau_blk_capi = Py_None; - static char *capi_kwlist[] = {"at","at_blk","tau","tau_blk","ityp","ityp_blk","itau_blk","nat","nat_blk",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OO:symph.set_tau",\ - capi_kwlist,&at_capi,&at_blk_capi,&tau_capi,&tau_blk_capi,&ityp_capi,&ityp_blk_capi,&itau_blk_capi,&nat_capi,&nat_blk_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 1st argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable at_blk */ - at_blk_Dims[0]=3,at_blk_Dims[1]=3; - capi_at_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 2nd argument `at_blk`"; - capi_at_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_blk_Dims,at_blk_Rank, capi_at_blk_intent,at_blk_capi,capi_errmess); - if (capi_at_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at_blk = (double *)(PyArray_DATA(capi_at_blk_as_array)); - - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 3rd argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable tau_blk */ - tau_blk_Dims[0]=3; - capi_tau_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 4th argument `tau_blk`"; - capi_tau_blk_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_blk_Dims,tau_blk_Rank, capi_tau_blk_intent,tau_blk_capi,capi_errmess); - if (capi_tau_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_blk = (double *)(PyArray_DATA(capi_tau_blk_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.set_tau() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","set_tau:nat=%d",nat) { - /* Processing variable nat_blk */ - if (nat_blk_capi == Py_None) nat_blk = shape(tau_blk, 1); else - f2py_success = int_from_pyobj(&nat_blk,nat_blk_capi,"symph.set_tau() 2nd keyword (nat_blk) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau_blk, 1) == nat_blk,"shape(tau_blk, 1) == nat_blk","2nd keyword nat_blk","set_tau:nat_blk=%d",nat_blk) { - /* Processing variable ityp */ - ityp_Dims[0]=nat; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 5th argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - - /* Processing variable ityp_blk */ - ityp_blk_Dims[0]=nat_blk; - capi_ityp_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 6th argument `ityp_blk`"; - capi_ityp_blk_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_blk_Dims,ityp_blk_Rank, capi_ityp_blk_intent,ityp_blk_capi,capi_errmess); - if (capi_ityp_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp_blk = (int *)(PyArray_DATA(capi_ityp_blk_as_array)); - - /* Processing variable itau_blk */ - itau_blk_Dims[0]=nat; - capi_itau_blk_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.set_tau: failed to create array from the 7th argument `itau_blk`"; - capi_itau_blk_as_array = ndarray_from_pyobj( NPY_INT,1,itau_blk_Dims,itau_blk_Rank, capi_itau_blk_intent,itau_blk_capi,capi_errmess); - if (capi_itau_blk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - itau_blk = (int *)(PyArray_DATA(capi_itau_blk_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,&nat_blk,at,at_blk,tau,tau_blk,ityp,ityp_blk,itau_blk); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_itau_blk_as_array!=itau_blk_capi) { - Py_XDECREF(capi_itau_blk_as_array); } - } /* if (capi_itau_blk_as_array == NULL) ... else of itau_blk */ - /* End of cleaning variable itau_blk */ - if((PyObject *)capi_ityp_blk_as_array!=ityp_blk_capi) { - Py_XDECREF(capi_ityp_blk_as_array); } - } /* if (capi_ityp_blk_as_array == NULL) ... else of ityp_blk */ - /* End of cleaning variable ityp_blk */ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ - } /*CHECKSCALAR(shape(tau_blk, 1) == nat_blk)*/ - } /*if (f2py_success) of nat_blk*/ - /* End of cleaning variable nat_blk */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_tau_blk_as_array!=tau_blk_capi) { - Py_XDECREF(capi_tau_blk_as_array); } - } /* if (capi_tau_blk_as_array == NULL) ... else of tau_blk */ - /* End of cleaning variable tau_blk */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_at_blk_as_array!=at_blk_capi) { - Py_XDECREF(capi_at_blk_as_array); } - } /* if (capi_at_blk_as_array == NULL) ... else of at_blk */ - /* End of cleaning variable at_blk */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of set_tau *******************************/ - -/****************************** threetosix_real ******************************/ -static char doc_f2py_rout_symph_threetosix_real[] = "\ -mat6 = threetosix_real(mat3,[nat])\n\nWrapper for ``threetosix_real``.\ -\n\nParameters\n----------\n" -"mat3 : input rank-3 array('d') with bounds (3 * nat,3 * nat,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(mat3, 0) / 3\n" -"\nReturns\n-------\n" -"mat6 : rank-6 array('d') with bounds (nat,nat,nat,3,3,3)"; -/* extern void F_FUNC_US(threetosix_real,THREETOSIX_REAL)(double*,double*,int*); */ -static PyObject *f2py_rout_symph_threetosix_real(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *mat3 = NULL; - npy_intp mat3_Dims[3] = {-1, -1, -1}; - const int mat3_Rank = 3; - PyArrayObject *capi_mat3_as_array = NULL; - int capi_mat3_intent = 0; - PyObject *mat3_capi = Py_None; - double *mat6 = NULL; - npy_intp mat6_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int mat6_Rank = 6; - PyArrayObject *capi_mat6_as_array = NULL; - int capi_mat6_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"mat3","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:symph.threetosix_real",\ - capi_kwlist,&mat3_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable mat3 */ - ; - capi_mat3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.threetosix_real: failed to create array from the 1st argument `mat3`"; - capi_mat3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat3_Dims,mat3_Rank, capi_mat3_intent,mat3_capi,capi_errmess); - if (capi_mat3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mat3 = (double *)(PyArray_DATA(capi_mat3_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(mat3, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.threetosix_real() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(mat3, 0) == 3 * nat,"shape(mat3, 0) == 3 * nat","1st keyword nat","threetosix_real:nat=%d",nat) { - /* Processing variable mat6 */ - mat6_Dims[0]=nat,mat6_Dims[1]=nat,mat6_Dims[2]=nat,mat6_Dims[3]=3,mat6_Dims[4]=3,mat6_Dims[5]=3; - capi_mat6_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.threetosix_real: failed to create array from the hidden `mat6`"; - capi_mat6_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat6_Dims,mat6_Rank, capi_mat6_intent,Py_None,capi_errmess); - if (capi_mat6_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mat6 = (double *)(PyArray_DATA(capi_mat6_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(mat3,mat6,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_mat6_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_mat6_as_array == NULL) ... else of mat6 */ - /* End of cleaning variable mat6 */ - } /*CHECKSCALAR(shape(mat3, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_mat3_as_array!=mat3_capi) { - Py_XDECREF(capi_mat3_as_array); } - } /* if (capi_mat3_as_array == NULL) ... else of mat3 */ - /* End of cleaning variable mat3 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of threetosix_real ***************************/ - -/****************************** sixtothree_real ******************************/ -static char doc_f2py_rout_symph_sixtothree_real[] = "\ -mat3 = sixtothree_real(mat6,[nat])\n\nWrapper for ``sixtothree_real``.\ -\n\nParameters\n----------\n" -"mat6 : input rank-6 array('d') with bounds (nat,nat,nat,3,3,3)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(mat6, 0)\n" -"\nReturns\n-------\n" -"mat3 : rank-3 array('d') with bounds (3 * nat,3 * nat,3 * nat)"; -/* extern void F_FUNC_US(sixtothree_real,SIXTOTHREE_REAL)(double*,double*,int*); */ -static PyObject *f2py_rout_symph_sixtothree_real(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *mat6 = NULL; - npy_intp mat6_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int mat6_Rank = 6; - PyArrayObject *capi_mat6_as_array = NULL; - int capi_mat6_intent = 0; - PyObject *mat6_capi = Py_None; - double *mat3 = NULL; - npy_intp mat3_Dims[3] = {-1, -1, -1}; - const int mat3_Rank = 3; - PyArrayObject *capi_mat3_as_array = NULL; - int capi_mat3_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"mat6","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:symph.sixtothree_real",\ - capi_kwlist,&mat6_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable mat6 */ - mat6_Dims[3]=3,mat6_Dims[4]=3,mat6_Dims[5]=3; - capi_mat6_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sixtothree_real: failed to create array from the 1st argument `mat6`"; - capi_mat6_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat6_Dims,mat6_Rank, capi_mat6_intent,mat6_capi,capi_errmess); - if (capi_mat6_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mat6 = (double *)(PyArray_DATA(capi_mat6_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(mat6, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sixtothree_real() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(mat6, 0) == nat,"shape(mat6, 0) == nat","1st keyword nat","sixtothree_real:nat=%d",nat) { - /* Processing variable mat3 */ - mat3_Dims[0]=3 * nat,mat3_Dims[1]=3 * nat,mat3_Dims[2]=3 * nat; - capi_mat3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.sixtothree_real: failed to create array from the hidden `mat3`"; - capi_mat3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mat3_Dims,mat3_Rank, capi_mat3_intent,Py_None,capi_errmess); - if (capi_mat3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mat3 = (double *)(PyArray_DATA(capi_mat3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(mat6,mat3,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_mat3_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_mat3_as_array == NULL) ... else of mat3 */ - /* End of cleaning variable mat3 */ - } /*CHECKSCALAR(shape(mat6, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_mat6_as_array!=mat6_capi) { - Py_XDECREF(capi_mat6_as_array); } - } /* if (capi_mat6_as_array == NULL) ... else of mat6 */ - /* End of cleaning variable mat6 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of sixtothree_real ***************************/ - -/*********************************** eqvect ***********************************/ -static char doc_f2py_rout_symph_eqvect[] = "\ -eqvect = eqvect(x,y,f)\n\nWrapper for ``eqvect``.\ -\n\nParameters\n----------\n" -"x : input rank-1 array('d') with bounds (3)\n" -"y : input rank-1 array('d') with bounds (3)\n" -"f : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"eqvect : int"; -/* extern void F_WRAPPEDFUNC(eqvect,EQVECT)(int*,double*,double*,double*); */ -static PyObject *f2py_rout_symph_eqvect(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int eqvect = 0; - double *x = NULL; - npy_intp x_Dims[1] = {-1}; - const int x_Rank = 1; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - double *y = NULL; - npy_intp y_Dims[1] = {-1}; - const int y_Rank = 1; - PyArrayObject *capi_y_as_array = NULL; - int capi_y_intent = 0; - PyObject *y_capi = Py_None; - double *f = NULL; - npy_intp f_Dims[1] = {-1}; - const int f_Rank = 1; - PyArrayObject *capi_f_as_array = NULL; - int capi_f_intent = 0; - PyObject *f_capi = Py_None; - static char *capi_kwlist[] = {"x","y","f",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:symph.eqvect",\ - capi_kwlist,&x_capi,&y_capi,&f_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable eqvect */ - /* Processing variable x */ - x_Dims[0]=3; - capi_x_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.eqvect: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (double *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable y */ - y_Dims[0]=3; - capi_y_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.eqvect: failed to create array from the 2nd argument `y`"; - capi_y_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,y_Dims,y_Rank, capi_y_intent,y_capi,capi_errmess); - if (capi_y_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - y = (double *)(PyArray_DATA(capi_y_as_array)); - - /* Processing variable f */ - f_Dims[0]=3; - capi_f_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.eqvect: failed to create array from the 3rd argument `f`"; - capi_f_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_Dims,f_Rank, capi_f_intent,f_capi,capi_errmess); - if (capi_f_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f = (double *)(PyArray_DATA(capi_f_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&eqvect,x,y,f); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",eqvect); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_f_as_array!=f_capi) { - Py_XDECREF(capi_f_as_array); } - } /* if (capi_f_as_array == NULL) ... else of f */ - /* End of cleaning variable f */ - if((PyObject *)capi_y_as_array!=y_capi) { - Py_XDECREF(capi_y_as_array); } - } /* if (capi_y_as_array == NULL) ... else of y */ - /* End of cleaning variable y */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ - /* End of cleaning variable eqvect */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of eqvect *******************************/ - -/**************************** get_equivalent_atoms ****************************/ -static char doc_f2py_rout_symph_get_equivalent_atoms[] = "\ -eq_atoms = get_equivalent_atoms(coords1,coords2,unit_cell,ityp1,ityp2,[nat])\n\nWrapper for ``get_equivalent_atoms``.\ -\n\nParameters\n----------\n" -"coords1 : input rank-2 array('d') with bounds (nat,3)\n" -"coords2 : input rank-2 array('d') with bounds (nat,3)\n" -"unit_cell : input rank-2 array('d') with bounds (3,3)\n" -"ityp1 : input rank-1 array('i') with bounds (nat)\n" -"ityp2 : input rank-1 array('i') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(coords1, 0)\n" -"\nReturns\n-------\n" -"eq_atoms : rank-1 array('i') with bounds (nat)"; -/* extern void F_FUNC_US(get_equivalent_atoms,GET_EQUIVALENT_ATOMS)(double*,double*,double*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_get_equivalent_atoms(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *coords1 = NULL; - npy_intp coords1_Dims[2] = {-1, -1}; - const int coords1_Rank = 2; - PyArrayObject *capi_coords1_as_array = NULL; - int capi_coords1_intent = 0; - PyObject *coords1_capi = Py_None; - double *coords2 = NULL; - npy_intp coords2_Dims[2] = {-1, -1}; - const int coords2_Rank = 2; - PyArrayObject *capi_coords2_as_array = NULL; - int capi_coords2_intent = 0; - PyObject *coords2_capi = Py_None; - double *unit_cell = NULL; - npy_intp unit_cell_Dims[2] = {-1, -1}; - const int unit_cell_Rank = 2; - PyArrayObject *capi_unit_cell_as_array = NULL; - int capi_unit_cell_intent = 0; - PyObject *unit_cell_capi = Py_None; - int *ityp1 = NULL; - npy_intp ityp1_Dims[1] = {-1}; - const int ityp1_Rank = 1; - PyArrayObject *capi_ityp1_as_array = NULL; - int capi_ityp1_intent = 0; - PyObject *ityp1_capi = Py_None; - int *ityp2 = NULL; - npy_intp ityp2_Dims[1] = {-1}; - const int ityp2_Rank = 1; - PyArrayObject *capi_ityp2_as_array = NULL; - int capi_ityp2_intent = 0; - PyObject *ityp2_capi = Py_None; - int *eq_atoms = NULL; - npy_intp eq_atoms_Dims[1] = {-1}; - const int eq_atoms_Rank = 1; - PyArrayObject *capi_eq_atoms_as_array = NULL; - int capi_eq_atoms_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"coords1","coords2","unit_cell","ityp1","ityp2","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.get_equivalent_atoms",\ - capi_kwlist,&coords1_capi,&coords2_capi,&unit_cell_capi,&ityp1_capi,&ityp2_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable coords1 */ - coords1_Dims[1]=3; - capi_coords1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 1st argument `coords1`"; - capi_coords1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords1_Dims,coords1_Rank, capi_coords1_intent,coords1_capi,capi_errmess); - if (capi_coords1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - coords1 = (double *)(PyArray_DATA(capi_coords1_as_array)); - - /* Processing variable unit_cell */ - unit_cell_Dims[0]=3,unit_cell_Dims[1]=3; - capi_unit_cell_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 3rd argument `unit_cell`"; - capi_unit_cell_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_Dims,unit_cell_Rank, capi_unit_cell_intent,unit_cell_capi,capi_errmess); - if (capi_unit_cell_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - unit_cell = (double *)(PyArray_DATA(capi_unit_cell_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(coords1, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_equivalent_atoms() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(coords1, 0) == nat,"shape(coords1, 0) == nat","1st keyword nat","get_equivalent_atoms:nat=%d",nat) { - /* Processing variable coords2 */ - coords2_Dims[0]=nat,coords2_Dims[1]=3; - capi_coords2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 2nd argument `coords2`"; - capi_coords2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords2_Dims,coords2_Rank, capi_coords2_intent,coords2_capi,capi_errmess); - if (capi_coords2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - coords2 = (double *)(PyArray_DATA(capi_coords2_as_array)); - - /* Processing variable ityp1 */ - ityp1_Dims[0]=nat; - capi_ityp1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 4th argument `ityp1`"; - capi_ityp1_as_array = ndarray_from_pyobj( NPY_INT,1,ityp1_Dims,ityp1_Rank, capi_ityp1_intent,ityp1_capi,capi_errmess); - if (capi_ityp1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp1 = (int *)(PyArray_DATA(capi_ityp1_as_array)); - - /* Processing variable ityp2 */ - ityp2_Dims[0]=nat; - capi_ityp2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the 5th argument `ityp2`"; - capi_ityp2_as_array = ndarray_from_pyobj( NPY_INT,1,ityp2_Dims,ityp2_Rank, capi_ityp2_intent,ityp2_capi,capi_errmess); - if (capi_ityp2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp2 = (int *)(PyArray_DATA(capi_ityp2_as_array)); - - /* Processing variable eq_atoms */ - eq_atoms_Dims[0]=nat; - capi_eq_atoms_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_equivalent_atoms: failed to create array from the hidden `eq_atoms`"; - capi_eq_atoms_as_array = ndarray_from_pyobj( NPY_INT,1,eq_atoms_Dims,eq_atoms_Rank, capi_eq_atoms_intent,Py_None,capi_errmess); - if (capi_eq_atoms_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - eq_atoms = (int *)(PyArray_DATA(capi_eq_atoms_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(coords1,coords2,unit_cell,ityp1,ityp2,eq_atoms,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_eq_atoms_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_eq_atoms_as_array == NULL) ... else of eq_atoms */ - /* End of cleaning variable eq_atoms */ - if((PyObject *)capi_ityp2_as_array!=ityp2_capi) { - Py_XDECREF(capi_ityp2_as_array); } - } /* if (capi_ityp2_as_array == NULL) ... else of ityp2 */ - /* End of cleaning variable ityp2 */ - if((PyObject *)capi_ityp1_as_array!=ityp1_capi) { - Py_XDECREF(capi_ityp1_as_array); } - } /* if (capi_ityp1_as_array == NULL) ... else of ityp1 */ - /* End of cleaning variable ityp1 */ - if((PyObject *)capi_coords2_as_array!=coords2_capi) { - Py_XDECREF(capi_coords2_as_array); } - } /* if (capi_coords2_as_array == NULL) ... else of coords2 */ - /* End of cleaning variable coords2 */ - } /*CHECKSCALAR(shape(coords1, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_unit_cell_as_array!=unit_cell_capi) { - Py_XDECREF(capi_unit_cell_as_array); } - } /* if (capi_unit_cell_as_array == NULL) ... else of unit_cell */ - /* End of cleaning variable unit_cell */ - if((PyObject *)capi_coords1_as_array!=coords1_capi) { - Py_XDECREF(capi_coords1_as_array); } - } /* if (capi_coords1_as_array == NULL) ... else of coords1 */ - /* End of cleaning variable coords1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of get_equivalent_atoms ************************/ - -/***************************** get_closest_vector *****************************/ -static char doc_f2py_rout_symph_get_closest_vector[] = "\ -new_v_dist = get_closest_vector(unit_cell,v_dist)\n\nWrapper for ``get_closest_vector``.\ -\n\nParameters\n----------\n" -"unit_cell : input rank-2 array('d') with bounds (3,3)\n" -"v_dist : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"new_v_dist : rank-1 array('d') with bounds (3)"; -/* extern void F_FUNC_US(get_closest_vector,GET_CLOSEST_VECTOR)(double*,double*,double*); */ -static PyObject *f2py_rout_symph_get_closest_vector(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *unit_cell = NULL; - npy_intp unit_cell_Dims[2] = {-1, -1}; - const int unit_cell_Rank = 2; - PyArrayObject *capi_unit_cell_as_array = NULL; - int capi_unit_cell_intent = 0; - PyObject *unit_cell_capi = Py_None; - double *v_dist = NULL; - npy_intp v_dist_Dims[1] = {-1}; - const int v_dist_Rank = 1; - PyArrayObject *capi_v_dist_as_array = NULL; - int capi_v_dist_intent = 0; - PyObject *v_dist_capi = Py_None; - double *new_v_dist = NULL; - npy_intp new_v_dist_Dims[1] = {-1}; - const int new_v_dist_Rank = 1; - PyArrayObject *capi_new_v_dist_as_array = NULL; - int capi_new_v_dist_intent = 0; - static char *capi_kwlist[] = {"unit_cell","v_dist",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.get_closest_vector",\ - capi_kwlist,&unit_cell_capi,&v_dist_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable unit_cell */ - unit_cell_Dims[0]=3,unit_cell_Dims[1]=3; - capi_unit_cell_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_closest_vector: failed to create array from the 1st argument `unit_cell`"; - capi_unit_cell_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_Dims,unit_cell_Rank, capi_unit_cell_intent,unit_cell_capi,capi_errmess); - if (capi_unit_cell_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - unit_cell = (double *)(PyArray_DATA(capi_unit_cell_as_array)); - - /* Processing variable v_dist */ - v_dist_Dims[0]=3; - capi_v_dist_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_closest_vector: failed to create array from the 2nd argument `v_dist`"; - capi_v_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_dist_Dims,v_dist_Rank, capi_v_dist_intent,v_dist_capi,capi_errmess); - if (capi_v_dist_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_dist = (double *)(PyArray_DATA(capi_v_dist_as_array)); - - /* Processing variable new_v_dist */ - new_v_dist_Dims[0]=3; - capi_new_v_dist_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_closest_vector: failed to create array from the hidden `new_v_dist`"; - capi_new_v_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_v_dist_Dims,new_v_dist_Rank, capi_new_v_dist_intent,Py_None,capi_errmess); - if (capi_new_v_dist_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - new_v_dist = (double *)(PyArray_DATA(capi_new_v_dist_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(unit_cell,v_dist,new_v_dist); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_new_v_dist_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_new_v_dist_as_array == NULL) ... else of new_v_dist */ - /* End of cleaning variable new_v_dist */ - if((PyObject *)capi_v_dist_as_array!=v_dist_capi) { - Py_XDECREF(capi_v_dist_as_array); } - } /* if (capi_v_dist_as_array == NULL) ... else of v_dist */ - /* End of cleaning variable v_dist */ - if((PyObject *)capi_unit_cell_as_array!=unit_cell_capi) { - Py_XDECREF(capi_unit_cell_as_array); } - } /* if (capi_unit_cell_as_array == NULL) ... else of unit_cell */ - /* End of cleaning variable unit_cell */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of get_closest_vector *************************/ - -/******************************** get_gr_data ********************************/ -static char doc_f2py_rout_symph_get_gr_data[] = "\ -r_value,gr = get_gr_data(cells,coords,ityp,type1,type2,r_min,r_max,n_r,[n_structs,nat])\n\nWrapper for ``get_gr_data``.\ -\n\nParameters\n----------\n" -"cells : input rank-3 array('d') with bounds (n_structs,3,3)\n" -"coords : input rank-3 array('d') with bounds (n_structs,nat,3)\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"type1 : input int\n" -"type2 : input int\n" -"r_min : input float\n" -"r_max : input float\n" -"n_r : input int\n" -"\nOther Parameters\n----------------\n" -"n_structs : input int, optional\n Default: shape(cells, 0)\n" -"nat : input int, optional\n Default: shape(coords, 1)\n" -"\nReturns\n-------\n" -"r_value : rank-1 array('d') with bounds (n_r)\n" -"gr : rank-1 array('d') with bounds (n_r)"; -/* extern void F_FUNC_US(get_gr_data,GET_GR_DATA)(double*,double*,int*,int*,int*,double*,double*,int*,double*,double*,int*,int*); */ -static PyObject *f2py_rout_symph_get_gr_data(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,double*,double*,int*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *cells = NULL; - npy_intp cells_Dims[3] = {-1, -1, -1}; - const int cells_Rank = 3; - PyArrayObject *capi_cells_as_array = NULL; - int capi_cells_intent = 0; - PyObject *cells_capi = Py_None; - double *coords = NULL; - npy_intp coords_Dims[3] = {-1, -1, -1}; - const int coords_Rank = 3; - PyArrayObject *capi_coords_as_array = NULL; - int capi_coords_intent = 0; - PyObject *coords_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - int type1 = 0; - PyObject *type1_capi = Py_None; - int type2 = 0; - PyObject *type2_capi = Py_None; - double r_min = 0; - PyObject *r_min_capi = Py_None; - double r_max = 0; - PyObject *r_max_capi = Py_None; - int n_r = 0; - PyObject *n_r_capi = Py_None; - double *r_value = NULL; - npy_intp r_value_Dims[1] = {-1}; - const int r_value_Rank = 1; - PyArrayObject *capi_r_value_as_array = NULL; - int capi_r_value_intent = 0; - double *gr = NULL; - npy_intp gr_Dims[1] = {-1}; - const int gr_Rank = 1; - PyArrayObject *capi_gr_as_array = NULL; - int capi_gr_intent = 0; - int n_structs = 0; - PyObject *n_structs_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"cells","coords","ityp","type1","type2","r_min","r_max","n_r","n_structs","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:symph.get_gr_data",\ - capi_kwlist,&cells_capi,&coords_capi,&ityp_capi,&type1_capi,&type2_capi,&r_min_capi,&r_max_capi,&n_r_capi,&n_structs_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable cells */ - cells_Dims[1]=3,cells_Dims[2]=3; - capi_cells_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the 1st argument `cells`"; - capi_cells_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cells_Dims,cells_Rank, capi_cells_intent,cells_capi,capi_errmess); - if (capi_cells_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - cells = (double *)(PyArray_DATA(capi_cells_as_array)); - - /* Processing variable type1 */ - f2py_success = int_from_pyobj(&type1,type1_capi,"symph.get_gr_data() 4th argument (type1) can't be converted to int"); - if (f2py_success) { - /* Processing variable type2 */ - f2py_success = int_from_pyobj(&type2,type2_capi,"symph.get_gr_data() 5th argument (type2) can't be converted to int"); - if (f2py_success) { - /* Processing variable r_min */ - f2py_success = double_from_pyobj(&r_min,r_min_capi,"symph.get_gr_data() 6th argument (r_min) can't be converted to double"); - if (f2py_success) { - /* Processing variable r_max */ - f2py_success = double_from_pyobj(&r_max,r_max_capi,"symph.get_gr_data() 7th argument (r_max) can't be converted to double"); - if (f2py_success) { - /* Processing variable n_r */ - f2py_success = int_from_pyobj(&n_r,n_r_capi,"symph.get_gr_data() 8th argument (n_r) can't be converted to int"); - if (f2py_success) { - /* Processing variable n_structs */ - if (n_structs_capi == Py_None) n_structs = shape(cells, 0); else - f2py_success = int_from_pyobj(&n_structs,n_structs_capi,"symph.get_gr_data() 1st keyword (n_structs) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(cells, 0) == n_structs,"shape(cells, 0) == n_structs","1st keyword n_structs","get_gr_data:n_structs=%d",n_structs) { - /* Processing variable coords */ - coords_Dims[0]=n_structs,coords_Dims[2]=3; - capi_coords_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the 2nd argument `coords`"; - capi_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords_Dims,coords_Rank, capi_coords_intent,coords_capi,capi_errmess); - if (capi_coords_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - coords = (double *)(PyArray_DATA(capi_coords_as_array)); - - /* Processing variable r_value */ - r_value_Dims[0]=n_r; - capi_r_value_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the hidden `r_value`"; - capi_r_value_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_value_Dims,r_value_Rank, capi_r_value_intent,Py_None,capi_errmess); - if (capi_r_value_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_value = (double *)(PyArray_DATA(capi_r_value_as_array)); - - /* Processing variable gr */ - gr_Dims[0]=n_r; - capi_gr_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the hidden `gr`"; - capi_gr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gr_Dims,gr_Rank, capi_gr_intent,Py_None,capi_errmess); - if (capi_gr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gr = (double *)(PyArray_DATA(capi_gr_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(coords, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.get_gr_data() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(coords, 1) == nat,"shape(coords, 1) == nat","2nd keyword nat","get_gr_data:nat=%d",nat) { - /* Processing variable ityp */ - ityp_Dims[0]=nat; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_gr_data: failed to create array from the 3rd argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(cells,coords,ityp,&type1,&type2,&r_min,&r_max,&n_r,r_value,gr,&n_structs,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NN",capi_r_value_as_array,capi_gr_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ - } /*CHECKSCALAR(shape(coords, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /* if (capi_gr_as_array == NULL) ... else of gr */ - /* End of cleaning variable gr */ - } /* if (capi_r_value_as_array == NULL) ... else of r_value */ - /* End of cleaning variable r_value */ - if((PyObject *)capi_coords_as_array!=coords_capi) { - Py_XDECREF(capi_coords_as_array); } - } /* if (capi_coords_as_array == NULL) ... else of coords */ - /* End of cleaning variable coords */ - } /*CHECKSCALAR(shape(cells, 0) == n_structs)*/ - } /*if (f2py_success) of n_structs*/ - /* End of cleaning variable n_structs */ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - } /*if (f2py_success) of r_max*/ - /* End of cleaning variable r_max */ - } /*if (f2py_success) of r_min*/ - /* End of cleaning variable r_min */ - } /*if (f2py_success) of type2*/ - /* End of cleaning variable type2 */ - } /*if (f2py_success) of type1*/ - /* End of cleaning variable type1 */ - if((PyObject *)capi_cells_as_array!=cells_capi) { - Py_XDECREF(capi_cells_as_array); } - } /* if (capi_cells_as_array == NULL) ... else of cells */ - /* End of cleaning variable cells */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of get_gr_data *****************************/ - -/************************** fix_coords_in_unit_cell **************************/ -static char doc_f2py_rout_symph_fix_coords_in_unit_cell[] = "\ -new_coords = fix_coords_in_unit_cell(coords,unit_cell,[nat])\n\nWrapper for ``fix_coords_in_unit_cell``.\ -\n\nParameters\n----------\n" -"coords : input rank-2 array('d') with bounds (nat,3)\n" -"unit_cell : input rank-2 array('d') with bounds (3,3)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(coords, 0)\n" -"\nReturns\n-------\n" -"new_coords : rank-2 array('d') with bounds (nat,3)"; -/* extern void F_FUNC_US(fix_coords_in_unit_cell,FIX_COORDS_IN_UNIT_CELL)(double*,double*,double*,int*); */ -static PyObject *f2py_rout_symph_fix_coords_in_unit_cell(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *coords = NULL; - npy_intp coords_Dims[2] = {-1, -1}; - const int coords_Rank = 2; - PyArrayObject *capi_coords_as_array = NULL; - int capi_coords_intent = 0; - PyObject *coords_capi = Py_None; - double *unit_cell = NULL; - npy_intp unit_cell_Dims[2] = {-1, -1}; - const int unit_cell_Rank = 2; - PyArrayObject *capi_unit_cell_as_array = NULL; - int capi_unit_cell_intent = 0; - PyObject *unit_cell_capi = Py_None; - double *new_coords = NULL; - npy_intp new_coords_Dims[2] = {-1, -1}; - const int new_coords_Rank = 2; - PyArrayObject *capi_new_coords_as_array = NULL; - int capi_new_coords_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"coords","unit_cell","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:symph.fix_coords_in_unit_cell",\ - capi_kwlist,&coords_capi,&unit_cell_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable coords */ - coords_Dims[1]=3; - capi_coords_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fix_coords_in_unit_cell: failed to create array from the 1st argument `coords`"; - capi_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,coords_Dims,coords_Rank, capi_coords_intent,coords_capi,capi_errmess); - if (capi_coords_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - coords = (double *)(PyArray_DATA(capi_coords_as_array)); - - /* Processing variable unit_cell */ - unit_cell_Dims[0]=3,unit_cell_Dims[1]=3; - capi_unit_cell_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.fix_coords_in_unit_cell: failed to create array from the 2nd argument `unit_cell`"; - capi_unit_cell_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,unit_cell_Dims,unit_cell_Rank, capi_unit_cell_intent,unit_cell_capi,capi_errmess); - if (capi_unit_cell_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - unit_cell = (double *)(PyArray_DATA(capi_unit_cell_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(coords, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.fix_coords_in_unit_cell() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(coords, 0) == nat,"shape(coords, 0) == nat","1st keyword nat","fix_coords_in_unit_cell:nat=%d",nat) { - /* Processing variable new_coords */ - new_coords_Dims[0]=nat,new_coords_Dims[1]=3; - capi_new_coords_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.fix_coords_in_unit_cell: failed to create array from the hidden `new_coords`"; - capi_new_coords_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_coords_Dims,new_coords_Rank, capi_new_coords_intent,Py_None,capi_errmess); - if (capi_new_coords_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - new_coords = (double *)(PyArray_DATA(capi_new_coords_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(coords,unit_cell,new_coords,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_new_coords_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_new_coords_as_array == NULL) ... else of new_coords */ - /* End of cleaning variable new_coords */ - } /*CHECKSCALAR(shape(coords, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_unit_cell_as_array!=unit_cell_capi) { - Py_XDECREF(capi_unit_cell_as_array); } - } /* if (capi_unit_cell_as_array == NULL) ... else of unit_cell */ - /* End of cleaning variable unit_cell */ - if((PyObject *)capi_coords_as_array!=coords_capi) { - Py_XDECREF(capi_coords_as_array); } - } /* if (capi_coords_as_array == NULL) ... else of coords */ - /* End of cleaning variable coords */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of fix_coords_in_unit_cell ***********************/ - -/********************************** matinv3 **********************************/ -static char doc_f2py_rout_symph_matinv3[] = "\ -b = matinv3(a)\n\nWrapper for ``matinv3``.\ -\n\nParameters\n----------\n" -"a : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"b : rank-2 array('d') with bounds (3,3)"; -/* extern void F_FUNC(matinv3,MATINV3)(double*,double*); */ -static PyObject *f2py_rout_symph_matinv3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - double *b = NULL; - npy_intp b_Dims[2] = {-1, -1}; - const int b_Rank = 2; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - static char *capi_kwlist[] = {"a",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:symph.matinv3",\ - capi_kwlist,&a_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3,a_Dims[1]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.matinv3: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3,b_Dims[1]=3; - capi_b_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.matinv3: failed to create array from the hidden `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b_Dims,b_Rank, capi_b_intent,Py_None,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (double *)(PyArray_DATA(capi_b_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(a,b); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_b_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of matinv3 *******************************/ - -/*********************************** invmat ***********************************/ -static char doc_f2py_rout_symph_invmat[] = "\ -a_inv = invmat(a,[n])\n\nWrapper for ``invmat``.\ -\n\nParameters\n----------\n" -"a : input rank-2 array('d') with bounds (n,n)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(a, 0)\n" -"\nReturns\n-------\n" -"a_inv : rank-2 array('d') with bounds (n,n)"; -/* extern void F_FUNC(invmat,INVMAT)(int*,double*,double*); */ -static PyObject *f2py_rout_symph_invmat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int n = 0; - PyObject *n_capi = Py_None; - double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - double *a_inv = NULL; - npy_intp a_inv_Dims[2] = {-1, -1}; - const int a_inv_Rank = 2; - PyArrayObject *capi_a_inv_as_array = NULL; - int capi_a_inv_intent = 0; - static char *capi_kwlist[] = {"a","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:symph.invmat",\ - capi_kwlist,&a_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.invmat: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(a, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"symph.invmat() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(a, 0) == n,"shape(a, 0) == n","1st keyword n","invmat:n=%d",n) { - /* Processing variable a_inv */ - a_inv_Dims[0]=n,a_inv_Dims[1]=n; - capi_a_inv_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.invmat: failed to create array from the hidden `a_inv`"; - capi_a_inv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_inv_Dims,a_inv_Rank, capi_a_inv_intent,Py_None,capi_errmess); - if (capi_a_inv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a_inv = (double *)(PyArray_DATA(capi_a_inv_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&n,a,a_inv); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_a_inv_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_a_inv_as_array == NULL) ... else of a_inv */ - /* End of cleaning variable a_inv */ - } /*CHECKSCALAR(shape(a, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of invmat *******************************/ - -/*********************************** recips ***********************************/ -static char doc_f2py_rout_symph_recips[] = "\ -b1,b2,b3 = recips(a1,a2,a3)\n\nWrapper for ``recips``.\ -\n\nParameters\n----------\n" -"a1 : input rank-1 array('d') with bounds (3)\n" -"a2 : input rank-1 array('d') with bounds (3)\n" -"a3 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"b1 : rank-1 array('d') with bounds (3)\n" -"b2 : rank-1 array('d') with bounds (3)\n" -"b3 : rank-1 array('d') with bounds (3)"; -/* extern void F_FUNC(recips,RECIPS)(double*,double*,double*,double*,double*,double*); */ -static PyObject *f2py_rout_symph_recips(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *a1 = NULL; - npy_intp a1_Dims[1] = {-1}; - const int a1_Rank = 1; - PyArrayObject *capi_a1_as_array = NULL; - int capi_a1_intent = 0; - PyObject *a1_capi = Py_None; - double *a2 = NULL; - npy_intp a2_Dims[1] = {-1}; - const int a2_Rank = 1; - PyArrayObject *capi_a2_as_array = NULL; - int capi_a2_intent = 0; - PyObject *a2_capi = Py_None; - double *a3 = NULL; - npy_intp a3_Dims[1] = {-1}; - const int a3_Rank = 1; - PyArrayObject *capi_a3_as_array = NULL; - int capi_a3_intent = 0; - PyObject *a3_capi = Py_None; - double *b1 = NULL; - npy_intp b1_Dims[1] = {-1}; - const int b1_Rank = 1; - PyArrayObject *capi_b1_as_array = NULL; - int capi_b1_intent = 0; - double *b2 = NULL; - npy_intp b2_Dims[1] = {-1}; - const int b2_Rank = 1; - PyArrayObject *capi_b2_as_array = NULL; - int capi_b2_intent = 0; - double *b3 = NULL; - npy_intp b3_Dims[1] = {-1}; - const int b3_Rank = 1; - PyArrayObject *capi_b3_as_array = NULL; - int capi_b3_intent = 0; - static char *capi_kwlist[] = {"a1","a2","a3",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:symph.recips",\ - capi_kwlist,&a1_capi,&a2_capi,&a3_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a1 */ - a1_Dims[0]=3; - capi_a1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.recips: failed to create array from the 1st argument `a1`"; - capi_a1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a1_Dims,a1_Rank, capi_a1_intent,a1_capi,capi_errmess); - if (capi_a1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a1 = (double *)(PyArray_DATA(capi_a1_as_array)); - - /* Processing variable a2 */ - a2_Dims[0]=3; - capi_a2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.recips: failed to create array from the 2nd argument `a2`"; - capi_a2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a2_Dims,a2_Rank, capi_a2_intent,a2_capi,capi_errmess); - if (capi_a2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a2 = (double *)(PyArray_DATA(capi_a2_as_array)); - - /* Processing variable a3 */ - a3_Dims[0]=3; - capi_a3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.recips: failed to create array from the 3rd argument `a3`"; - capi_a3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a3_Dims,a3_Rank, capi_a3_intent,a3_capi,capi_errmess); - if (capi_a3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a3 = (double *)(PyArray_DATA(capi_a3_as_array)); - - /* Processing variable b1 */ - b1_Dims[0]=3; - capi_b1_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.recips: failed to create array from the hidden `b1`"; - capi_b1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b1_Dims,b1_Rank, capi_b1_intent,Py_None,capi_errmess); - if (capi_b1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b1 = (double *)(PyArray_DATA(capi_b1_as_array)); - - /* Processing variable b2 */ - b2_Dims[0]=3; - capi_b2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.recips: failed to create array from the hidden `b2`"; - capi_b2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b2_Dims,b2_Rank, capi_b2_intent,Py_None,capi_errmess); - if (capi_b2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b2 = (double *)(PyArray_DATA(capi_b2_as_array)); - - /* Processing variable b3 */ - b3_Dims[0]=3; - capi_b3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.recips: failed to create array from the hidden `b3`"; - capi_b3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,b3_Dims,b3_Rank, capi_b3_intent,Py_None,capi_errmess); - if (capi_b3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b3 = (double *)(PyArray_DATA(capi_b3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(a1,a2,a3,b1,b2,b3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNN",capi_b1_as_array,capi_b2_as_array,capi_b3_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_b3_as_array == NULL) ... else of b3 */ - /* End of cleaning variable b3 */ - } /* if (capi_b2_as_array == NULL) ... else of b2 */ - /* End of cleaning variable b2 */ - } /* if (capi_b1_as_array == NULL) ... else of b1 */ - /* End of cleaning variable b1 */ - if((PyObject *)capi_a3_as_array!=a3_capi) { - Py_XDECREF(capi_a3_as_array); } - } /* if (capi_a3_as_array == NULL) ... else of a3 */ - /* End of cleaning variable a3 */ - if((PyObject *)capi_a2_as_array!=a2_capi) { - Py_XDECREF(capi_a2_as_array); } - } /* if (capi_a2_as_array == NULL) ... else of a2 */ - /* End of cleaning variable a2 */ - if((PyObject *)capi_a1_as_array!=a1_capi) { - Py_XDECREF(capi_a1_as_array); } - } /* if (capi_a1_as_array == NULL) ... else of a1 */ - /* End of cleaning variable a1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of recips *******************************/ - -/******************************** sgam_ph_new ********************************/ -static char doc_f2py_rout_symph_sgam_ph_new[] = "\ -rtau = sgam_ph_new(at,bg,nsym,s,irt,tau,[nat])\n\nWrapper for ``sgam_ph_new``.\ -\n\nParameters\n----------\n" -"at : input rank-2 array('d') with bounds (3,3)\n" -"bg : input rank-2 array('d') with bounds (3,3)\n" -"nsym : input int\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"irt : input rank-2 array('i') with bounds (48,nat)\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(irt, 1)\n" -"\nReturns\n-------\n" -"rtau : rank-3 array('d') with bounds (3,48,nat)"; -/* extern void F_FUNC_US(sgam_ph_new,SGAM_PH_NEW)(double*,double*,int*,int*,int*,double*,double*,int*); */ -static PyObject *f2py_rout_symph_sgam_ph_new(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *at = NULL; - npy_intp at_Dims[2] = {-1, -1}; - const int at_Rank = 2; - PyArrayObject *capi_at_as_array = NULL; - int capi_at_intent = 0; - PyObject *at_capi = Py_None; - double *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *rtau = NULL; - npy_intp rtau_Dims[3] = {-1, -1, -1}; - const int rtau_Rank = 3; - PyArrayObject *capi_rtau_as_array = NULL; - int capi_rtau_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"at","bg","nsym","s","irt","tau","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|O:symph.sgam_ph_new",\ - capi_kwlist,&at_capi,&bg_capi,&nsym_capi,&s_capi,&irt_capi,&tau_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sgam_ph_new() 3rd argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 4th argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable irt */ - irt_Dims[0]=48; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 5th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - - /* Processing variable at */ - at_Dims[0]=3,at_Dims[1]=3; - capi_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 1st argument `at`"; - capi_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_Dims,at_Rank, capi_at_intent,at_capi,capi_errmess); - if (capi_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at = (double *)(PyArray_DATA(capi_at_as_array)); - - /* Processing variable bg */ - bg_Dims[0]=3,bg_Dims[1]=3; - capi_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 2nd argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (double *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(irt, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.sgam_ph_new() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irt, 1) == nat,"shape(irt, 1) == nat","1st keyword nat","sgam_ph_new:nat=%d",nat) { - /* Processing variable tau */ - tau_Dims[0]=3,tau_Dims[1]=nat; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the 6th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable rtau */ - rtau_Dims[0]=3,rtau_Dims[1]=48,rtau_Dims[2]=nat; - capi_rtau_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.sgam_ph_new: failed to create array from the hidden `rtau`"; - capi_rtau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rtau_Dims,rtau_Rank, capi_rtau_intent,Py_None,capi_errmess); - if (capi_rtau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rtau = (double *)(PyArray_DATA(capi_rtau_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(at,bg,&nsym,s,irt,tau,rtau,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_rtau_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_rtau_as_array == NULL) ... else of rtau */ - /* End of cleaning variable rtau */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*CHECKSCALAR(shape(irt, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - if((PyObject *)capi_at_as_array!=at_capi) { - Py_XDECREF(capi_at_as_array); } - } /* if (capi_at_as_array == NULL) ... else of at */ - /* End of cleaning variable at */ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of sgam_ph_new *****************************/ - -/***************************** get_tau_sc_latvec *****************************/ -static char doc_f2py_rout_symph_get_tau_sc_latvec[] = "\ -tau_sc_latvec = get_tau_sc_latvec(tau_sc,latvec,at_sc,[nat_sc,nr])\n\nWrapper for ``get_tau_sc_latvec``.\ -\n\nParameters\n----------\n" -"tau_sc : input rank-2 array('d') with bounds (3,nat_sc)\n" -"latvec : input rank-2 array('d') with bounds (nr,3)\n" -"at_sc : input rank-2 array('d') with bounds (3,3)\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(tau_sc, 1)\n" -"nr : input int, optional\n Default: shape(latvec, 0)\n" -"\nReturns\n-------\n" -"tau_sc_latvec : rank-2 array('i') with bounds (nat_sc,nr)"; -/* extern void F_FUNC_US(get_tau_sc_latvec,GET_TAU_SC_LATVEC)(double*,double*,double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_get_tau_sc_latvec(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tau_sc = NULL; - npy_intp tau_sc_Dims[2] = {-1, -1}; - const int tau_sc_Rank = 2; - PyArrayObject *capi_tau_sc_as_array = NULL; - int capi_tau_sc_intent = 0; - PyObject *tau_sc_capi = Py_None; - double *latvec = NULL; - npy_intp latvec_Dims[2] = {-1, -1}; - const int latvec_Rank = 2; - PyArrayObject *capi_latvec_as_array = NULL; - int capi_latvec_intent = 0; - PyObject *latvec_capi = Py_None; - double *at_sc = NULL; - npy_intp at_sc_Dims[2] = {-1, -1}; - const int at_sc_Rank = 2; - PyArrayObject *capi_at_sc_as_array = NULL; - int capi_at_sc_intent = 0; - PyObject *at_sc_capi = Py_None; - int *tau_sc_latvec = NULL; - npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; - const int tau_sc_latvec_Rank = 2; - PyArrayObject *capi_tau_sc_latvec_as_array = NULL; - int capi_tau_sc_latvec_intent = 0; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - int nr = 0; - PyObject *nr_capi = Py_None; - static char *capi_kwlist[] = {"tau_sc","latvec","at_sc","nat_sc","nr",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:symph.get_tau_sc_latvec",\ - capi_kwlist,&tau_sc_capi,&latvec_capi,&at_sc_capi,&nat_sc_capi,&nr_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable tau_sc */ - tau_sc_Dims[0]=3; - capi_tau_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the 1st argument `tau_sc`"; - capi_tau_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_sc_Dims,tau_sc_Rank, capi_tau_sc_intent,tau_sc_capi,capi_errmess); - if (capi_tau_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc = (double *)(PyArray_DATA(capi_tau_sc_as_array)); - - /* Processing variable latvec */ - latvec_Dims[1]=3; - capi_latvec_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the 2nd argument `latvec`"; - capi_latvec_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,latvec_Dims,latvec_Rank, capi_latvec_intent,latvec_capi,capi_errmess); - if (capi_latvec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - latvec = (double *)(PyArray_DATA(capi_latvec_as_array)); - - /* Processing variable at_sc */ - at_sc_Dims[0]=3,at_sc_Dims[1]=3; - capi_at_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the 3rd argument `at_sc`"; - capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); - if (capi_at_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); - - /* Processing variable nr */ - if (nr_capi == Py_None) nr = shape(latvec, 0); else - f2py_success = int_from_pyobj(&nr,nr_capi,"symph.get_tau_sc_latvec() 2nd keyword (nr) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(latvec, 0) == nr,"shape(latvec, 0) == nr","2nd keyword nr","get_tau_sc_latvec:nr=%d",nr) { - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(tau_sc, 1); else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.get_tau_sc_latvec() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau_sc, 1) == nat_sc,"shape(tau_sc, 1) == nat_sc","1st keyword nat_sc","get_tau_sc_latvec:nat_sc=%d",nat_sc) { - /* Processing variable tau_sc_latvec */ - tau_sc_latvec_Dims[0]=nat_sc,tau_sc_latvec_Dims[1]=nr; - capi_tau_sc_latvec_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.get_tau_sc_latvec: failed to create array from the hidden `tau_sc_latvec`"; - capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,Py_None,capi_errmess); - if (capi_tau_sc_latvec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tau_sc,latvec,at_sc,tau_sc_latvec,&nat_sc,&nr); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_tau_sc_latvec_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ - /* End of cleaning variable tau_sc_latvec */ - } /*CHECKSCALAR(shape(tau_sc, 1) == nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - } /*CHECKSCALAR(shape(latvec, 0) == nr)*/ - } /*if (f2py_success) of nr*/ - /* End of cleaning variable nr */ - if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { - Py_XDECREF(capi_at_sc_as_array); } - } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ - /* End of cleaning variable at_sc */ - if((PyObject *)capi_latvec_as_array!=latvec_capi) { - Py_XDECREF(capi_latvec_as_array); } - } /* if (capi_latvec_as_array == NULL) ... else of latvec */ - /* End of cleaning variable latvec */ - if((PyObject *)capi_tau_sc_as_array!=tau_sc_capi) { - Py_XDECREF(capi_tau_sc_as_array); } - } /* if (capi_tau_sc_as_array == NULL) ... else of tau_sc */ - /* End of cleaning variable tau_sc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of get_tau_sc_latvec **************************/ - -/********************************* permute_v3 *********************************/ -static char doc_f2py_rout_symph_permute_v3[] = "\ -permute_v3(v3,[n])\n\nWrapper for ``permute_v3``.\ -\n\nParameters\n----------\n" -"v3 : in/output rank-3 array('d') with bounds (n,n,n)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(v3, 0)"; -/* extern void F_FUNC_US(permute_v3,PERMUTE_V3)(double*,int*); */ -static PyObject *f2py_rout_symph_permute_v3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v3 = NULL; - npy_intp v3_Dims[3] = {-1, -1, -1}; - const int v3_Rank = 3; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - int n = 0; - PyObject *n_capi = Py_None; - static char *capi_kwlist[] = {"v3","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:symph.permute_v3",\ - capi_kwlist,&v3_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v3 */ - ; - capi_v3_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.permute_v3: failed to create array from the 1st argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(v3, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"symph.permute_v3() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v3, 0) == n,"shape(v3, 0) == n","1st keyword n","permute_v3:n=%d",n) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v3,&n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(v3, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of permute_v3 *****************************/ - -/********************************* permute_v4 *********************************/ -static char doc_f2py_rout_symph_permute_v4[] = "\ -permute_v4(v4,[n])\n\nWrapper for ``permute_v4``.\ -\n\nParameters\n----------\n" -"v4 : in/output rank-4 array('d') with bounds (n,n,n,n)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(v4, 0)"; -/* extern void F_FUNC_US(permute_v4,PERMUTE_V4)(double*,int*); */ -static PyObject *f2py_rout_symph_permute_v4(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v4 = NULL; - npy_intp v4_Dims[4] = {-1, -1, -1, -1}; - const int v4_Rank = 4; - PyArrayObject *capi_v4_as_array = NULL; - int capi_v4_intent = 0; - PyObject *v4_capi = Py_None; - int n = 0; - PyObject *n_capi = Py_None; - static char *capi_kwlist[] = {"v4","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:symph.permute_v4",\ - capi_kwlist,&v4_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v4 */ - ; - capi_v4_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.permute_v4: failed to create array from the 1st argument `v4`"; - capi_v4_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v4_Dims,v4_Rank, capi_v4_intent,v4_capi,capi_errmess); - if (capi_v4_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v4 = (double *)(PyArray_DATA(capi_v4_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(v4, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"symph.permute_v4() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v4, 0) == n,"shape(v4, 0) == n","1st keyword n","permute_v4:n=%d",n) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v4,&n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(v4, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_v4_as_array!=v4_capi) { - Py_XDECREF(capi_v4_as_array); } - } /* if (capi_v4_as_array == NULL) ... else of v4 */ - /* End of cleaning variable v4 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of permute_v4 *****************************/ - -/********************************** trans_v2 **********************************/ -static char doc_f2py_rout_symph_trans_v2[] = "\ -trans_v2(v2,tau_sc_latvec,[nat_sc,nr])\n\nWrapper for ``trans_v2``.\ -\n\nParameters\n----------\n" -"v2 : in/output rank-4 array('d') with bounds (3,3,nat_sc,nat_sc)\n" -"tau_sc_latvec : input rank-2 array('i') with bounds (nat_sc,nr)\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(v2, 2)\n" -"nr : input int, optional\n Default: shape(tau_sc_latvec, 1)"; -/* extern void F_FUNC_US(trans_v2,TRANS_V2)(double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_trans_v2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v2 = NULL; - npy_intp v2_Dims[4] = {-1, -1, -1, -1}; - const int v2_Rank = 4; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - int *tau_sc_latvec = NULL; - npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; - const int tau_sc_latvec_Rank = 2; - PyArrayObject *capi_tau_sc_latvec_as_array = NULL; - int capi_tau_sc_latvec_intent = 0; - PyObject *tau_sc_latvec_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - int nr = 0; - PyObject *nr_capi = Py_None; - static char *capi_kwlist[] = {"v2","tau_sc_latvec","nat_sc","nr",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|OO:symph.trans_v2",\ - capi_kwlist,&v2_capi,&tau_sc_latvec_capi,&nat_sc_capi,&nr_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v2 */ - v2_Dims[0]=3,v2_Dims[1]=3; - capi_v2_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.trans_v2: failed to create array from the 1st argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(v2, 2); else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.trans_v2() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v2, 2) == nat_sc,"shape(v2, 2) == nat_sc","1st keyword nat_sc","trans_v2:nat_sc=%d",nat_sc) { - /* Processing variable tau_sc_latvec */ - tau_sc_latvec_Dims[0]=nat_sc; - capi_tau_sc_latvec_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trans_v2: failed to create array from the 2nd argument `tau_sc_latvec`"; - capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,tau_sc_latvec_capi,capi_errmess); - if (capi_tau_sc_latvec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); - - /* Processing variable nr */ - if (nr_capi == Py_None) nr = shape(tau_sc_latvec, 1); else - f2py_success = int_from_pyobj(&nr,nr_capi,"symph.trans_v2() 2nd keyword (nr) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau_sc_latvec, 1) == nr,"shape(tau_sc_latvec, 1) == nr","2nd keyword nr","trans_v2:nr=%d",nr) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v2,tau_sc_latvec,&nat_sc,&nr); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(tau_sc_latvec, 1) == nr)*/ - } /*if (f2py_success) of nr*/ - /* End of cleaning variable nr */ - if((PyObject *)capi_tau_sc_latvec_as_array!=tau_sc_latvec_capi) { - Py_XDECREF(capi_tau_sc_latvec_as_array); } - } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ - /* End of cleaning variable tau_sc_latvec */ - } /*CHECKSCALAR(shape(v2, 2) == nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of trans_v2 ******************************/ - -/********************************** trans_v3 **********************************/ -static char doc_f2py_rout_symph_trans_v3[] = "\ -trans_v3(v3,tau_sc_latvec,[nat_sc,nr])\n\nWrapper for ``trans_v3``.\ -\n\nParameters\n----------\n" -"v3 : in/output rank-3 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" -"tau_sc_latvec : input rank-2 array('i') with bounds (nat_sc,nr)\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(v3, 0) / 3\n" -"nr : input int, optional\n Default: shape(tau_sc_latvec, 1)"; -/* extern void F_FUNC_US(trans_v3,TRANS_V3)(double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_trans_v3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v3 = NULL; - npy_intp v3_Dims[3] = {-1, -1, -1}; - const int v3_Rank = 3; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - int *tau_sc_latvec = NULL; - npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; - const int tau_sc_latvec_Rank = 2; - PyArrayObject *capi_tau_sc_latvec_as_array = NULL; - int capi_tau_sc_latvec_intent = 0; - PyObject *tau_sc_latvec_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - int nr = 0; - PyObject *nr_capi = Py_None; - static char *capi_kwlist[] = {"v3","tau_sc_latvec","nat_sc","nr",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|OO:symph.trans_v3",\ - capi_kwlist,&v3_capi,&tau_sc_latvec_capi,&nat_sc_capi,&nr_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v3 */ - ; - capi_v3_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.trans_v3: failed to create array from the 1st argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(v3, 0) / 3; else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.trans_v3() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v3, 0) == 3 * nat_sc,"shape(v3, 0) == 3 * nat_sc","1st keyword nat_sc","trans_v3:nat_sc=%d",nat_sc) { - /* Processing variable tau_sc_latvec */ - tau_sc_latvec_Dims[0]=nat_sc; - capi_tau_sc_latvec_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trans_v3: failed to create array from the 2nd argument `tau_sc_latvec`"; - capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,tau_sc_latvec_capi,capi_errmess); - if (capi_tau_sc_latvec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); - - /* Processing variable nr */ - if (nr_capi == Py_None) nr = shape(tau_sc_latvec, 1); else - f2py_success = int_from_pyobj(&nr,nr_capi,"symph.trans_v3() 2nd keyword (nr) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau_sc_latvec, 1) == nr,"shape(tau_sc_latvec, 1) == nr","2nd keyword nr","trans_v3:nr=%d",nr) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v3,tau_sc_latvec,&nat_sc,&nr); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(tau_sc_latvec, 1) == nr)*/ - } /*if (f2py_success) of nr*/ - /* End of cleaning variable nr */ - if((PyObject *)capi_tau_sc_latvec_as_array!=tau_sc_latvec_capi) { - Py_XDECREF(capi_tau_sc_latvec_as_array); } - } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ - /* End of cleaning variable tau_sc_latvec */ - } /*CHECKSCALAR(shape(v3, 0) == 3 * nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of trans_v3 ******************************/ - -/********************************** trans_v4 **********************************/ -static char doc_f2py_rout_symph_trans_v4[] = "\ -trans_v4(v4,tau_sc_latvec,[nat_sc,nr])\n\nWrapper for ``trans_v4``.\ -\n\nParameters\n----------\n" -"v4 : in/output rank-4 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" -"tau_sc_latvec : input rank-2 array('i') with bounds (nat_sc,nr)\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(v4, 0) / 3\n" -"nr : input int, optional\n Default: shape(tau_sc_latvec, 1)"; -/* extern void F_FUNC_US(trans_v4,TRANS_V4)(double*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_trans_v4(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v4 = NULL; - npy_intp v4_Dims[4] = {-1, -1, -1, -1}; - const int v4_Rank = 4; - PyArrayObject *capi_v4_as_array = NULL; - int capi_v4_intent = 0; - PyObject *v4_capi = Py_None; - int *tau_sc_latvec = NULL; - npy_intp tau_sc_latvec_Dims[2] = {-1, -1}; - const int tau_sc_latvec_Rank = 2; - PyArrayObject *capi_tau_sc_latvec_as_array = NULL; - int capi_tau_sc_latvec_intent = 0; - PyObject *tau_sc_latvec_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - int nr = 0; - PyObject *nr_capi = Py_None; - static char *capi_kwlist[] = {"v4","tau_sc_latvec","nat_sc","nr",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|OO:symph.trans_v4",\ - capi_kwlist,&v4_capi,&tau_sc_latvec_capi,&nat_sc_capi,&nr_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v4 */ - ; - capi_v4_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.trans_v4: failed to create array from the 1st argument `v4`"; - capi_v4_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v4_Dims,v4_Rank, capi_v4_intent,v4_capi,capi_errmess); - if (capi_v4_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v4 = (double *)(PyArray_DATA(capi_v4_as_array)); - - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(v4, 0) / 3; else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.trans_v4() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v4, 0) == 3 * nat_sc,"shape(v4, 0) == 3 * nat_sc","1st keyword nat_sc","trans_v4:nat_sc=%d",nat_sc) { - /* Processing variable tau_sc_latvec */ - tau_sc_latvec_Dims[0]=nat_sc; - capi_tau_sc_latvec_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.trans_v4: failed to create array from the 2nd argument `tau_sc_latvec`"; - capi_tau_sc_latvec_as_array = ndarray_from_pyobj( NPY_INT,1,tau_sc_latvec_Dims,tau_sc_latvec_Rank, capi_tau_sc_latvec_intent,tau_sc_latvec_capi,capi_errmess); - if (capi_tau_sc_latvec_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau_sc_latvec = (int *)(PyArray_DATA(capi_tau_sc_latvec_as_array)); - - /* Processing variable nr */ - if (nr_capi == Py_None) nr = shape(tau_sc_latvec, 1); else - f2py_success = int_from_pyobj(&nr,nr_capi,"symph.trans_v4() 2nd keyword (nr) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau_sc_latvec, 1) == nr,"shape(tau_sc_latvec, 1) == nr","2nd keyword nr","trans_v4:nr=%d",nr) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v4,tau_sc_latvec,&nat_sc,&nr); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(tau_sc_latvec, 1) == nr)*/ - } /*if (f2py_success) of nr*/ - /* End of cleaning variable nr */ - if((PyObject *)capi_tau_sc_latvec_as_array!=tau_sc_latvec_capi) { - Py_XDECREF(capi_tau_sc_latvec_as_array); } - } /* if (capi_tau_sc_latvec_as_array == NULL) ... else of tau_sc_latvec */ - /* End of cleaning variable tau_sc_latvec */ - } /*CHECKSCALAR(shape(v4, 0) == 3 * nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - if((PyObject *)capi_v4_as_array!=v4_capi) { - Py_XDECREF(capi_v4_as_array); } - } /* if (capi_v4_as_array == NULL) ... else of v4 */ - /* End of cleaning variable v4 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of trans_v4 ******************************/ - -/*********************************** sym_v2 ***********************************/ -static char doc_f2py_rout_symph_sym_v2[] = "\ -sym_v2(v2,at_sc,bg_sc,s,irt,nsym,[nat_sc])\n\nWrapper for ``sym_v2``.\ -\n\nParameters\n----------\n" -"v2 : in/output rank-4 array('d') with bounds (3,3,nat_sc,nat_sc)\n" -"at_sc : input rank-2 array('d') with bounds (3,3)\n" -"bg_sc : input rank-2 array('d') with bounds (3,3)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"irt : input rank-2 array('i') with bounds (48,nat_sc)\n" -"nsym : input int\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(v2, 2)"; -/* extern void F_FUNC_US(sym_v2,SYM_V2)(double*,double*,double*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_sym_v2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v2 = NULL; - npy_intp v2_Dims[4] = {-1, -1, -1, -1}; - const int v2_Rank = 4; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - double *at_sc = NULL; - npy_intp at_sc_Dims[2] = {-1, -1}; - const int at_sc_Rank = 2; - PyArrayObject *capi_at_sc_as_array = NULL; - int capi_at_sc_intent = 0; - PyObject *at_sc_capi = Py_None; - double *bg_sc = NULL; - npy_intp bg_sc_Dims[2] = {-1, -1}; - const int bg_sc_Rank = 2; - PyArrayObject *capi_bg_sc_as_array = NULL; - int capi_bg_sc_intent = 0; - PyObject *bg_sc_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - static char *capi_kwlist[] = {"v2","at_sc","bg_sc","s","irt","nsym","nat_sc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|O:symph.sym_v2",\ - capi_kwlist,&v2_capi,&at_sc_capi,&bg_sc_capi,&s_capi,&irt_capi,&nsym_capi,&nat_sc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v2 */ - v2_Dims[0]=3,v2_Dims[1]=3; - capi_v2_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 1st argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable at_sc */ - at_sc_Dims[0]=3,at_sc_Dims[1]=3; - capi_at_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 2nd argument `at_sc`"; - capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); - if (capi_at_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); - - /* Processing variable bg_sc */ - bg_sc_Dims[0]=3,bg_sc_Dims[1]=3; - capi_bg_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 3rd argument `bg_sc`"; - capi_bg_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bg_sc_Dims,bg_sc_Rank, capi_bg_sc_intent,bg_sc_capi,capi_errmess); - if (capi_bg_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg_sc = (double *)(PyArray_DATA(capi_bg_sc_as_array)); - - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 4th argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sym_v2() 6th argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(v2, 2); else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.sym_v2() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v2, 2) == nat_sc,"shape(v2, 2) == nat_sc","1st keyword nat_sc","sym_v2:nat_sc=%d",nat_sc) { - /* Processing variable irt */ - irt_Dims[0]=48,irt_Dims[1]=nat_sc; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v2: failed to create array from the 5th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v2,at_sc,bg_sc,s,irt,&nsym,&nat_sc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*CHECKSCALAR(shape(v2, 2) == nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - if((PyObject *)capi_bg_sc_as_array!=bg_sc_capi) { - Py_XDECREF(capi_bg_sc_as_array); } - } /* if (capi_bg_sc_as_array == NULL) ... else of bg_sc */ - /* End of cleaning variable bg_sc */ - if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { - Py_XDECREF(capi_at_sc_as_array); } - } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ - /* End of cleaning variable at_sc */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of sym_v2 *******************************/ - -/*********************************** sym_v3 ***********************************/ -static char doc_f2py_rout_symph_sym_v3[] = "\ -sym_v3(v3,at_sc,s,irt,nsym,[nat_sc])\n\nWrapper for ``sym_v3``.\ -\n\nParameters\n----------\n" -"v3 : in/output rank-3 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" -"at_sc : input rank-2 array('d') with bounds (3,3)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"irt : input rank-2 array('i') with bounds (48,nat_sc)\n" -"nsym : input int\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(v3, 0) / 3"; -/* extern void F_FUNC_US(sym_v3,SYM_V3)(double*,double*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_sym_v3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v3 = NULL; - npy_intp v3_Dims[3] = {-1, -1, -1}; - const int v3_Rank = 3; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - double *at_sc = NULL; - npy_intp at_sc_Dims[2] = {-1, -1}; - const int at_sc_Rank = 2; - PyArrayObject *capi_at_sc_as_array = NULL; - int capi_at_sc_intent = 0; - PyObject *at_sc_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - static char *capi_kwlist[] = {"v3","at_sc","s","irt","nsym","nat_sc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.sym_v3",\ - capi_kwlist,&v3_capi,&at_sc_capi,&s_capi,&irt_capi,&nsym_capi,&nat_sc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v3 */ - ; - capi_v3_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 1st argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable at_sc */ - at_sc_Dims[0]=3,at_sc_Dims[1]=3; - capi_at_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 2nd argument `at_sc`"; - capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); - if (capi_at_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); - - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 3rd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sym_v3() 5th argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(v3, 0) / 3; else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.sym_v3() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v3, 0) == 3 * nat_sc,"shape(v3, 0) == 3 * nat_sc","1st keyword nat_sc","sym_v3:nat_sc=%d",nat_sc) { - /* Processing variable irt */ - irt_Dims[0]=48,irt_Dims[1]=nat_sc; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v3: failed to create array from the 4th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v3,at_sc,s,irt,&nsym,&nat_sc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*CHECKSCALAR(shape(v3, 0) == 3 * nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { - Py_XDECREF(capi_at_sc_as_array); } - } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ - /* End of cleaning variable at_sc */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of sym_v3 *******************************/ - -/*********************************** sym_v4 ***********************************/ -static char doc_f2py_rout_symph_sym_v4[] = "\ -sym_v4(v4,at_sc,s,irt,nsym,[nat_sc])\n\nWrapper for ``sym_v4``.\ -\n\nParameters\n----------\n" -"v4 : in/output rank-4 array('d') with bounds (3 * nat_sc,3 * nat_sc,3 * nat_sc,3 * nat_sc)\n" -"at_sc : input rank-2 array('d') with bounds (3,3)\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"irt : input rank-2 array('i') with bounds (48,nat_sc)\n" -"nsym : input int\n" -"\nOther Parameters\n----------------\n" -"nat_sc : input int, optional\n Default: shape(v4, 0) / 3"; -/* extern void F_FUNC_US(sym_v4,SYM_V4)(double*,double*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_sym_v4(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *v4 = NULL; - npy_intp v4_Dims[4] = {-1, -1, -1, -1}; - const int v4_Rank = 4; - PyArrayObject *capi_v4_as_array = NULL; - int capi_v4_intent = 0; - PyObject *v4_capi = Py_None; - double *at_sc = NULL; - npy_intp at_sc_Dims[2] = {-1, -1}; - const int at_sc_Rank = 2; - PyArrayObject *capi_at_sc_as_array = NULL; - int capi_at_sc_intent = 0; - PyObject *at_sc_capi = Py_None; - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int nat_sc = 0; - PyObject *nat_sc_capi = Py_None; - static char *capi_kwlist[] = {"v4","at_sc","s","irt","nsym","nat_sc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.sym_v4",\ - capi_kwlist,&v4_capi,&at_sc_capi,&s_capi,&irt_capi,&nsym_capi,&nat_sc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v4 */ - ; - capi_v4_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 1st argument `v4`"; - capi_v4_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v4_Dims,v4_Rank, capi_v4_intent,v4_capi,capi_errmess); - if (capi_v4_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v4 = (double *)(PyArray_DATA(capi_v4_as_array)); - - /* Processing variable at_sc */ - at_sc_Dims[0]=3,at_sc_Dims[1]=3; - capi_at_sc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 2nd argument `at_sc`"; - capi_at_sc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,at_sc_Dims,at_sc_Rank, capi_at_sc_intent,at_sc_capi,capi_errmess); - if (capi_at_sc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - at_sc = (double *)(PyArray_DATA(capi_at_sc_as_array)); - - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 3rd argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.sym_v4() 5th argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable nat_sc */ - if (nat_sc_capi == Py_None) nat_sc = shape(v4, 0) / 3; else - f2py_success = int_from_pyobj(&nat_sc,nat_sc_capi,"symph.sym_v4() 1st keyword (nat_sc) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(v4, 0) == 3 * nat_sc,"shape(v4, 0) == 3 * nat_sc","1st keyword nat_sc","sym_v4:nat_sc=%d",nat_sc) { - /* Processing variable irt */ - irt_Dims[0]=48,irt_Dims[1]=nat_sc; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.sym_v4: failed to create array from the 4th argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(v4,at_sc,s,irt,&nsym,&nat_sc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*CHECKSCALAR(shape(v4, 0) == 3 * nat_sc)*/ - } /*if (f2py_success) of nat_sc*/ - /* End of cleaning variable nat_sc */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - if((PyObject *)capi_at_sc_as_array!=at_sc_capi) { - Py_XDECREF(capi_at_sc_as_array); } - } /* if (capi_at_sc_as_array == NULL) ... else of at_sc */ - /* End of cleaning variable at_sc */ - if((PyObject *)capi_v4_as_array!=v4_capi) { - Py_XDECREF(capi_v4_as_array); } - } /* if (capi_v4_as_array == NULL) ... else of v4 */ - /* End of cleaning variable v4 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of sym_v4 *******************************/ - -/********************************* print_symm *********************************/ -static char doc_f2py_rout_symph_print_symm[] = "\ -print_symm(s,nsym,irt,supercell,[nat])\n\nWrapper for ``print_symm``.\ -\n\nParameters\n----------\n" -"s : input rank-3 array('i') with bounds (3,3,48)\n" -"nsym : input int\n" -"irt : input rank-2 array('i') with bounds (48,nat)\n" -"supercell : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(irt, 1)"; -/* extern void F_FUNC_US(print_symm,PRINT_SYMM)(int*,int*,int*,int*,int*); */ -static PyObject *f2py_rout_symph_print_symm(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *s = NULL; - npy_intp s_Dims[3] = {-1, -1, -1}; - const int s_Rank = 3; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - int *irt = NULL; - npy_intp irt_Dims[2] = {-1, -1}; - const int irt_Rank = 2; - PyArrayObject *capi_irt_as_array = NULL; - int capi_irt_intent = 0; - PyObject *irt_capi = Py_None; - int supercell = 0; - PyObject *supercell_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"s","nsym","irt","supercell","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|O:symph.print_symm",\ - capi_kwlist,&s_capi,&nsym_capi,&irt_capi,&supercell_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable s */ - s_Dims[0]=3,s_Dims[1]=3,s_Dims[2]=48; - capi_s_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.print_symm: failed to create array from the 1st argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_INT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (int *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable nsym */ - f2py_success = int_from_pyobj(&nsym,nsym_capi,"symph.print_symm() 2nd argument (nsym) can't be converted to int"); - if (f2py_success) { - /* Processing variable irt */ - irt_Dims[0]=48; - capi_irt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.print_symm: failed to create array from the 3rd argument `irt`"; - capi_irt_as_array = ndarray_from_pyobj( NPY_INT,1,irt_Dims,irt_Rank, capi_irt_intent,irt_capi,capi_errmess); - if (capi_irt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irt = (int *)(PyArray_DATA(capi_irt_as_array)); - - /* Processing variable supercell */ - supercell = (int)PyObject_IsTrue(supercell_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(irt, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.print_symm() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irt, 1) == nat,"shape(irt, 1) == nat","1st keyword nat","print_symm:nat=%d",nat) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(s,&nsym,irt,&supercell,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(irt, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of supercell*/ - /* End of cleaning variable supercell */ - if((PyObject *)capi_irt_as_array!=irt_capi) { - Py_XDECREF(capi_irt_as_array); } - } /* if (capi_irt_as_array == NULL) ... else of irt */ - /* End of cleaning variable irt */ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of print_symm *****************************/ - -/****************************** io_global_start ******************************/ -static char doc_f2py_rout_symph_io_global_io_global_start[] = "\ -io_global_start(mpime,ionode_set)\n\nWrapper for ``io_global_start``.\ -\n\nParameters\n----------\n" -"mpime : input int\n" -"ionode_set : input int"; -/* */ -static PyObject *f2py_rout_symph_io_global_io_global_start(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int mpime = 0; - PyObject *mpime_capi = Py_None; - int ionode_set = 0; - PyObject *ionode_set_capi = Py_None; - static char *capi_kwlist[] = {"mpime","ionode_set",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.io_global.io_global_start",\ - capi_kwlist,&mpime_capi,&ionode_set_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable mpime */ - f2py_success = int_from_pyobj(&mpime,mpime_capi,"symph.io_global.io_global_start() 1st argument (mpime) can't be converted to int"); - if (f2py_success) { - /* Processing variable ionode_set */ - f2py_success = int_from_pyobj(&ionode_set,ionode_set_capi,"symph.io_global.io_global_start() 2nd argument (ionode_set) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&mpime,&ionode_set); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of ionode_set*/ - /* End of cleaning variable ionode_set */ - } /*if (f2py_success) of mpime*/ - /* End of cleaning variable mpime */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of io_global_start ***************************/ - -/**************************** meta_io_global_start ****************************/ -static char doc_f2py_rout_symph_io_global_meta_io_global_start[] = "\ -meta_io_global_start(mpime,ionode_set)\n\nWrapper for ``meta_io_global_start``.\ -\n\nParameters\n----------\n" -"mpime : input int\n" -"ionode_set : input int"; -/* */ -static PyObject *f2py_rout_symph_io_global_meta_io_global_start(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int mpime = 0; - PyObject *mpime_capi = Py_None; - int ionode_set = 0; - PyObject *ionode_set_capi = Py_None; - static char *capi_kwlist[] = {"mpime","ionode_set",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.io_global.meta_io_global_start",\ - capi_kwlist,&mpime_capi,&ionode_set_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable mpime */ - f2py_success = int_from_pyobj(&mpime,mpime_capi,"symph.io_global.meta_io_global_start() 1st argument (mpime) can't be converted to int"); - if (f2py_success) { - /* Processing variable ionode_set */ - f2py_success = int_from_pyobj(&ionode_set,ionode_set_capi,"symph.io_global.meta_io_global_start() 2nd argument (ionode_set) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&mpime,&ionode_set); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of ionode_set*/ - /* End of cleaning variable ionode_set */ - } /*if (f2py_success) of mpime*/ - /* End of cleaning variable mpime */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of meta_io_global_start ************************/ - -/**************************** io_global_getionode ****************************/ -static char doc_f2py_rout_symph_io_global_io_global_getionode[] = "\ -ionode_out,ionode_id_out = io_global_getionode()\n\nWrapper for ``io_global_getionode``.\ -\n\nReturns\n-------\n" -"ionode_out : int\n" -"ionode_id_out : int"; -/* */ -static PyObject *f2py_rout_symph_io_global_io_global_getionode(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ionode_out = 0; - int ionode_id_out = 0; - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:symph.io_global.io_global_getionode",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ - /* Processing variable ionode_out */ - /* Processing variable ionode_id_out */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ionode_out,&ionode_id_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("ii",ionode_out,ionode_id_out); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable ionode_id_out */ - /* End of cleaning variable ionode_out */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of io_global_getionode *************************/ - -/***************************** io_global_getmeta *****************************/ -static char doc_f2py_rout_symph_io_global_io_global_getmeta[] = "\ -io_global_getmeta(myrank,root)\n\nWrapper for ``io_global_getmeta``.\ -\n\nParameters\n----------\n" -"myrank : input int\n" -"root : input int"; -/* */ -static PyObject *f2py_rout_symph_io_global_io_global_getmeta(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int myrank = 0; - PyObject *myrank_capi = Py_None; - int root = 0; - PyObject *root_capi = Py_None; - static char *capi_kwlist[] = {"myrank","root",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.io_global.io_global_getmeta",\ - capi_kwlist,&myrank_capi,&root_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable myrank */ - f2py_success = int_from_pyobj(&myrank,myrank_capi,"symph.io_global.io_global_getmeta() 1st argument (myrank) can't be converted to int"); - if (f2py_success) { - /* Processing variable root */ - f2py_success = int_from_pyobj(&root,root_capi,"symph.io_global.io_global_getmeta() 2nd argument (root) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&myrank,&root); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of root*/ - /* End of cleaning variable root */ - } /*if (f2py_success) of myrank*/ - /* End of cleaning variable myrank */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of io_global_getmeta **************************/ - -/****************************** print_kind_info ******************************/ -static char doc_f2py_rout_symph_kinds_print_kind_info[] = "\ -print_kind_info(stdout_bn)\n\nWrapper for ``print_kind_info``.\ -\n\nParameters\n----------\n" -"stdout_bn : input int"; -/* */ -static PyObject *f2py_rout_symph_kinds_print_kind_info(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int stdout_bn = 0; - PyObject *stdout_bn_capi = Py_None; - static char *capi_kwlist[] = {"stdout_bn",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:symph.kinds.print_kind_info",\ - capi_kwlist,&stdout_bn_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable stdout_bn */ - f2py_success = int_from_pyobj(&stdout_bn,stdout_bn_capi,"symph.kinds.print_kind_info() 1st argument (stdout_bn) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&stdout_bn); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of stdout_bn*/ - /* End of cleaning variable stdout_bn */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of print_kind_info ***************************/ - -/**************************** set_accep_threshold ****************************/ -static char doc_f2py_rout_symph_symm_base_set_accep_threshold[] = "\ -set_accep_threshold(thr)\n\nWrapper for ``set_accep_threshold``.\ -\n\nParameters\n----------\n" -"thr : input float"; -/* */ -static PyObject *f2py_rout_symph_symm_base_set_accep_threshold(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double thr = 0; - PyObject *thr_capi = Py_None; - static char *capi_kwlist[] = {"thr",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:symph.symm_base.set_accep_threshold",\ - capi_kwlist,&thr_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable thr */ - f2py_success = double_from_pyobj(&thr,thr_capi,"symph.symm_base.set_accep_threshold() 1st argument (thr) can't be converted to double"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&thr); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of thr*/ - /* End of cleaning variable thr */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of set_accep_threshold *************************/ - -/**************************** get_accep_threshold ****************************/ -static char doc_f2py_rout_symph_symm_base_get_accep_threshold[] = "\ -thr = get_accep_threshold()\n\nWrapper for ``get_accep_threshold``.\ -\n\nReturns\n-------\n" -"thr : float"; -/* */ -static PyObject *f2py_rout_symph_symm_base_get_accep_threshold(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double thr = 0; - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:symph.symm_base.get_accep_threshold",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ - /* Processing variable thr */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&thr); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",thr); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable thr */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of get_accep_threshold *************************/ - -/********************************* set_at_bg *********************************/ -static char doc_f2py_rout_symph_symm_base_set_at_bg[] = "\ -set_at_bg(new_at,new_bg)\n\nWrapper for ``set_at_bg``.\ -\n\nParameters\n----------\n" -"new_at : input rank-2 array('d') with bounds (3,3)\n" -"new_bg : input rank-2 array('d') with bounds (3,3)"; -/* */ -static PyObject *f2py_rout_symph_symm_base_set_at_bg(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *new_at = NULL; - npy_intp new_at_Dims[2] = {-1, -1}; - const int new_at_Rank = 2; - PyArrayObject *capi_new_at_as_array = NULL; - int capi_new_at_intent = 0; - PyObject *new_at_capi = Py_None; - double *new_bg = NULL; - npy_intp new_bg_Dims[2] = {-1, -1}; - const int new_bg_Rank = 2; - PyArrayObject *capi_new_bg_as_array = NULL; - int capi_new_bg_intent = 0; - PyObject *new_bg_capi = Py_None; - static char *capi_kwlist[] = {"new_at","new_bg",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.symm_base.set_at_bg",\ - capi_kwlist,&new_at_capi,&new_bg_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable new_at */ - new_at_Dims[0]=3,new_at_Dims[1]=3; - capi_new_at_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.set_at_bg: failed to create array from the 1st argument `new_at`"; - capi_new_at_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_at_Dims,new_at_Rank, capi_new_at_intent,new_at_capi,capi_errmess); - if (capi_new_at_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - new_at = (double *)(PyArray_DATA(capi_new_at_as_array)); - - /* Processing variable new_bg */ - new_bg_Dims[0]=3,new_bg_Dims[1]=3; - capi_new_bg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.set_at_bg: failed to create array from the 2nd argument `new_bg`"; - capi_new_bg_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_bg_Dims,new_bg_Rank, capi_new_bg_intent,new_bg_capi,capi_errmess); - if (capi_new_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - new_bg = (double *)(PyArray_DATA(capi_new_bg_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(new_at,new_bg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_new_bg_as_array!=new_bg_capi) { - Py_XDECREF(capi_new_bg_as_array); } - } /* if (capi_new_bg_as_array == NULL) ... else of new_bg */ - /* End of cleaning variable new_bg */ - if((PyObject *)capi_new_at_as_array!=new_at_capi) { - Py_XDECREF(capi_new_at_as_array); } - } /* if (capi_new_at_as_array == NULL) ... else of new_at */ - /* End of cleaning variable new_at */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of set_at_bg ******************************/ - -/********************************* inverse_s *********************************/ -static char doc_f2py_rout_symph_symm_base_inverse_s[] = "\ -inverse_s()\n\nWrapper for ``inverse_s``.\ -\n"; -/* */ -static PyObject *f2py_rout_symph_symm_base_inverse_s(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(void)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:symph.symm_base.inverse_s",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of inverse_s ******************************/ - -/********************************* set_sym_bl *********************************/ -static char doc_f2py_rout_symph_symm_base_set_sym_bl[] = "\ -set_sym_bl()\n\nWrapper for ``set_sym_bl``.\ -\n"; -/* */ -static PyObject *f2py_rout_symph_symm_base_set_sym_bl(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(void)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:symph.symm_base.set_sym_bl",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of set_sym_bl *****************************/ - -/********************************** find_sym **********************************/ -static char doc_f2py_rout_symph_symm_base_find_sym[] = "\ -find_sym(tau,ityp,nr1,nr2,nr3,magnetic_sym,m_loc,[nat])\n\nWrapper for ``find_sym``.\ -\n\nParameters\n----------\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"magnetic_sym : input int\n" -"m_loc : input rank-2 array('d') with bounds (3,nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)"; -/* */ -static PyObject *f2py_rout_symph_symm_base_find_sym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,int*,int*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - int magnetic_sym = 0; - PyObject *magnetic_sym_capi = Py_None; - double *m_loc = NULL; - npy_intp m_loc_Dims[2] = {-1, -1}; - const int m_loc_Rank = 2; - PyArrayObject *capi_m_loc_as_array = NULL; - int capi_m_loc_intent = 0; - PyObject *m_loc_capi = Py_None; - static char *capi_kwlist[] = {"tau","ityp","nr1","nr2","nr3","magnetic_sym","m_loc","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:symph.symm_base.find_sym",\ - capi_kwlist,&tau_capi,&ityp_capi,&nr1_capi,&nr2_capi,&nr3_capi,&magnetic_sym_capi,&m_loc_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.find_sym() 3rd argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.find_sym() 4th argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.find_sym() 5th argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.find_sym: failed to create array from the 1st argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable magnetic_sym */ - magnetic_sym = (int)PyObject_IsTrue(magnetic_sym_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.find_sym() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","find_sym:nat=%d",nat) { - /* Processing variable ityp */ - ityp_Dims[0]=nat; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.find_sym: failed to create array from the 2nd argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - - /* Processing variable m_loc */ - m_loc_Dims[0]=3,m_loc_Dims[1]=nat; - capi_m_loc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.find_sym: failed to create array from the 7th argument `m_loc`"; - capi_m_loc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_loc_Dims,m_loc_Rank, capi_m_loc_intent,m_loc_capi,capi_errmess); - if (capi_m_loc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m_loc = (double *)(PyArray_DATA(capi_m_loc_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,tau,ityp,&nr1,&nr2,&nr3,&magnetic_sym,m_loc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_m_loc_as_array!=m_loc_capi) { - Py_XDECREF(capi_m_loc_as_array); } - } /* if (capi_m_loc_as_array == NULL) ... else of m_loc */ - /* End of cleaning variable m_loc */ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*if (f2py_success) of magnetic_sym*/ - /* End of cleaning variable magnetic_sym */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of find_sym ******************************/ - -/********************************** sgam_at **********************************/ -static char doc_f2py_rout_symph_symm_base_sgam_at[] = "\ -sym = sgam_at(tau,ityp,nr1,nr2,nr3,[nat])\n\nWrapper for ``sgam_at``.\ -\n\nParameters\n----------\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)\n" -"\nReturns\n-------\n" -"sym : rank-1 array('i') with bounds (48)"; -/* */ -static PyObject *f2py_rout_symph_symm_base_sgam_at(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - int *sym = NULL; - npy_intp sym_Dims[1] = {-1}; - const int sym_Rank = 1; - PyArrayObject *capi_sym_as_array = NULL; - int capi_sym_intent = 0; - static char *capi_kwlist[] = {"tau","ityp","nr1","nr2","nr3","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.symm_base.sgam_at",\ - capi_kwlist,&tau_capi,&ityp_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.sgam_at() 3rd argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.sgam_at() 4th argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.sgam_at() 5th argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.sgam_at: failed to create array from the 1st argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable sym */ - sym_Dims[0]=48; - capi_sym_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "symph.symph.symm_base.sgam_at: failed to create array from the hidden `sym`"; - capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,Py_None,capi_errmess); - if (capi_sym_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sym = (int *)(PyArray_DATA(capi_sym_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.sgam_at() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","sgam_at:nat=%d",nat) { - /* Processing variable ityp */ - ityp_Dims[0]=nat; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.sgam_at: failed to create array from the 2nd argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,tau,ityp,&nr1,&nr2,&nr3,sym); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_sym_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /* if (capi_sym_as_array == NULL) ... else of sym */ - /* End of cleaning variable sym */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of sgam_at *******************************/ - -/******************************** sgam_at_mag ********************************/ -static char doc_f2py_rout_symph_symm_base_sgam_at_mag[] = "\ -sgam_at_mag(m_loc,sym,[nat])\n\nWrapper for ``sgam_at_mag``.\ -\n\nParameters\n----------\n" -"m_loc : input rank-2 array('d') with bounds (3,nat)\n" -"sym : in/output rank-1 array('i') with bounds (48)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(m_loc, 1)"; -/* */ -static PyObject *f2py_rout_symph_symm_base_sgam_at_mag(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - double *m_loc = NULL; - npy_intp m_loc_Dims[2] = {-1, -1}; - const int m_loc_Rank = 2; - PyArrayObject *capi_m_loc_as_array = NULL; - int capi_m_loc_intent = 0; - PyObject *m_loc_capi = Py_None; - int *sym = NULL; - npy_intp sym_Dims[1] = {-1}; - const int sym_Rank = 1; - PyArrayObject *capi_sym_as_array = NULL; - int capi_sym_intent = 0; - PyObject *sym_capi = Py_None; - static char *capi_kwlist[] = {"m_loc","sym","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:symph.symm_base.sgam_at_mag",\ - capi_kwlist,&m_loc_capi,&sym_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable m_loc */ - m_loc_Dims[0]=3; - capi_m_loc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.sgam_at_mag: failed to create array from the 1st argument `m_loc`"; - capi_m_loc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_loc_Dims,m_loc_Rank, capi_m_loc_intent,m_loc_capi,capi_errmess); - if (capi_m_loc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m_loc = (double *)(PyArray_DATA(capi_m_loc_as_array)); - - /* Processing variable sym */ - sym_Dims[0]=48; - capi_sym_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.symm_base.sgam_at_mag: failed to create array from the 2nd argument `sym`"; - capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,sym_capi,capi_errmess); - if (capi_sym_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sym = (int *)(PyArray_DATA(capi_sym_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(m_loc, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.sgam_at_mag() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(m_loc, 1) == nat,"shape(m_loc, 1) == nat","1st keyword nat","sgam_at_mag:nat=%d",nat) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,m_loc,sym); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(m_loc, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_sym_as_array!=sym_capi) { - Py_XDECREF(capi_sym_as_array); } - } /* if (capi_sym_as_array == NULL) ... else of sym */ - /* End of cleaning variable sym */ - if((PyObject *)capi_m_loc_as_array!=m_loc_capi) { - Py_XDECREF(capi_m_loc_as_array); } - } /* if (capi_m_loc_as_array == NULL) ... else of m_loc */ - /* End of cleaning variable m_loc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of sgam_at_mag *****************************/ - -/********************************** set_sym **********************************/ -static char doc_f2py_rout_symph_symm_base_set_sym[] = "\ -set_sym(tau,ityp,nspin_mag,m_loc,nr1,nr2,nr3,[nat])\n\nWrapper for ``set_sym``.\ -\n\nParameters\n----------\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"nspin_mag : input int\n" -"m_loc : input rank-2 array('d') with bounds (3,nat)\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)"; -/* */ -static PyObject *f2py_rout_symph_symm_base_set_sym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,int*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - int nspin_mag = 0; - PyObject *nspin_mag_capi = Py_None; - double *m_loc = NULL; - npy_intp m_loc_Dims[2] = {-1, -1}; - const int m_loc_Rank = 2; - PyArrayObject *capi_m_loc_as_array = NULL; - int capi_m_loc_intent = 0; - PyObject *m_loc_capi = Py_None; - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - static char *capi_kwlist[] = {"tau","ityp","nspin_mag","m_loc","nr1","nr2","nr3","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:symph.symm_base.set_sym",\ - capi_kwlist,&tau_capi,&ityp_capi,&nspin_mag_capi,&m_loc_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nspin_mag */ - f2py_success = int_from_pyobj(&nspin_mag,nspin_mag_capi,"symph.symm_base.set_sym() 3rd argument (nspin_mag) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.set_sym() 5th argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.set_sym() 6th argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.set_sym() 7th argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.set_sym: failed to create array from the 1st argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.set_sym() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","set_sym:nat=%d",nat) { - /* Processing variable ityp */ - ityp_Dims[0]=nat; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.set_sym: failed to create array from the 2nd argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - - /* Processing variable m_loc */ - m_loc_Dims[0]=3,m_loc_Dims[1]=nat; - capi_m_loc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.set_sym: failed to create array from the 4th argument `m_loc`"; - capi_m_loc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_loc_Dims,m_loc_Rank, capi_m_loc_intent,m_loc_capi,capi_errmess); - if (capi_m_loc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m_loc = (double *)(PyArray_DATA(capi_m_loc_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,tau,ityp,&nspin_mag,m_loc,&nr1,&nr2,&nr3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_m_loc_as_array!=m_loc_capi) { - Py_XDECREF(capi_m_loc_as_array); } - } /* if (capi_m_loc_as_array == NULL) ... else of m_loc */ - /* End of cleaning variable m_loc */ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ - } /*if (f2py_success) of nspin_mag*/ - /* End of cleaning variable nspin_mag */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of set_sym *******************************/ - -/********************************** copy_sym **********************************/ -static char doc_f2py_rout_symph_symm_base_copy_sym[] = "\ -copy_sym = copy_sym(nrot_,sym)\n\nWrapper for ``copy_sym``.\ -\n\nParameters\n----------\n" -"nrot_ : input int\n" -"sym : in/output rank-1 array('i') with bounds (48)\n" -"\nReturns\n-------\n" -"copy_sym : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_symph_symm_base_copy_sym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int copy_symf2pywrap = 0; - int nrot_ = 0; - PyObject *nrot__capi = Py_None; - int *sym = NULL; - npy_intp sym_Dims[1] = {-1}; - const int sym_Rank = 1; - PyArrayObject *capi_sym_as_array = NULL; - int capi_sym_intent = 0; - PyObject *sym_capi = Py_None; - static char *capi_kwlist[] = {"nrot_","sym",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:symph.symm_base.copy_sym",\ - capi_kwlist,&nrot__capi,&sym_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nrot_ */ - f2py_success = int_from_pyobj(&nrot_,nrot__capi,"symph.symm_base.copy_sym() 1st argument (nrot_) can't be converted to int"); - if (f2py_success) { - /* Processing variable sym */ - sym_Dims[0]=48; - capi_sym_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.symm_base.copy_sym: failed to create array from the 2nd argument `sym`"; - capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,sym_capi,capi_errmess); - if (capi_sym_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sym = (int *)(PyArray_DATA(capi_sym_as_array)); - - /* Processing variable copy_symf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(©_symf2pywrap,&nrot_,sym); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",copy_symf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable copy_symf2pywrap */ - if((PyObject *)capi_sym_as_array!=sym_capi) { - Py_XDECREF(capi_sym_as_array); } - } /* if (capi_sym_as_array == NULL) ... else of sym */ - /* End of cleaning variable sym */ - } /*if (f2py_success) of nrot_*/ - /* End of cleaning variable nrot_ */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of copy_sym ******************************/ - -/********************************** is_group **********************************/ -static char doc_f2py_rout_symph_symm_base_is_group[] = "\ -is_group = is_group()\n\nWrapper for ``is_group``.\ -\n\nReturns\n-------\n" -"is_group : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_symph_symm_base_is_group(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int is_groupf2pywrap = 0; - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:symph.symm_base.is_group",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ - /* Processing variable is_groupf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&is_groupf2pywrap); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",is_groupf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable is_groupf2pywrap */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of is_group ******************************/ - -/*********************************** eqvect ***********************************/ -static char doc_f2py_rout_symph_symm_base_eqvect[] = "\ -eqvect = eqvect(x,y,f)\n\nWrapper for ``eqvect``.\ -\n\nParameters\n----------\n" -"x : input rank-1 array('d') with bounds (3)\n" -"y : input rank-1 array('d') with bounds (3)\n" -"f : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"eqvect : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_symph_symm_base_eqvect(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int eqvectf2pywrap = 0; - double *x = NULL; - npy_intp x_Dims[1] = {-1}; - const int x_Rank = 1; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - double *y = NULL; - npy_intp y_Dims[1] = {-1}; - const int y_Rank = 1; - PyArrayObject *capi_y_as_array = NULL; - int capi_y_intent = 0; - PyObject *y_capi = Py_None; - double *f = NULL; - npy_intp f_Dims[1] = {-1}; - const int f_Rank = 1; - PyArrayObject *capi_f_as_array = NULL; - int capi_f_intent = 0; - PyObject *f_capi = Py_None; - static char *capi_kwlist[] = {"x","y","f",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:symph.symm_base.eqvect",\ - capi_kwlist,&x_capi,&y_capi,&f_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - x_Dims[0]=3; - capi_x_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.eqvect: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (double *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable y */ - y_Dims[0]=3; - capi_y_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.eqvect: failed to create array from the 2nd argument `y`"; - capi_y_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,y_Dims,y_Rank, capi_y_intent,y_capi,capi_errmess); - if (capi_y_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - y = (double *)(PyArray_DATA(capi_y_as_array)); - - /* Processing variable f */ - f_Dims[0]=3; - capi_f_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.eqvect: failed to create array from the 3rd argument `f`"; - capi_f_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_Dims,f_Rank, capi_f_intent,f_capi,capi_errmess); - if (capi_f_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f = (double *)(PyArray_DATA(capi_f_as_array)); - - /* Processing variable eqvectf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&eqvectf2pywrap,x,y,f); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",eqvectf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable eqvectf2pywrap */ - if((PyObject *)capi_f_as_array!=f_capi) { - Py_XDECREF(capi_f_as_array); } - } /* if (capi_f_as_array == NULL) ... else of f */ - /* End of cleaning variable f */ - if((PyObject *)capi_y_as_array!=y_capi) { - Py_XDECREF(capi_y_as_array); } - } /* if (capi_y_as_array == NULL) ... else of y */ - /* End of cleaning variable y */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of eqvect *******************************/ - -/********************************** checksym **********************************/ -static char doc_f2py_rout_symph_symm_base_checksym[] = "\ -checksym = checksym(irot,ityp,xau,rau,ft_,[nat])\n\nWrapper for ``checksym``.\ -\n\nParameters\n----------\n" -"irot : input int\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"xau : input rank-2 array('d') with bounds (3,nat)\n" -"rau : input rank-2 array('d') with bounds (3,nat)\n" -"ft_ : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(ityp, 0)\n" -"\nReturns\n-------\n" -"checksym : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_symph_symm_base_checksym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int checksymf2pywrap = 0; - int irot = 0; - PyObject *irot_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - double *xau = NULL; - npy_intp xau_Dims[2] = {-1, -1}; - const int xau_Rank = 2; - PyArrayObject *capi_xau_as_array = NULL; - int capi_xau_intent = 0; - PyObject *xau_capi = Py_None; - double *rau = NULL; - npy_intp rau_Dims[2] = {-1, -1}; - const int rau_Rank = 2; - PyArrayObject *capi_rau_as_array = NULL; - int capi_rau_intent = 0; - PyObject *rau_capi = Py_None; - double *ft_ = NULL; - npy_intp ft__Dims[1] = {-1}; - const int ft__Rank = 1; - PyArrayObject *capi_ft__as_array = NULL; - int capi_ft__intent = 0; - PyObject *ft__capi = Py_None; - static char *capi_kwlist[] = {"irot","ityp","xau","rau","ft_","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.symm_base.checksym",\ - capi_kwlist,&irot_capi,&ityp_capi,&xau_capi,&rau_capi,&ft__capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ityp */ - ; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 2nd argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - - /* Processing variable irot */ - f2py_success = int_from_pyobj(&irot,irot_capi,"symph.symm_base.checksym() 1st argument (irot) can't be converted to int"); - if (f2py_success) { - /* Processing variable ft_ */ - ft__Dims[0]=3; - capi_ft__intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 5th argument `ft_`"; - capi_ft__as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ft__Dims,ft__Rank, capi_ft__intent,ft__capi,capi_errmess); - if (capi_ft__as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ft_ = (double *)(PyArray_DATA(capi_ft__as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(ityp, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.checksym() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ityp, 0) == nat,"shape(ityp, 0) == nat","1st keyword nat","checksym:nat=%d",nat) { - /* Processing variable xau */ - xau_Dims[0]=3,xau_Dims[1]=nat; - capi_xau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 3rd argument `xau`"; - capi_xau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xau_Dims,xau_Rank, capi_xau_intent,xau_capi,capi_errmess); - if (capi_xau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xau = (double *)(PyArray_DATA(capi_xau_as_array)); - - /* Processing variable rau */ - rau_Dims[0]=3,rau_Dims[1]=nat; - capi_rau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.checksym: failed to create array from the 4th argument `rau`"; - capi_rau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rau_Dims,rau_Rank, capi_rau_intent,rau_capi,capi_errmess); - if (capi_rau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rau = (double *)(PyArray_DATA(capi_rau_as_array)); - - /* Processing variable checksymf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&checksymf2pywrap,&irot,&nat,ityp,xau,rau,ft_); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",checksymf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable checksymf2pywrap */ - if((PyObject *)capi_rau_as_array!=rau_capi) { - Py_XDECREF(capi_rau_as_array); } - } /* if (capi_rau_as_array == NULL) ... else of rau */ - /* End of cleaning variable rau */ - if((PyObject *)capi_xau_as_array!=xau_capi) { - Py_XDECREF(capi_xau_as_array); } - } /* if (capi_xau_as_array == NULL) ... else of xau */ - /* End of cleaning variable xau */ - } /*CHECKSCALAR(shape(ityp, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_ft__as_array!=ft__capi) { - Py_XDECREF(capi_ft__as_array); } - } /* if (capi_ft__as_array == NULL) ... else of ft_ */ - /* End of cleaning variable ft_ */ - } /*if (f2py_success) of irot*/ - /* End of cleaning variable irot */ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of checksym ******************************/ - -/******************************** checkallsym ********************************/ -static char doc_f2py_rout_symph_symm_base_checkallsym[] = "\ -checkallsym(tau,ityp,nr1,nr2,nr3,[nat])\n\nWrapper for ``checkallsym``.\ -\n\nParameters\n----------\n" -"tau : input rank-2 array('d') with bounds (3,nat)\n" -"ityp : input rank-1 array('i') with bounds (nat)\n" -"nr1 : input int\n" -"nr2 : input int\n" -"nr3 : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 1)"; -/* */ -static PyObject *f2py_rout_symph_symm_base_checkallsym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - int *ityp = NULL; - npy_intp ityp_Dims[1] = {-1}; - const int ityp_Rank = 1; - PyArrayObject *capi_ityp_as_array = NULL; - int capi_ityp_intent = 0; - PyObject *ityp_capi = Py_None; - int nr1 = 0; - PyObject *nr1_capi = Py_None; - int nr2 = 0; - PyObject *nr2_capi = Py_None; - int nr3 = 0; - PyObject *nr3_capi = Py_None; - static char *capi_kwlist[] = {"tau","ityp","nr1","nr2","nr3","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:symph.symm_base.checkallsym",\ - capi_kwlist,&tau_capi,&ityp_capi,&nr1_capi,&nr2_capi,&nr3_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nr1 */ - f2py_success = int_from_pyobj(&nr1,nr1_capi,"symph.symm_base.checkallsym() 3rd argument (nr1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr2 */ - f2py_success = int_from_pyobj(&nr2,nr2_capi,"symph.symm_base.checkallsym() 4th argument (nr2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nr3 */ - f2py_success = int_from_pyobj(&nr3,nr3_capi,"symph.symm_base.checkallsym() 5th argument (nr3) can't be converted to int"); - if (f2py_success) { - /* Processing variable tau */ - tau_Dims[0]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.checkallsym: failed to create array from the 1st argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 1); else - f2py_success = int_from_pyobj(&nat,nat_capi,"symph.symm_base.checkallsym() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 1) == nat,"shape(tau, 1) == nat","1st keyword nat","checkallsym:nat=%d",nat) { - /* Processing variable ityp */ - ityp_Dims[0]=nat; - capi_ityp_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.checkallsym: failed to create array from the 2nd argument `ityp`"; - capi_ityp_as_array = ndarray_from_pyobj( NPY_INT,1,ityp_Dims,ityp_Rank, capi_ityp_intent,ityp_capi,capi_errmess); - if (capi_ityp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ityp = (int *)(PyArray_DATA(capi_ityp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,tau,ityp,&nr1,&nr2,&nr3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_ityp_as_array!=ityp_capi) { - Py_XDECREF(capi_ityp_as_array); } - } /* if (capi_ityp_as_array == NULL) ... else of ityp */ - /* End of cleaning variable ityp */ - } /*CHECKSCALAR(shape(tau, 1) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*if (f2py_success) of nr3*/ - /* End of cleaning variable nr3 */ - } /*if (f2py_success) of nr2*/ - /* End of cleaning variable nr2 */ - } /*if (f2py_success) of nr1*/ - /* End of cleaning variable nr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of checkallsym *****************************/ - -/******************************* s_axis_to_cart *******************************/ -static char doc_f2py_rout_symph_symm_base_s_axis_to_cart[] = "\ -s_axis_to_cart()\n\nWrapper for ``s_axis_to_cart``.\ -\n"; -/* */ -static PyObject *f2py_rout_symph_symm_base_s_axis_to_cart(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(void)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:symph.symm_base.s_axis_to_cart",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of s_axis_to_cart ***************************/ - -/********************************** smallg_q **********************************/ -static char doc_f2py_rout_symph_symm_base_smallg_q[] = "\ -minus_q = smallg_q(aq,modenum,sym)\n\nWrapper for ``smallg_q``.\ -\n\nParameters\n----------\n" -"aq : input rank-1 array('d') with bounds (3)\n" -"modenum : input int\n" -"sym : in/output rank-1 array('i') with bounds (48)\n" -"\nReturns\n-------\n" -"minus_q : int"; -/* */ -static PyObject *f2py_rout_symph_symm_base_smallg_q(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *aq = NULL; - npy_intp aq_Dims[1] = {-1}; - const int aq_Rank = 1; - PyArrayObject *capi_aq_as_array = NULL; - int capi_aq_intent = 0; - PyObject *aq_capi = Py_None; - int modenum = 0; - PyObject *modenum_capi = Py_None; - int *sym = NULL; - npy_intp sym_Dims[1] = {-1}; - const int sym_Rank = 1; - PyArrayObject *capi_sym_as_array = NULL; - int capi_sym_intent = 0; - PyObject *sym_capi = Py_None; - int minus_q = 0; - static char *capi_kwlist[] = {"aq","modenum","sym",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:symph.symm_base.smallg_q",\ - capi_kwlist,&aq_capi,&modenum_capi,&sym_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable aq */ - aq_Dims[0]=3; - capi_aq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "symph.symph.symm_base.smallg_q: failed to create array from the 1st argument `aq`"; - capi_aq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,aq_Dims,aq_Rank, capi_aq_intent,aq_capi,capi_errmess); - if (capi_aq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - aq = (double *)(PyArray_DATA(capi_aq_as_array)); - - /* Processing variable modenum */ - f2py_success = int_from_pyobj(&modenum,modenum_capi,"symph.symm_base.smallg_q() 2nd argument (modenum) can't be converted to int"); - if (f2py_success) { - /* Processing variable sym */ - sym_Dims[0]=48; - capi_sym_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "symph.symph.symm_base.smallg_q: failed to create array from the 3rd argument `sym`"; - capi_sym_as_array = ndarray_from_pyobj( NPY_INT,1,sym_Dims,sym_Rank, capi_sym_intent,sym_capi,capi_errmess); - if (capi_sym_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = symph_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sym = (int *)(PyArray_DATA(capi_sym_as_array)); - - /* Processing variable minus_q */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(aq,&modenum,sym,&minus_q); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",minus_q); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable minus_q */ - if((PyObject *)capi_sym_as_array!=sym_capi) { - Py_XDECREF(capi_sym_as_array); } - } /* if (capi_sym_as_array == NULL) ... else of sym */ - /* End of cleaning variable sym */ - } /*if (f2py_success) of modenum*/ - /* End of cleaning variable modenum */ - if((PyObject *)capi_aq_as_array!=aq_capi) { - Py_XDECREF(capi_aq_as_array); } - } /* if (capi_aq_as_array == NULL) ... else of aq */ - /* End of cleaning variable aq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of smallg_q ******************************/ -/*eof body*/ - -/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ - -static FortranDataDef f2py_constants_def[] = { - {"pi",0,{{-1}},NPY_FLOAT, 1}, - {"tpi",0,{{-1}},NPY_FLOAT, 1}, - {"fpi",0,{{-1}},NPY_FLOAT, 1}, - {"sqrtpi",0,{{-1}},NPY_FLOAT, 1}, - {"sqrtpm1",0,{{-1}},NPY_FLOAT, 1}, - {"sqrt2",0,{{-1}},NPY_FLOAT, 1}, - {"h_planck_si",0,{{-1}},NPY_FLOAT, 1}, - {"k_boltzmann_si",0,{{-1}},NPY_FLOAT, 1}, - {"electron_si",0,{{-1}},NPY_FLOAT, 1}, - {"electronvolt_si",0,{{-1}},NPY_FLOAT, 1}, - {"electronmass_si",0,{{-1}},NPY_FLOAT, 1}, - {"hartree_si",0,{{-1}},NPY_FLOAT, 1}, - {"rydberg_si",0,{{-1}},NPY_FLOAT, 1}, - {"bohr_radius_si",0,{{-1}},NPY_FLOAT, 1}, - {"amu_si",0,{{-1}},NPY_FLOAT, 1}, - {"c_si",0,{{-1}},NPY_FLOAT, 1}, - {"munought_si",0,{{-1}},NPY_FLOAT, 1}, - {"epsnought_si",0,{{-1}},NPY_FLOAT, 1}, - {"k_boltzmann_au",0,{{-1}},NPY_FLOAT, 1}, - {"k_boltzmann_ry",0,{{-1}},NPY_FLOAT, 1}, - {"autoev",0,{{-1}},NPY_FLOAT, 1}, - {"rytoev",0,{{-1}},NPY_FLOAT, 1}, - {"amu_au",0,{{-1}},NPY_FLOAT, 1}, - {"amu_ry",0,{{-1}},NPY_FLOAT, 1}, - {"au_sec",0,{{-1}},NPY_FLOAT, 1}, - {"au_ps",0,{{-1}},NPY_FLOAT, 1}, - {"au_gpa",0,{{-1}},NPY_FLOAT, 1}, - {"ry_kbar",0,{{-1}},NPY_FLOAT, 1}, - {"debye_si",0,{{-1}},NPY_FLOAT, 1}, - {"au_debye",0,{{-1}},NPY_FLOAT, 1}, - {"ev_to_kelvin",0,{{-1}},NPY_FLOAT, 1}, - {"ry_to_kelvin",0,{{-1}},NPY_FLOAT, 1}, - {"evtonm",0,{{-1}},NPY_FLOAT, 1}, - {"rytonm",0,{{-1}},NPY_FLOAT, 1}, - {"c_au",0,{{-1}},NPY_FLOAT, 1}, - {"eps4",0,{{-1}},NPY_FLOAT, 1}, - {"eps6",0,{{-1}},NPY_FLOAT, 1}, - {"eps8",0,{{-1}},NPY_FLOAT, 1}, - {"eps12",0,{{-1}},NPY_FLOAT, 1}, - {"eps14",0,{{-1}},NPY_FLOAT, 1}, - {"eps16",0,{{-1}},NPY_FLOAT, 1}, - {"eps24",0,{{-1}},NPY_FLOAT, 1}, - {"eps32",0,{{-1}},NPY_FLOAT, 1}, - {"gsmall",0,{{-1}},NPY_FLOAT, 1}, - {"e2",0,{{-1}},NPY_FLOAT, 1}, - {"degspin",0,{{-1}},NPY_FLOAT, 1}, - {"bohr_radius_cm",0,{{-1}},NPY_FLOAT, 1}, - {"bohr_radius_angs",0,{{-1}},NPY_FLOAT, 1}, - {"angstrom_au",0,{{-1}},NPY_FLOAT, 1}, - {"dip_debye",0,{{-1}},NPY_FLOAT, 1}, - {"au_terahertz",0,{{-1}},NPY_FLOAT, 1}, - {"au_to_ohmcmm1",0,{{-1}},NPY_FLOAT, 1}, - {"ry_to_thz",0,{{-1}},NPY_FLOAT, 1}, - {"ry_to_ghz",0,{{-1}},NPY_FLOAT, 1}, - {"ry_to_cmm1",0,{{-1}},NPY_FLOAT, 1}, - {"avogadro",0,{{-1}},NPY_FLOAT, 1}, - {NULL} -}; - -static void f2py_setup_constants(char *pi,char *tpi,char *fpi,char *sqrtpi,char *sqrtpm1,char *sqrt2,char *h_planck_si,char *k_boltzmann_si,char *electron_si,char *electronvolt_si,char *electronmass_si,char *hartree_si,char *rydberg_si,char *bohr_radius_si,char *amu_si,char *c_si,char *munought_si,char *epsnought_si,char *k_boltzmann_au,char *k_boltzmann_ry,char *autoev,char *rytoev,char *amu_au,char *amu_ry,char *au_sec,char *au_ps,char *au_gpa,char *ry_kbar,char *debye_si,char *au_debye,char *ev_to_kelvin,char *ry_to_kelvin,char *evtonm,char *rytonm,char *c_au,char *eps4,char *eps6,char *eps8,char *eps12,char *eps14,char *eps16,char *eps24,char *eps32,char *gsmall,char *e2,char *degspin,char *bohr_radius_cm,char *bohr_radius_angs,char *angstrom_au,char *dip_debye,char *au_terahertz,char *au_to_ohmcmm1,char *ry_to_thz,char *ry_to_ghz,char *ry_to_cmm1,char *avogadro) { - int i_f2py=0; - f2py_constants_def[i_f2py++].data = pi; - f2py_constants_def[i_f2py++].data = tpi; - f2py_constants_def[i_f2py++].data = fpi; - f2py_constants_def[i_f2py++].data = sqrtpi; - f2py_constants_def[i_f2py++].data = sqrtpm1; - f2py_constants_def[i_f2py++].data = sqrt2; - f2py_constants_def[i_f2py++].data = h_planck_si; - f2py_constants_def[i_f2py++].data = k_boltzmann_si; - f2py_constants_def[i_f2py++].data = electron_si; - f2py_constants_def[i_f2py++].data = electronvolt_si; - f2py_constants_def[i_f2py++].data = electronmass_si; - f2py_constants_def[i_f2py++].data = hartree_si; - f2py_constants_def[i_f2py++].data = rydberg_si; - f2py_constants_def[i_f2py++].data = bohr_radius_si; - f2py_constants_def[i_f2py++].data = amu_si; - f2py_constants_def[i_f2py++].data = c_si; - f2py_constants_def[i_f2py++].data = munought_si; - f2py_constants_def[i_f2py++].data = epsnought_si; - f2py_constants_def[i_f2py++].data = k_boltzmann_au; - f2py_constants_def[i_f2py++].data = k_boltzmann_ry; - f2py_constants_def[i_f2py++].data = autoev; - f2py_constants_def[i_f2py++].data = rytoev; - f2py_constants_def[i_f2py++].data = amu_au; - f2py_constants_def[i_f2py++].data = amu_ry; - f2py_constants_def[i_f2py++].data = au_sec; - f2py_constants_def[i_f2py++].data = au_ps; - f2py_constants_def[i_f2py++].data = au_gpa; - f2py_constants_def[i_f2py++].data = ry_kbar; - f2py_constants_def[i_f2py++].data = debye_si; - f2py_constants_def[i_f2py++].data = au_debye; - f2py_constants_def[i_f2py++].data = ev_to_kelvin; - f2py_constants_def[i_f2py++].data = ry_to_kelvin; - f2py_constants_def[i_f2py++].data = evtonm; - f2py_constants_def[i_f2py++].data = rytonm; - f2py_constants_def[i_f2py++].data = c_au; - f2py_constants_def[i_f2py++].data = eps4; - f2py_constants_def[i_f2py++].data = eps6; - f2py_constants_def[i_f2py++].data = eps8; - f2py_constants_def[i_f2py++].data = eps12; - f2py_constants_def[i_f2py++].data = eps14; - f2py_constants_def[i_f2py++].data = eps16; - f2py_constants_def[i_f2py++].data = eps24; - f2py_constants_def[i_f2py++].data = eps32; - f2py_constants_def[i_f2py++].data = gsmall; - f2py_constants_def[i_f2py++].data = e2; - f2py_constants_def[i_f2py++].data = degspin; - f2py_constants_def[i_f2py++].data = bohr_radius_cm; - f2py_constants_def[i_f2py++].data = bohr_radius_angs; - f2py_constants_def[i_f2py++].data = angstrom_au; - f2py_constants_def[i_f2py++].data = dip_debye; - f2py_constants_def[i_f2py++].data = au_terahertz; - f2py_constants_def[i_f2py++].data = au_to_ohmcmm1; - f2py_constants_def[i_f2py++].data = ry_to_thz; - f2py_constants_def[i_f2py++].data = ry_to_ghz; - f2py_constants_def[i_f2py++].data = ry_to_cmm1; - f2py_constants_def[i_f2py++].data = avogadro; -} -extern void F_FUNC(f2pyinitconstants,F2PYINITCONSTANTS)(void (*)(char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*)); -static void f2py_init_constants(void) { - F_FUNC(f2pyinitconstants,F2PYINITCONSTANTS)(f2py_setup_constants); -} - - -static FortranDataDef f2py_io_global_def[] = { - {"stdout",0,{{-1}},NPY_INT, 1}, - {"ionode",0,{{-1}},NPY_INT, 1}, - {"ionode_id",0,{{-1}},NPY_INT, 1}, - {"meta_ionode",0,{{-1}},NPY_INT, 1}, - {"meta_ionode_id",0,{{-1}},NPY_INT, 1}, - {"xmlinputunit",0,{{-1}},NPY_INT, 1}, - {"xmloutputunit",0,{{-1}},NPY_INT, 1}, - {"xmltmpunit",0,{{-1}},NPY_INT, 1}, - {"io_global_start",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_io_global_start,doc_f2py_rout_symph_io_global_io_global_start}, - {"meta_io_global_start",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_meta_io_global_start,doc_f2py_rout_symph_io_global_meta_io_global_start}, - {"io_global_getionode",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_io_global_getionode,doc_f2py_rout_symph_io_global_io_global_getionode}, - {"io_global_getmeta",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_io_global_io_global_getmeta,doc_f2py_rout_symph_io_global_io_global_getmeta}, - {NULL} -}; - -static void f2py_setup_io_global(char *stdout_bn,char *ionode,char *ionode_id,char *meta_ionode,char *meta_ionode_id,char *xmlinputunit,char *xmloutputunit,char *xmltmpunit,char *io_global_start,char *meta_io_global_start,char *io_global_getionode,char *io_global_getmeta) { - int i_f2py=0; - f2py_io_global_def[i_f2py++].data = stdout_bn; - f2py_io_global_def[i_f2py++].data = ionode; - f2py_io_global_def[i_f2py++].data = ionode_id; - f2py_io_global_def[i_f2py++].data = meta_ionode; - f2py_io_global_def[i_f2py++].data = meta_ionode_id; - f2py_io_global_def[i_f2py++].data = xmlinputunit; - f2py_io_global_def[i_f2py++].data = xmloutputunit; - f2py_io_global_def[i_f2py++].data = xmltmpunit; - f2py_io_global_def[i_f2py++].data = io_global_start; - f2py_io_global_def[i_f2py++].data = meta_io_global_start; - f2py_io_global_def[i_f2py++].data = io_global_getionode; - f2py_io_global_def[i_f2py++].data = io_global_getmeta; -} -extern void F_FUNC_US(f2pyinitio_global,F2PYINITIO_GLOBAL)(void (*)(char*,char*,char*,char*,char*,char*,char*,char*,char *,char *,char *,char *)); -static void f2py_init_io_global(void) { - F_FUNC_US(f2pyinitio_global,F2PYINITIO_GLOBAL)(f2py_setup_io_global); -} - - -static FortranDataDef f2py_kinds_def[] = { - {"dp",0,{{-1}},NPY_INT, 1}, - {"sgl",0,{{-1}},NPY_INT, 1}, - {"i4b",0,{{-1}},NPY_INT, 1}, - {"print_kind_info",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_kinds_print_kind_info,doc_f2py_rout_symph_kinds_print_kind_info}, - {NULL} -}; - -static void f2py_setup_kinds(char *dp,char *sgl,char *i4b,char *print_kind_info) { - int i_f2py=0; - f2py_kinds_def[i_f2py++].data = dp; - f2py_kinds_def[i_f2py++].data = sgl; - f2py_kinds_def[i_f2py++].data = i4b; - f2py_kinds_def[i_f2py++].data = print_kind_info; -} -extern void F_FUNC(f2pyinitkinds,F2PYINITKINDS)(void (*)(char*,char*,char*,char *)); -static void f2py_init_kinds(void) { - F_FUNC(f2pyinitkinds,F2PYINITKINDS)(f2py_setup_kinds); -} - - -static FortranDataDef f2py_symm_base_def[] = { - {"eps1",0,{{-1}},NPY_DOUBLE, 1}, - {"eps2",0,{{-1}},NPY_DOUBLE, 1}, - {"s",3,{{3,3,48}},NPY_INT, 1}, - {"sr",3,{{3,3,48}},NPY_DOUBLE, 1}, - {"sname",1,{{48}},NPY_STRING, 45}, - {"ft",2,{{3,48}},NPY_DOUBLE, 1}, - {"ftau",2,{{3,48}},NPY_INT, 1}, - {"nrot",0,{{-1}},NPY_INT, 1}, - {"nsym",0,{{-1}},NPY_INT, 1}, - {"nsym_ns",0,{{-1}},NPY_INT, 1}, - {"nsym_na",0,{{-1}},NPY_INT, 1}, - {"t_rev",1,{{48}},NPY_INT, 1}, - {"no_t_rev",0,{{-1}},NPY_INT, 1}, - {"time_reversal",0,{{-1}},NPY_INT, 1}, - {"irt",2,{{-1,-1}},NPY_INT, 1}, - {"invs",1,{{48}},NPY_INT, 1}, - {"invsym",0,{{-1}},NPY_INT, 1}, - {"d1",3,{{3,3,48}},NPY_DOUBLE, 1}, - {"d2",3,{{5,5,48}},NPY_DOUBLE, 1}, - {"d3",3,{{7,7,48}},NPY_DOUBLE, 1}, - {"allfrac",0,{{-1}},NPY_INT, 1}, - {"nofrac",0,{{-1}},NPY_INT, 1}, - {"nosym",0,{{-1}},NPY_INT, 1}, - {"nosym_evc",0,{{-1}},NPY_INT, 1}, - {"at",2,{{3,3}},NPY_DOUBLE, 1}, - {"bg",2,{{3,3}},NPY_DOUBLE, 1}, - {"set_accep_threshold",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_accep_threshold,doc_f2py_rout_symph_symm_base_set_accep_threshold}, - {"get_accep_threshold",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_get_accep_threshold,doc_f2py_rout_symph_symm_base_get_accep_threshold}, - {"set_at_bg",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_at_bg,doc_f2py_rout_symph_symm_base_set_at_bg}, - {"inverse_s",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_inverse_s,doc_f2py_rout_symph_symm_base_inverse_s}, - {"set_sym_bl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_sym_bl,doc_f2py_rout_symph_symm_base_set_sym_bl}, - {"find_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_find_sym,doc_f2py_rout_symph_symm_base_find_sym}, - {"sgam_at",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_sgam_at,doc_f2py_rout_symph_symm_base_sgam_at}, - {"sgam_at_mag",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_sgam_at_mag,doc_f2py_rout_symph_symm_base_sgam_at_mag}, - {"set_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_set_sym,doc_f2py_rout_symph_symm_base_set_sym}, - {"copy_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_copy_sym,doc_f2py_rout_symph_symm_base_copy_sym}, - {"is_group",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_is_group,doc_f2py_rout_symph_symm_base_is_group}, - {"eqvect",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_eqvect,doc_f2py_rout_symph_symm_base_eqvect}, - {"checksym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_checksym,doc_f2py_rout_symph_symm_base_checksym}, - {"checkallsym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_checkallsym,doc_f2py_rout_symph_symm_base_checkallsym}, - {"s_axis_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_s_axis_to_cart,doc_f2py_rout_symph_symm_base_s_axis_to_cart}, - {"smallg_q",-1,{{-1}},0,0,NULL,(void *)f2py_rout_symph_symm_base_smallg_q,doc_f2py_rout_symph_symm_base_smallg_q}, - {NULL} -}; - -static void f2py_setup_symm_base(char *eps1,char *eps2,char *s,char *sr,char *sname,char *ft,char *ftau,char *nrot,char *nsym,char *nsym_ns,char *nsym_na,char *t_rev,char *no_t_rev,char *time_reversal,void (*irt)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *invs,char *invsym,char *d1,char *d2,char *d3,char *allfrac,char *nofrac,char *nosym,char *nosym_evc,char *at,char *bg,char *set_accep_threshold,char *get_accep_threshold,char *set_at_bg,char *inverse_s,char *set_sym_bl,char *find_sym,char *sgam_at,char *sgam_at_mag,char *set_sym,char *copy_sym,char *is_group,char *eqvect,char *checksym,char *checkallsym,char *s_axis_to_cart,char *smallg_q) { - int i_f2py=0; - f2py_symm_base_def[i_f2py++].data = eps1; - f2py_symm_base_def[i_f2py++].data = eps2; - f2py_symm_base_def[i_f2py++].data = s; - f2py_symm_base_def[i_f2py++].data = sr; - f2py_symm_base_def[i_f2py++].data = sname; - f2py_symm_base_def[i_f2py++].data = ft; - f2py_symm_base_def[i_f2py++].data = ftau; - f2py_symm_base_def[i_f2py++].data = nrot; - f2py_symm_base_def[i_f2py++].data = nsym; - f2py_symm_base_def[i_f2py++].data = nsym_ns; - f2py_symm_base_def[i_f2py++].data = nsym_na; - f2py_symm_base_def[i_f2py++].data = t_rev; - f2py_symm_base_def[i_f2py++].data = no_t_rev; - f2py_symm_base_def[i_f2py++].data = time_reversal; - f2py_symm_base_def[i_f2py++].func = irt; - f2py_symm_base_def[i_f2py++].data = invs; - f2py_symm_base_def[i_f2py++].data = invsym; - f2py_symm_base_def[i_f2py++].data = d1; - f2py_symm_base_def[i_f2py++].data = d2; - f2py_symm_base_def[i_f2py++].data = d3; - f2py_symm_base_def[i_f2py++].data = allfrac; - f2py_symm_base_def[i_f2py++].data = nofrac; - f2py_symm_base_def[i_f2py++].data = nosym; - f2py_symm_base_def[i_f2py++].data = nosym_evc; - f2py_symm_base_def[i_f2py++].data = at; - f2py_symm_base_def[i_f2py++].data = bg; - f2py_symm_base_def[i_f2py++].data = set_accep_threshold; - f2py_symm_base_def[i_f2py++].data = get_accep_threshold; - f2py_symm_base_def[i_f2py++].data = set_at_bg; - f2py_symm_base_def[i_f2py++].data = inverse_s; - f2py_symm_base_def[i_f2py++].data = set_sym_bl; - f2py_symm_base_def[i_f2py++].data = find_sym; - f2py_symm_base_def[i_f2py++].data = sgam_at; - f2py_symm_base_def[i_f2py++].data = sgam_at_mag; - f2py_symm_base_def[i_f2py++].data = set_sym; - f2py_symm_base_def[i_f2py++].data = copy_sym; - f2py_symm_base_def[i_f2py++].data = is_group; - f2py_symm_base_def[i_f2py++].data = eqvect; - f2py_symm_base_def[i_f2py++].data = checksym; - f2py_symm_base_def[i_f2py++].data = checkallsym; - f2py_symm_base_def[i_f2py++].data = s_axis_to_cart; - f2py_symm_base_def[i_f2py++].data = smallg_q; -} -extern void F_FUNC_US(f2pyinitsymm_base,F2PYINITSYMM_BASE)(void (*)(char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char*,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_symm_base(void) { - F_FUNC_US(f2pyinitsymm_base,F2PYINITSYMM_BASE)(f2py_setup_symm_base); -} - -/*need_f90modhooks*/ - -/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ - -/******************* See f2py2e/common_rules.py: buildhooks *******************/ - -/*need_commonhooks*/ - -/**************************** See f2py2e/rules.py ****************************/ - -static FortranDataDef f2py_routine_defs[] = { - {"errore",-1,{{-1}},0,0,(char *) F_FUNC(errore,ERRORE), (f2py_init_func)f2py_rout_symph_errore,doc_f2py_rout_symph_errore}, - {"infomsg",-1,{{-1}},0,0,(char *) F_FUNC(infomsg,INFOMSG), (f2py_init_func)f2py_rout_symph_infomsg,doc_f2py_rout_symph_infomsg}, - {"get_latvec",-1,{{-1}},0,0,(char *) F_WRAPPEDFUNC_US(get_latvec,GET_LATVEC), (f2py_init_func)f2py_rout_symph_get_latvec,doc_f2py_rout_symph_get_latvec}, - {"rotate_and_add_dyn",-1,{{-1}},0,0,(char *) F_FUNC_US(rotate_and_add_dyn,ROTATE_AND_ADD_DYN), (f2py_init_func)f2py_rout_symph_rotate_and_add_dyn,doc_f2py_rout_symph_rotate_and_add_dyn}, - {"set_irotmq",-1,{{-1}},0,0,(char *) F_FUNC_US(set_irotmq,SET_IROTMQ), (f2py_init_func)f2py_rout_symph_set_irotmq,doc_f2py_rout_symph_set_irotmq}, - {"symmatrix",-1,{{-1}},0,0,(char *) F_FUNC(symmatrix,SYMMATRIX), (f2py_init_func)f2py_rout_symph_symmatrix,doc_f2py_rout_symph_symmatrix}, - {"cart_to_crys_mat",-1,{{-1}},0,0,(char *) F_FUNC_US(cart_to_crys_mat,CART_TO_CRYS_MAT), (f2py_init_func)f2py_rout_symph_cart_to_crys_mat,doc_f2py_rout_symph_cart_to_crys_mat}, - {"crys_to_cart_mat",-1,{{-1}},0,0,(char *) F_FUNC_US(crys_to_cart_mat,CRYS_TO_CART_MAT), (f2py_init_func)f2py_rout_symph_crys_to_cart_mat,doc_f2py_rout_symph_crys_to_cart_mat}, - {"contract_two_ph_propagator",-1,{{-1}},0,0,(char *) F_FUNC_US(contract_two_ph_propagator,CONTRACT_TWO_PH_PROPAGATOR), (f2py_init_func)f2py_rout_symph_contract_two_ph_propagator,doc_f2py_rout_symph_contract_two_ph_propagator}, - {"get_two_phonon_propagator",-1,{{-1}},0,0,(char *) F_FUNC_US(get_two_phonon_propagator,GET_TWO_PHONON_PROPAGATOR), (f2py_init_func)f2py_rout_symph_get_two_phonon_propagator,doc_f2py_rout_symph_get_two_phonon_propagator}, - {"fc_supercell_from_dyn",-1,{{-1}},0,0,(char *) F_FUNC_US(fc_supercell_from_dyn,FC_SUPERCELL_FROM_DYN), (f2py_init_func)f2py_rout_symph_fc_supercell_from_dyn,doc_f2py_rout_symph_fc_supercell_from_dyn}, - {"fast_ft_real_space_from_dynq",-1,{{-1}},0,0,(char *) F_FUNC_US(fast_ft_real_space_from_dynq,FAST_FT_REAL_SPACE_FROM_DYNQ), (f2py_init_func)f2py_rout_symph_fast_ft_real_space_from_dynq,doc_f2py_rout_symph_fast_ft_real_space_from_dynq}, - {"impose_trans_sc",-1,{{-1}},0,0,(char *) F_FUNC_US(impose_trans_sc,IMPOSE_TRANS_SC), (f2py_init_func)f2py_rout_symph_impose_trans_sc,doc_f2py_rout_symph_impose_trans_sc}, - {"dyn_from_fc",-1,{{-1}},0,0,(char *) F_FUNC_US(dyn_from_fc,DYN_FROM_FC), (f2py_init_func)f2py_rout_symph_dyn_from_fc,doc_f2py_rout_symph_dyn_from_fc}, - {"get_q_grid",-1,{{-1}},0,0,(char *) F_FUNC_US(get_q_grid,GET_Q_GRID), (f2py_init_func)f2py_rout_symph_get_q_grid,doc_f2py_rout_symph_get_q_grid}, - {"star_q",-1,{{-1}},0,0,(char *) F_FUNC_US(star_q,STAR_Q), (f2py_init_func)f2py_rout_symph_star_q,doc_f2py_rout_symph_star_q}, - {"symvector",-1,{{-1}},0,0,(char *) F_FUNC(symvector,SYMVECTOR), (f2py_init_func)f2py_rout_symph_symvector,doc_f2py_rout_symph_symvector}, - {"cryst_to_cart",-1,{{-1}},0,0,(char *) F_FUNC_US(cryst_to_cart,CRYST_TO_CART), (f2py_init_func)f2py_rout_symph_cryst_to_cart,doc_f2py_rout_symph_cryst_to_cart}, - {"flush_unit",-1,{{-1}},0,0,(char *) F_FUNC_US(flush_unit,FLUSH_UNIT), (f2py_init_func)f2py_rout_symph_flush_unit,doc_f2py_rout_symph_flush_unit}, - {"get_translations",-1,{{-1}},0,0,(char *) F_FUNC_US(get_translations,GET_TRANSLATIONS), (f2py_init_func)f2py_rout_symph_get_translations,doc_f2py_rout_symph_get_translations}, - {"q2qstar_out",-1,{{-1}},0,0,(char *) F_FUNC_US(q2qstar_out,Q2QSTAR_OUT), (f2py_init_func)f2py_rout_symph_q2qstar_out,doc_f2py_rout_symph_q2qstar_out}, - {"set_asr",-1,{{-1}},0,0,(char *) F_FUNC_US(set_asr,SET_ASR), (f2py_init_func)f2py_rout_symph_set_asr,doc_f2py_rout_symph_set_asr}, - {"sp_zeu",-1,{{-1}},0,0,(char *) F_FUNC_US(sp_zeu,SP_ZEU), (f2py_init_func)f2py_rout_symph_sp_zeu,doc_f2py_rout_symph_sp_zeu}, - {"sp1",-1,{{-1}},0,0,(char *) F_FUNC(sp1,SP1), (f2py_init_func)f2py_rout_symph_sp1,doc_f2py_rout_symph_sp1}, - {"sp2",-1,{{-1}},0,0,(char *) F_FUNC(sp2,SP2), (f2py_init_func)f2py_rout_symph_sp2,doc_f2py_rout_symph_sp2}, - {"sp3",-1,{{-1}},0,0,(char *) F_FUNC(sp3,SP3), (f2py_init_func)f2py_rout_symph_sp3,doc_f2py_rout_symph_sp3}, - {"symdynph_gq_new",-1,{{-1}},0,0,(char *) F_FUNC_US(symdynph_gq_new,SYMDYNPH_GQ_NEW), (f2py_init_func)f2py_rout_symph_symdynph_gq_new,doc_f2py_rout_symph_symdynph_gq_new}, - {"trntnsc",-1,{{-1}},0,0,(char *) F_FUNC(trntnsc,TRNTNSC), (f2py_init_func)f2py_rout_symph_trntnsc,doc_f2py_rout_symph_trntnsc}, - {"rgd_blk",-1,{{-1}},0,0,(char *) F_FUNC_US(rgd_blk,RGD_BLK), (f2py_init_func)f2py_rout_symph_rgd_blk,doc_f2py_rout_symph_rgd_blk}, - {"rgd_blk_diff_phase_conv",-1,{{-1}},0,0,(char *) F_FUNC_US(rgd_blk_diff_phase_conv,RGD_BLK_DIFF_PHASE_CONV), (f2py_init_func)f2py_rout_symph_rgd_blk_diff_phase_conv,doc_f2py_rout_symph_rgd_blk_diff_phase_conv}, - {"nonanal",-1,{{-1}},0,0,(char *) F_FUNC(nonanal,NONANAL), (f2py_init_func)f2py_rout_symph_nonanal,doc_f2py_rout_symph_nonanal}, - {"trasl",-1,{{-1}},0,0,(char *) F_FUNC(trasl,TRASL), (f2py_init_func)f2py_rout_symph_trasl,doc_f2py_rout_symph_trasl}, - {"frc_blk",-1,{{-1}},0,0,(char *) F_FUNC_US(frc_blk,FRC_BLK), (f2py_init_func)f2py_rout_symph_frc_blk,doc_f2py_rout_symph_frc_blk}, - {"wsinit",-1,{{-1}},0,0,(char *) F_FUNC(wsinit,WSINIT), (f2py_init_func)f2py_rout_symph_wsinit,doc_f2py_rout_symph_wsinit}, - {"wsweight",-1,{{-1}},0,0,(char *) F_WRAPPEDFUNC(wsweight,WSWEIGHT), (f2py_init_func)f2py_rout_symph_wsweight,doc_f2py_rout_symph_wsweight}, - {"get_frc",-1,{{-1}},0,0,(char *) F_FUNC_US(get_frc,GET_FRC), (f2py_init_func)f2py_rout_symph_get_frc,doc_f2py_rout_symph_get_frc}, - {"asign_supercell_index_new",-1,{{-1}},0,0,(char *) F_FUNC_US(asign_supercell_index_new,ASIGN_SUPERCELL_INDEX_NEW), (f2py_init_func)f2py_rout_symph_asign_supercell_index_new,doc_f2py_rout_symph_asign_supercell_index_new}, - {"q_gen",-1,{{-1}},0,0,(char *) F_FUNC_US(q_gen,Q_GEN), (f2py_init_func)f2py_rout_symph_q_gen,doc_f2py_rout_symph_q_gen}, - {"set_tau",-1,{{-1}},0,0,(char *) F_FUNC_US(set_tau,SET_TAU), (f2py_init_func)f2py_rout_symph_set_tau,doc_f2py_rout_symph_set_tau}, - {"threetosix_real",-1,{{-1}},0,0,(char *) F_FUNC_US(threetosix_real,THREETOSIX_REAL), (f2py_init_func)f2py_rout_symph_threetosix_real,doc_f2py_rout_symph_threetosix_real}, - {"sixtothree_real",-1,{{-1}},0,0,(char *) F_FUNC_US(sixtothree_real,SIXTOTHREE_REAL), (f2py_init_func)f2py_rout_symph_sixtothree_real,doc_f2py_rout_symph_sixtothree_real}, - {"eqvect",-1,{{-1}},0,0,(char *) F_WRAPPEDFUNC(eqvect,EQVECT), (f2py_init_func)f2py_rout_symph_eqvect,doc_f2py_rout_symph_eqvect}, - {"get_equivalent_atoms",-1,{{-1}},0,0,(char *) F_FUNC_US(get_equivalent_atoms,GET_EQUIVALENT_ATOMS), (f2py_init_func)f2py_rout_symph_get_equivalent_atoms,doc_f2py_rout_symph_get_equivalent_atoms}, - {"get_closest_vector",-1,{{-1}},0,0,(char *) F_FUNC_US(get_closest_vector,GET_CLOSEST_VECTOR), (f2py_init_func)f2py_rout_symph_get_closest_vector,doc_f2py_rout_symph_get_closest_vector}, - {"get_gr_data",-1,{{-1}},0,0,(char *) F_FUNC_US(get_gr_data,GET_GR_DATA), (f2py_init_func)f2py_rout_symph_get_gr_data,doc_f2py_rout_symph_get_gr_data}, - {"fix_coords_in_unit_cell",-1,{{-1}},0,0,(char *) F_FUNC_US(fix_coords_in_unit_cell,FIX_COORDS_IN_UNIT_CELL), (f2py_init_func)f2py_rout_symph_fix_coords_in_unit_cell,doc_f2py_rout_symph_fix_coords_in_unit_cell}, - {"matinv3",-1,{{-1}},0,0,(char *) F_FUNC(matinv3,MATINV3), (f2py_init_func)f2py_rout_symph_matinv3,doc_f2py_rout_symph_matinv3}, - {"invmat",-1,{{-1}},0,0,(char *) F_FUNC(invmat,INVMAT), (f2py_init_func)f2py_rout_symph_invmat,doc_f2py_rout_symph_invmat}, - {"recips",-1,{{-1}},0,0,(char *) F_FUNC(recips,RECIPS), (f2py_init_func)f2py_rout_symph_recips,doc_f2py_rout_symph_recips}, - {"sgam_ph_new",-1,{{-1}},0,0,(char *) F_FUNC_US(sgam_ph_new,SGAM_PH_NEW), (f2py_init_func)f2py_rout_symph_sgam_ph_new,doc_f2py_rout_symph_sgam_ph_new}, - {"get_tau_sc_latvec",-1,{{-1}},0,0,(char *) F_FUNC_US(get_tau_sc_latvec,GET_TAU_SC_LATVEC), (f2py_init_func)f2py_rout_symph_get_tau_sc_latvec,doc_f2py_rout_symph_get_tau_sc_latvec}, - {"permute_v3",-1,{{-1}},0,0,(char *) F_FUNC_US(permute_v3,PERMUTE_V3), (f2py_init_func)f2py_rout_symph_permute_v3,doc_f2py_rout_symph_permute_v3}, - {"permute_v4",-1,{{-1}},0,0,(char *) F_FUNC_US(permute_v4,PERMUTE_V4), (f2py_init_func)f2py_rout_symph_permute_v4,doc_f2py_rout_symph_permute_v4}, - {"trans_v2",-1,{{-1}},0,0,(char *) F_FUNC_US(trans_v2,TRANS_V2), (f2py_init_func)f2py_rout_symph_trans_v2,doc_f2py_rout_symph_trans_v2}, - {"trans_v3",-1,{{-1}},0,0,(char *) F_FUNC_US(trans_v3,TRANS_V3), (f2py_init_func)f2py_rout_symph_trans_v3,doc_f2py_rout_symph_trans_v3}, - {"trans_v4",-1,{{-1}},0,0,(char *) F_FUNC_US(trans_v4,TRANS_V4), (f2py_init_func)f2py_rout_symph_trans_v4,doc_f2py_rout_symph_trans_v4}, - {"sym_v2",-1,{{-1}},0,0,(char *) F_FUNC_US(sym_v2,SYM_V2), (f2py_init_func)f2py_rout_symph_sym_v2,doc_f2py_rout_symph_sym_v2}, - {"sym_v3",-1,{{-1}},0,0,(char *) F_FUNC_US(sym_v3,SYM_V3), (f2py_init_func)f2py_rout_symph_sym_v3,doc_f2py_rout_symph_sym_v3}, - {"sym_v4",-1,{{-1}},0,0,(char *) F_FUNC_US(sym_v4,SYM_V4), (f2py_init_func)f2py_rout_symph_sym_v4,doc_f2py_rout_symph_sym_v4}, - {"print_symm",-1,{{-1}},0,0,(char *) F_FUNC_US(print_symm,PRINT_SYMM), (f2py_init_func)f2py_rout_symph_print_symm,doc_f2py_rout_symph_print_symm}, - -/*eof routine_defs*/ - {NULL} -}; - -static PyMethodDef f2py_module_methods[] = { - - {NULL,NULL} -}; - -static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "symph", - NULL, - -1, - f2py_module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit_symph(void) { - int i; - PyObject *m,*d, *s, *tmp; - m = symph_module = PyModule_Create(&moduledef); - Py_SET_TYPE(&PyFortran_Type, &PyType_Type); - import_array(); - if (PyErr_Occurred()) - {PyErr_SetString(PyExc_ImportError, "can't initialize module symph (failed to import numpy)"); return m;} - d = PyModule_GetDict(m); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__version__", s); - Py_DECREF(s); - s = PyUnicode_FromString( - "This module 'symph' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" -" errore(calling_routine,message,ierr)\n" -" infomsg(routine,message)\n" -" latvec = get_latvec(tau_sc,tau,itau,nr,nat=shape(tau, 1),nat_sc=shape(tau_sc, 1))\n" -" phi2 = rotate_and_add_dyn(phi,isym,s,invs,irt,rtau,sxq,nat=shape(phi, 2))\n" -" irotmq = set_irotmq(xq,s,nsymq,nsym,minus_q,bg,at,lgamma)\n" -" symmatrix(matr,s,nsym,at,bg)\n" -" cart_to_crys_mat(matr,at)\n" -" crys_to_cart_mat(matr,bg)\n" -" f_output = contract_two_ph_propagator(w_array,w_mu,t,smearing,m,n_w=shape(w_array, 0),n_modes=shape(w_mu, 0))\n" -" chi = get_two_phonon_propagator(w_value,ws,t,smearing,n_w=shape(ws, 0))\n" -" phitot_sc = fc_supercell_from_dyn(phitot,q,tau,tau_sc,itau,nat=shape(phitot, 3),nq=shape(phitot, 0))\n" -" fc_supercell = fast_ft_real_space_from_dynq(unit_cell_coords,super_cell_coords,itau,q_tot,dynq,nat=shape(unit_cell_coords, 0),nat_sc=shape(super_cell_coords, 0),nq=shape(q_tot, 0))\n" -" impose_trans_sc(fc_sc,tau_sc_cryst,itau,nat_sc=shape(fc_sc, 2))\n" -" dyn = dyn_from_fc(phitot_sc,q,tau,tau_sc,itau,nq,nat)\n" -" q_list = get_q_grid(bg,supercell_size,n_size)\n" -" nq,sxq,isq,imq = star_q(xq,at,bg,nsym,s,invs,verbosity)\n" -" symvector(nsym,irt,s,at,bg,vect,nat=shape(irt, 1))\n" -" cryst_to_cart(vec,trmat,iflag,nvec=shape(vec, 1))\n" -" flush_unit(unit_tobeflushed)\n" -" trans = get_translations(pols,masses,nmod=shape(pols, 1),nat=shape(pols, 0) / 3)\n" -" dynqstar = q2qstar_out(dyn,at,bg,nsym,s,invs,irt,rtau,nq,sxq,isq,imq,nqtot,nat=shape(dyn, 0) / 3)\n" -" set_asr(asr,axis,tau,dyn,zeu,nat=shape(tau, 1))\n" -" sp_zeu(zeu_u,zeu_v,scal,nat=shape(zeu_u, 2))\n" -" sp1(u,v,scal,nat=shape(u, 2))\n" -" sp2(u,v,ind_v,scal,nat=shape(u, 2))\n" -" sp3(u,v,i,na,scal,nat=shape(u, 2))\n" -" symdynph_gq_new(xq,phi,s,invs,rtau,irt,irotmq,minus_q,nsymq,nat=shape(phi, 2))\n" -" trntnsc(phi,at,bg,iflg)\n" -" rgd_blk(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,nat=shape(dyn, 2))\n" -" rgd_blk_diff_phase_conv(nr1,nr2,nr3,dyn,q,tau,epsil,zeu,bg,omega,alat,loto_2d,sign,nat=shape(dyn, 2))\n" -" nonanal(itau_blk,epsil,q,zeu,omega,dyn,nat=shape(itau_blk, 0),nat_blk=shape(zeu, 2))\n" -" phid = trasl(phiq,nq,nr1,nr2,nr3,m1,m2,m3,nat=shape(phiq, 2))\n" -" dyn = frc_blk(q,tau,frc,at,rws,nrws,nat=shape(tau, 1),nr1=shape(frc, 0),nr2=shape(frc, 1),nr3=shape(frc, 2),nrwsx=shape(rws, 1))\n" -" nrws = wsinit(rws,atw,nrwsx=shape(rws, 1))\n" -" wsweight = wsweight(r,rws,nrws,nrwsx=shape(rws, 1))\n" -" frc = get_frc(phi_sc,tau,tau_sc,at,itau,size1,size2,size3,nat=shape(tau, 1),natsc=shape(phi_sc, 2))\n" -" l,m,n = asign_supercell_index_new(vect,at)\n" -" qbid = q_gen(nsc,at_blk,bg_blk,at,bg)\n" -" set_tau(at,at_blk,tau,tau_blk,ityp,ityp_blk,itau_blk,nat=shape(tau, 1),nat_blk=shape(tau_blk, 1))\n" -" mat6 = threetosix_real(mat3,nat=shape(mat3, 0) / 3)\n" -" mat3 = sixtothree_real(mat6,nat=shape(mat6, 0))\n" -" eqvect = eqvect(x,y,f)\n" -" eq_atoms = get_equivalent_atoms(coords1,coords2,unit_cell,ityp1,ityp2,nat=shape(coords1, 0))\n" -" new_v_dist = get_closest_vector(unit_cell,v_dist)\n" -" r_value,gr = get_gr_data(cells,coords,ityp,type1,type2,r_min,r_max,n_r,n_structs=shape(cells, 0),nat=shape(coords, 1))\n" -" new_coords = fix_coords_in_unit_cell(coords,unit_cell,nat=shape(coords, 0))\n" -" b = matinv3(a)\n" -" a_inv = invmat(a,n=shape(a, 0))\n" -" b1,b2,b3 = recips(a1,a2,a3)\n" -" rtau = sgam_ph_new(at,bg,nsym,s,irt,tau,nat=shape(irt, 1))\n" -" tau_sc_latvec = get_tau_sc_latvec(tau_sc,latvec,at_sc,nat_sc=shape(tau_sc, 1),nr=shape(latvec, 0))\n" -" permute_v3(v3,n=shape(v3, 0))\n" -" permute_v4(v4,n=shape(v4, 0))\n" -" trans_v2(v2,tau_sc_latvec,nat_sc=shape(v2, 2),nr=shape(tau_sc_latvec, 1))\n" -" trans_v3(v3,tau_sc_latvec,nat_sc=shape(v3, 0) / 3,nr=shape(tau_sc_latvec, 1))\n" -" trans_v4(v4,tau_sc_latvec,nat_sc=shape(v4, 0) / 3,nr=shape(tau_sc_latvec, 1))\n" -" sym_v2(v2,at_sc,bg_sc,s,irt,nsym,nat_sc=shape(v2, 2))\n" -" sym_v3(v3,at_sc,s,irt,nsym,nat_sc=shape(v3, 0) / 3)\n" -" sym_v4(v4,at_sc,s,irt,nsym,nat_sc=shape(v4, 0) / 3)\n" -" print_symm(s,nsym,irt,supercell,nat=shape(irt, 1))\n" -"Fortran 90/95 modules:\n"" constants --- pi,tpi,fpi,sqrtpi,sqrtpm1,sqrt2,h_planck_si,k_boltzmann_si,electron_si,electronvolt_si,electronmass_si,hartree_si,rydberg_si,bohr_radius_si,amu_si,c_si,munought_si,epsnought_si,k_boltzmann_au,k_boltzmann_ry,autoev,rytoev,amu_au,amu_ry,au_sec,au_ps,au_gpa,ry_kbar,debye_si,au_debye,ev_to_kelvin,ry_to_kelvin,evtonm,rytonm,c_au,eps4,eps6,eps8,eps12,eps14,eps16,eps24,eps32,gsmall,e2,degspin,bohr_radius_cm,bohr_radius_angs,angstrom_au,dip_debye,au_terahertz,au_to_ohmcmm1,ry_to_thz,ry_to_ghz,ry_to_cmm1,avogadro"" io_global --- stdout,ionode,ionode_id,meta_ionode,meta_ionode_id,xmlinputunit,xmloutputunit,xmltmpunit,io_global_start(),meta_io_global_start(),io_global_getionode(),io_global_getmeta()"" kinds --- dp,sgl,i4b,print_kind_info()"" symm_base --- eps1,eps2,s,sr,sname,ft,ftau,nrot,nsym,nsym_ns,nsym_na,t_rev,no_t_rev,time_reversal,irt,invs,invsym,d1,d2,d3,allfrac,nofrac,nosym,nosym_evc,at,bg,set_accep_threshold(),get_accep_threshold(),set_at_bg(),inverse_s(),set_sym_bl(),find_sym(),sgam_at(),sgam_at_mag(),set_sym(),copy_sym(),is_group(),eqvect(),checksym(),checkallsym(),s_axis_to_cart(),smallg_q()""."); - PyDict_SetItemString(d, "__doc__", s); - Py_DECREF(s); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__f2py_numpy_version__", s); - Py_DECREF(s); - symph_error = PyErr_NewException ("symph.error", NULL, NULL); - /* - * Store the error object inside the dict, so that it could get deallocated. - * (in practice, this is a module, so it likely will not and cannot.) - */ - PyDict_SetItemString(d, "_symph_error", symph_error); - Py_DECREF(symph_error); - for(i=0;f2py_routine_defs[i].name!=NULL;i++) { - tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); - PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); - Py_DECREF(tmp); - } - - - - { - extern void F_FUNC_US(get_latvec,GET_LATVEC)(void); - PyObject* o = PyDict_GetItemString(d,"get_latvec"); - tmp = F2PyCapsule_FromVoidPtr((void*)F_FUNC_US(get_latvec,GET_LATVEC),NULL); - PyObject_SetAttrString(o,"_cpointer", tmp); - Py_DECREF(tmp); - s = PyUnicode_FromString("get_latvec"); - PyObject_SetAttrString(o,"__name__", s); - Py_DECREF(s); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { - extern double F_FUNC(wsweight,WSWEIGHT)(void); - PyObject* o = PyDict_GetItemString(d,"wsweight"); - tmp = F2PyCapsule_FromVoidPtr((void*)F_FUNC(wsweight,WSWEIGHT),NULL); - PyObject_SetAttrString(o,"_cpointer", tmp); - Py_DECREF(tmp); - s = PyUnicode_FromString("wsweight"); - PyObject_SetAttrString(o,"__name__", s); - Py_DECREF(s); - } - - - - - - - - - { - extern int F_FUNC(eqvect,EQVECT)(void); - PyObject* o = PyDict_GetItemString(d,"eqvect"); - tmp = F2PyCapsule_FromVoidPtr((void*)F_FUNC(eqvect,EQVECT),NULL); - PyObject_SetAttrString(o,"_cpointer", tmp); - Py_DECREF(tmp); - s = PyUnicode_FromString("eqvect"); - PyObject_SetAttrString(o,"__name__", s); - Py_DECREF(s); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/*eof initf2pywraphooks*/ - PyDict_SetItemString(d, "symm_base", PyFortranObject_New(f2py_symm_base_def,f2py_init_symm_base)); - PyDict_SetItemString(d, "kinds", PyFortranObject_New(f2py_kinds_def,f2py_init_kinds)); - PyDict_SetItemString(d, "io_global", PyFortranObject_New(f2py_io_global_def,f2py_init_io_global)); - PyDict_SetItemString(d, "constants", PyFortranObject_New(f2py_constants_def,f2py_init_constants)); -/*eof initf90modhooks*/ - -/*eof initcommonhooks*/ - - -#ifdef F2PY_REPORT_ATEXIT - if (! PyErr_Occurred()) - on_exit(f2py_report_on_exit,(void*)"symph"); -#endif - return m; -} -#ifdef __cplusplus -} -#endif diff --git a/f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 b/f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 deleted file mode 100644 index 0e00b066..00000000 --- a/f2py_wrappers/thermal_conductivity-f2pywrappers2.f90 +++ /dev/null @@ -1,400 +0,0 @@ -! -*- f90 -*- -! This file is autogenerated with f2py (version:1.26.4) -! It contains Fortran 90 wrappers to fortran functions. - - subroutine f2pywrap_get_lf_vec_dot_mat (vec_dot_matf2pywrap, v1, m& - &1, f2py_v1_d0, f2py_m1_d0, f2py_m1_d1) - use get_lf, only : vec_dot_mat - integer f2py_v1_d0 - integer f2py_m1_d0 - integer f2py_m1_d1 - real(kind=8) v1(f2py_v1_d0) - real(kind=8) m1(f2py_m1_d0,f2py_m1_d1) - real(kind=8) vec_dot_matf2pywrap(size(v1)) - vec_dot_matf2pywrap = vec_dot_mat(v1, m1) - end subroutine f2pywrap_get_lf_vec_dot_mat - subroutine f2pywrap_get_lf_inv (invf2pywrap, a, f2py_a_d0, f2py_a_& - &d1) - use get_lf, only : inv - integer f2py_a_d0 - integer f2py_a_d1 - real(kind=8) a(f2py_a_d0,f2py_a_d1) - real(kind=8) invf2pywrap(size(a, 1),size(a, 2)) - invf2pywrap = inv(a) - end subroutine f2pywrap_get_lf_inv - - subroutine f2pyinitget_lf(f2pysetupfunc) - use get_lf, only : calculate_lineshapes - use get_lf, only : calculate_lineshapes_mode_mixing - use get_lf, only : calculate_lineshapes_cartesian - use get_lf, only : calculate_lifetimes_selfconsistently - use get_lf, only : solve_selfconsistent_equation - use get_lf, only : calculate_correlation_function - use get_lf, only : calculate_lifetimes_perturbative - use get_lf, only : calculate_lifetimes - use get_lf, only : calculate_self_energy_la - use get_lf, only : calculate_self_energy_p - use get_lf, only : calculate_self_energy_full - use get_lf, only : check_if_gamma - use get_lf, only : calculate_real_part_via_kramers_kronig - use get_lf, only : calculate_real_part_via_kramers_kronig_2d - use get_lf, only : hilbert_transform_via_fft - use get_lf, only : ht - use get_lf, only : cfft - use get_lf, only : interpolate_fc2 - interface - subroutine f2pywrap_get_lf_vec_dot_mat (vec_dot_matf2pywrap, v1, m& - &1, f2py_v1_d0, f2py_m1_d0, f2py_m1_d1) - integer f2py_v1_d0 - integer f2py_m1_d0 - integer f2py_m1_d1 - real(kind=8) v1(f2py_v1_d0) - real(kind=8) m1(f2py_m1_d0,f2py_m1_d1) - real(kind=8) vec_dot_matf2pywrap(size(v1)) - end subroutine f2pywrap_get_lf_vec_dot_mat - subroutine f2pywrap_get_lf_inv (invf2pywrap, a, f2py_a_d0, f2py_a_& - &d1) - integer f2py_a_d0 - integer f2py_a_d1 - real(kind=8) a(f2py_a_d0,f2py_a_d1) - real(kind=8) invf2pywrap(size(a, 1),size(a, 2)) - end subroutine f2pywrap_get_lf_inv - end interface - external f2pysetupfunc - call f2pysetupfunc(calculate_lineshapes,calculate_lineshapes_mode_& - &mixing,calculate_lineshapes_cartesian,calculate_lifetimes_selfcons& - &istently,solve_selfconsistent_equation,calculate_correlation_funct& - &ion,calculate_lifetimes_perturbative,calculate_lifetimes,calculate& - &_self_energy_la,calculate_self_energy_p,calculate_self_energy_full& - &,check_if_gamma,f2pywrap_get_lf_vec_dot_mat,calculate_real_part_vi& - &a_kramers_kronig,calculate_real_part_via_kramers_kronig_2d,hilbert& - &_transform_via_fft,ht,cfft,f2pywrap_get_lf_inv,interpolate_fc2) - end subroutine f2pyinitget_lf - - subroutine f2pywrap_scattering_grids_same_vector (same_vectorf2pyw& - &rap, v1, v2) - use scattering_grids, only : same_vector - real(kind=8) v1(3) - real(kind=8) v2(3) - logical same_vectorf2pywrap - same_vectorf2pywrap = .not.(.not.same_vector(v1, v2)) - end subroutine f2pywrap_scattering_grids_same_vector - subroutine f2pywrap_scattering_grids_same_vector_nopbc (same_vecto& - &r_nopbcf2pywrap, v1, v2) - use scattering_grids, only : same_vector_nopbc - real(kind=8) v1(3) - real(kind=8) v2(3) - logical same_vector_nopbcf2pywrap - same_vector_nopbcf2pywrap = .not.(.not.same_vector_nopbc(v1, v2)) - end subroutine f2pywrap_scattering_grids_same_vector_nopbc - - subroutine f2pyinitscattering_grids(f2pysetupfunc) - use scattering_grids, only : get_scattering_q_grid - interface - subroutine f2pywrap_scattering_grids_same_vector (same_vectorf2pyw& - &rap, v1, v2) - real(kind=8) v1(3) - real(kind=8) v2(3) - logical same_vectorf2pywrap - end subroutine f2pywrap_scattering_grids_same_vector - subroutine f2pywrap_scattering_grids_same_vector_nopbc (same_vecto& - &r_nopbcf2pywrap, v1, v2) - real(kind=8) v1(3) - real(kind=8) v2(3) - logical same_vector_nopbcf2pywrap - end subroutine f2pywrap_scattering_grids_same_vector_nopbc - end interface - external f2pysetupfunc - call f2pysetupfunc(get_scattering_q_grid,f2pywrap_scattering_grids& - &_same_vector,f2pywrap_scattering_grids_same_vector_nopbc) - end subroutine f2pyinitscattering_grids - - subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& - &f2pywrap, v1, v2, v3, d1, d2, d3, tol) - use third_order_centering, only : within_dmax - real(kind=8) d1 - real(kind=8) d2 - real(kind=8) d3 - real(kind=8) tol - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - logical within_dmaxf2pywrap - within_dmaxf2pywrap = .not.(.not.within_dmax(v1, v2, v3, d1, d2, d& - &3, tol)) - end subroutine f2pywrap_third_order_centering_within_dmax - subroutine f2pywrap_third_order_centering_compute_perimeter (compu& - &te_perimeterf2pywrap, v1, v2, v3) - use third_order_centering, only : compute_perimeter - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - real(kind=8) compute_perimeterf2pywrap - compute_perimeterf2pywrap = compute_perimeter(v1, v2, v3) - end subroutine f2pywrap_third_order_centering_compute_perimeter - subroutine f2pywrap_third_order_centering_three_to_one_len (three_& - &to_one_lenf2pywrap, v, v_min, v_len) - use third_order_centering, only : three_to_one_len - integer v(3) - integer v_min(3) - integer v_len(3) - integer three_to_one_lenf2pywrap - three_to_one_lenf2pywrap = three_to_one_len(v, v_min, v_len) - end subroutine f2pywrap_third_order_centering_three_to_one_len - subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& - &nef2pywrap, v, v_min, v_max) - use third_order_centering, only : three_to_one - integer v(3) - integer v_min(3) - integer v_max(3) - integer three_to_onef2pywrap - three_to_onef2pywrap = three_to_one(v, v_min, v_max) - end subroutine f2pywrap_third_order_centering_three_to_one - subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& - &_three_lenf2pywrap, j, v_min, v_len) - use third_order_centering, only : one_to_three_len - integer j - integer v_min(3) - integer v_len(3) - integer one_to_three_lenf2pywrap(3) - one_to_three_lenf2pywrap = one_to_three_len(j, v_min, v_len) - end subroutine f2pywrap_third_order_centering_one_to_three_len - subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& - &eef2pywrap, j, v_min, v_max) - use third_order_centering, only : one_to_three - integer j - integer v_min(3) - integer v_max(3) - integer one_to_threef2pywrap(3) - one_to_threef2pywrap = one_to_three(j, v_min, v_max) - end subroutine f2pywrap_third_order_centering_one_to_three - subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& - &se_2f2pywrap, a, b) - use third_order_centering, only : min_el_wise_2 - integer a(3) - integer b(3) - integer min_el_wise_2f2pywrap(3) - min_el_wise_2f2pywrap = min_el_wise_2(a, b) - end subroutine f2pywrap_third_order_centering_min_el_wise_2 - subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& - &se_2f2pywrap, a, b) - use third_order_centering, only : max_el_wise_2 - integer a(3) - integer b(3) - integer max_el_wise_2f2pywrap(3) - max_el_wise_2f2pywrap = max_el_wise_2(a, b) - end subroutine f2pywrap_third_order_centering_max_el_wise_2 - subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& - &se_3f2pywrap, a, b, c) - use third_order_centering, only : min_el_wise_3 - integer a(3) - integer b(3) - integer c(3) - integer min_el_wise_3f2pywrap(3) - min_el_wise_3f2pywrap = min_el_wise_3(a, b, c) - end subroutine f2pywrap_third_order_centering_min_el_wise_3 - subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& - &se_3f2pywrap, a, b, c) - use third_order_centering, only : max_el_wise_3 - integer a(3) - integer b(3) - integer c(3) - integer max_el_wise_3f2pywrap(3) - max_el_wise_3f2pywrap = max_el_wise_3(a, b, c) - end subroutine f2pywrap_third_order_centering_max_el_wise_3 - subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& - &cartf2pywrap, v, alat) - use third_order_centering, only : cryst_to_cart - integer v(3) - real(kind=8) alat(3,3) - real(kind=8) cryst_to_cartf2pywrap(3) - cryst_to_cartf2pywrap = cryst_to_cart(v, alat) - end subroutine f2pywrap_third_order_centering_cryst_to_cart - - subroutine f2pyinitthird_order_centering(f2pysetupfunc) - use third_order_centering, only : analysis - use third_order_centering, only : center - use third_order_centering, only : center_sparse - use third_order_centering, only : pre_center - use third_order_centering, only : assign - interface - subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& - &f2pywrap, v1, v2, v3, d1, d2, d3, tol) - real(kind=8) d1 - real(kind=8) d2 - real(kind=8) d3 - real(kind=8) tol - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - logical within_dmaxf2pywrap - end subroutine f2pywrap_third_order_centering_within_dmax - subroutine f2pywrap_third_order_centering_compute_perimeter (compu& - &te_perimeterf2pywrap, v1, v2, v3) - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - real(kind=8) compute_perimeterf2pywrap - end subroutine f2pywrap_third_order_centering_compute_perimeter - subroutine f2pywrap_third_order_centering_three_to_one_len (three_& - &to_one_lenf2pywrap, v, v_min, v_len) - integer v(3) - integer v_min(3) - integer v_len(3) - integer three_to_one_lenf2pywrap - end subroutine f2pywrap_third_order_centering_three_to_one_len - subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& - &nef2pywrap, v, v_min, v_max) - integer v(3) - integer v_min(3) - integer v_max(3) - integer three_to_onef2pywrap - end subroutine f2pywrap_third_order_centering_three_to_one - subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& - &_three_lenf2pywrap, j, v_min, v_len) - integer j - integer v_min(3) - integer v_len(3) - integer one_to_three_lenf2pywrap(3) - end subroutine f2pywrap_third_order_centering_one_to_three_len - subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& - &eef2pywrap, j, v_min, v_max) - integer j - integer v_min(3) - integer v_max(3) - integer one_to_threef2pywrap(3) - end subroutine f2pywrap_third_order_centering_one_to_three - subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& - &se_2f2pywrap, a, b) - integer a(3) - integer b(3) - integer min_el_wise_2f2pywrap(3) - end subroutine f2pywrap_third_order_centering_min_el_wise_2 - subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& - &se_2f2pywrap, a, b) - integer a(3) - integer b(3) - integer max_el_wise_2f2pywrap(3) - end subroutine f2pywrap_third_order_centering_max_el_wise_2 - subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& - &se_3f2pywrap, a, b, c) - integer a(3) - integer b(3) - integer c(3) - integer min_el_wise_3f2pywrap(3) - end subroutine f2pywrap_third_order_centering_min_el_wise_3 - subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& - &se_3f2pywrap, a, b, c) - integer a(3) - integer b(3) - integer c(3) - integer max_el_wise_3f2pywrap(3) - end subroutine f2pywrap_third_order_centering_max_el_wise_3 - subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& - &cartf2pywrap, v, alat) - integer v(3) - real(kind=8) alat(3,3) - real(kind=8) cryst_to_cartf2pywrap(3) - end subroutine f2pywrap_third_order_centering_cryst_to_cart - end interface - external f2pysetupfunc - call f2pysetupfunc(analysis,center,center_sparse,pre_center,assign& - &,f2pywrap_third_order_centering_within_dmax,f2pywrap_third_order_c& - &entering_compute_perimeter,f2pywrap_third_order_centering_three_to& - &_one_len,f2pywrap_third_order_centering_three_to_one,f2pywrap_thir& - &d_order_centering_one_to_three_len,f2pywrap_third_order_centering_& - &one_to_three,f2pywrap_third_order_centering_min_el_wise_2,f2pywrap& - &_third_order_centering_max_el_wise_2,f2pywrap_third_order_centerin& - &g_min_el_wise_3,f2pywrap_third_order_centering_max_el_wise_3,f2pyw& - &rap_third_order_centering_cryst_to_cart) - end subroutine f2pyinitthird_order_centering - - subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& - & t) - use third_order_cond, only : f_bose - real(kind=8) freq - real(kind=8) t - real(kind=8) f_bosef2pywrap - f_bosef2pywrap = f_bose(freq, t) - end subroutine f2pywrap_third_order_cond_f_bose - subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& - &q, t) - use third_order_cond, only : df_bose - real(kind=8) freq - real(kind=8) t - real(kind=8) df_bosef2pywrap - df_bosef2pywrap = df_bose(freq, t) - end subroutine f2pywrap_third_order_cond_df_bose - subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& - &unctionf2pywrap, x, sigma) - use third_order_cond, only : gaussian_function - real(kind=8) x - real(kind=8) sigma - real(kind=8) gaussian_functionf2pywrap - gaussian_functionf2pywrap = gaussian_function(x, sigma) - end subroutine f2pywrap_third_order_cond_gaussian_function - subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& - &_d0, f2py_a_d1) - use third_order_cond, only : cinv - integer f2py_a_d0 - integer f2py_a_d1 - complex(kind=8) a(f2py_a_d0,f2py_a_d1) - complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) - cinvf2pywrap = cinv(a) - end subroutine f2pywrap_third_order_cond_cinv - - subroutine f2pyinitthird_order_cond(f2pysetupfunc) - use third_order_cond, only : interpol_v2 - use third_order_cond, only : interpol_v3 - use third_order_cond, only : compute_full_dynamic_bubble_single - use third_order_cond, only : compute_diag_dynamic_bubble_single - use third_order_cond, only : compute_perturb_selfnrg_single - use third_order_cond, only : compute_spectralf_diag_single - use third_order_cond, only : lambda_dynamic_single - use third_order_cond, only : lambda_dynamic_value_single - use third_order_cond, only : calculate_spectral_function - use third_order_cond, only : calculate_spectral_function_mode_mixi& - &ng - use third_order_cond, only : calculate_spectral_function_cartesian - use third_order_cond, only : bose_freq - use third_order_cond, only : eq_freq - use third_order_cond, only : eliminate_transl - interface - subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& - & t) - real(kind=8) freq - real(kind=8) t - real(kind=8) f_bosef2pywrap - end subroutine f2pywrap_third_order_cond_f_bose - subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& - &q, t) - real(kind=8) freq - real(kind=8) t - real(kind=8) df_bosef2pywrap - end subroutine f2pywrap_third_order_cond_df_bose - subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& - &unctionf2pywrap, x, sigma) - real(kind=8) x - real(kind=8) sigma - real(kind=8) gaussian_functionf2pywrap - end subroutine f2pywrap_third_order_cond_gaussian_function - subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& - &_d0, f2py_a_d1) - integer f2py_a_d0 - integer f2py_a_d1 - complex(kind=8) a(f2py_a_d0,f2py_a_d1) - complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) - end subroutine f2pywrap_third_order_cond_cinv - end interface - external f2pysetupfunc - call f2pysetupfunc(interpol_v2,interpol_v3,compute_full_dynamic_bu& - &bble_single,compute_diag_dynamic_bubble_single,compute_perturb_sel& - &fnrg_single,compute_spectralf_diag_single,lambda_dynamic_single,la& - &mbda_dynamic_value_single,calculate_spectral_function,calculate_sp& - &ectral_function_mode_mixing,calculate_spectral_function_cartesian,& - &bose_freq,eq_freq,f2pywrap_third_order_cond_f_bose,f2pywrap_third_& - &order_cond_df_bose,f2pywrap_third_order_cond_gaussian_function,eli& - &minate_transl,f2pywrap_third_order_cond_cinv) - end subroutine f2pyinitthird_order_cond - - diff --git a/f2py_wrappers/thermal_conductivitymodule.c b/f2py_wrappers/thermal_conductivitymodule.c deleted file mode 100644 index ecd7a3e0..00000000 --- a/f2py_wrappers/thermal_conductivitymodule.c +++ /dev/null @@ -1,13977 +0,0 @@ -/* File: thermal_conductivitymodule.c - * This file is auto-generated with f2py (version:1.26.4). - * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, - * written by Pearu Peterson . - * Generation date: Fri Sep 12 13:28:40 2025 - * Do not edit this file directly unless you know what you are doing!!! - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ - -/* Unconditionally included */ -#include -#include - -/*********************** See f2py2e/cfuncs.py: includes ***********************/ -#include "fortranobject.h" -#include - -/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ -static PyObject *thermal_conductivity_error; -static PyObject *thermal_conductivity_module; - -/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ -typedef struct {double r,i;} complex_double; - -/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ -/*need_typedefs_generated*/ - -/********************** See f2py2e/cfuncs.py: cppmacros **********************/ - -/* See fortranobject.h for definitions. The macros here are provided for BC. */ -#define rank f2py_rank -#define shape f2py_shape -#define fshape f2py_shape -#define len f2py_len -#define flen f2py_flen -#define slen f2py_slen -#define size f2py_size - - -#define CHECKSCALAR(check,tcheck,name,show,var)\ - if (!(check)) {\ - char errstring[256];\ - sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ - PyErr_SetString(thermal_conductivity_error,errstring);\ - /*goto capi_fail;*/\ - } else - -#ifdef DEBUGCFUNCS -#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); -#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ - PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ - fprintf(stderr,"\n"); -#else -#define CFUNCSMESS(mess) -#define CFUNCSMESSPY(mess,obj) -#endif - - -#ifndef max -#define max(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) ((a < b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a,b) ((a < b) ? (a) : (b)) -#endif - - -#define CHECKARRAY(check,tcheck,name) \ - if (!(check)) {\ - PyErr_SetString(thermal_conductivity_error,"("tcheck") failed for "name);\ - /*goto capi_fail;*/\ - } else - -#define pyobj_from_complex_double1(v) (PyComplex_FromDoubles(v.r,v.i)) - -#if defined(PREPEND_FORTRAN) -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F -#else -#define F_FUNC(f,F) _##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F##_ -#else -#define F_FUNC(f,F) _##f##_ -#endif -#endif -#else -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F -#else -#define F_FUNC(f,F) f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F##_ -#else -#define F_FUNC(f,F) f##_ -#endif -#endif -#endif -#if defined(UNDERSCORE_G77) -#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) -#else -#define F_FUNC_US(f,F) F_FUNC(f,F) -#endif - - -/************************ See f2py2e/cfuncs.py: cfuncs ************************/ - -static int -double_from_pyobj(double* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - if (PyFloat_Check(obj)) { - *v = PyFloat_AsDouble(obj); - return !(*v == -1.0 && PyErr_Occurred()); - } - - tmp = PyNumber_Float(obj); - if (tmp) { - *v = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return !(*v == -1.0 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} - Py_DECREF(tmp); - } - { - PyObject* err = PyErr_Occurred(); - if (err==NULL) err = thermal_conductivity_error; - PyErr_SetString(err,errmess); - } - return 0; -} - - -static int -int_from_pyobj(int* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - - if (PyLong_Check(obj)) { - *v = Npy__PyLong_AsInt(obj); - return !(*v == -1 && PyErr_Occurred()); - } - - tmp = PyNumber_Long(obj); - if (tmp) { - *v = Npy__PyLong_AsInt(tmp); - Py_DECREF(tmp); - return !(*v == -1 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (int_from_pyobj(v, tmp, errmess)) { - Py_DECREF(tmp); - return 1; - } - Py_DECREF(tmp); - } - - { - PyObject* err = PyErr_Occurred(); - if (err == NULL) { - err = thermal_conductivity_error; - } - PyErr_SetString(err, errmess); - } - return 0; -} - - -/********************* See f2py2e/cfuncs.py: userincludes *********************/ -/*need_userincludes*/ - -/********************* See f2py2e/capi_rules.py: usercode *********************/ - - -/* See f2py2e/rules.py */ -/*eof externroutines*/ - -/******************** See f2py2e/capi_rules.py: usercode1 ********************/ - - -/******************* See f2py2e/cb_rules.py: buildcallback *******************/ -/*need_callbacks*/ - -/*********************** See f2py2e/rules.py: buildapi ***********************/ - -/**************************** calculate_lineshapes ****************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes[] = "\ -lineshapes = calculate_lineshapes(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lineshapes``.\ -\n\nParameters\n----------\n" -"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" -"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" -"weights : input rank-1 array('i') with bounds (n_events)\n" -"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"rprim : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"t : input float\n" -"gaussian : input int\n" -"classical : input int\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"n_events : input int, optional\n Default: shape(qgrid, 1)\n" -"\nReturns\n-------\n" -"lineshapes : rank-3 array('d') with bounds (nirrqpt,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - int *scatt_events = NULL; - npy_intp scatt_events_Dims[1] = {-1}; - const int scatt_events_Rank = 1; - PyArrayObject *capi_scatt_events_as_array = NULL; - int capi_scatt_events_intent = 0; - PyObject *scatt_events_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *rprim = NULL; - npy_intp rprim_Dims[2] = {-1, -1}; - const int rprim_Rank = 2; - PyArrayObject *capi_rprim_as_array = NULL; - int capi_rprim_intent = 0; - PyObject *rprim_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[2] = {-1, -1}; - const int smear_Rank = 2; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double *smear_id = NULL; - npy_intp smear_id_Dims[2] = {-1, -1}; - const int smear_id_Rank = 2; - PyArrayObject *capi_smear_id_as_array = NULL; - int capi_smear_id_intent = 0; - PyObject *smear_id_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int n_events = 0; - PyObject *n_events_capi = Py_None; - double *lineshapes = NULL; - npy_intp lineshapes_Dims[3] = {-1, -1, -1}; - const int lineshapes_Rank = 3; - PyArrayObject *capi_lineshapes_as_array = NULL; - int capi_lineshapes_intent = 0; - static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lineshapes",\ - capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable irrqgrid */ - irrqgrid_Dims[0]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 1st argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 2nd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 5th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable rprim */ - rprim_Dims[0]=3,rprim_Dims[1]=3; - capi_rprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 10th argument `rprim`"; - capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); - if (capi_rprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 18th argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 15th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 2nd keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lineshapes:nirrqpt=%d",nirrqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 3rd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lineshapes:nat=%d",nat) { - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 4th keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lineshapes:nfc2=%d",nfc2) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lineshapes:ne=%d",ne) { - /* Processing variable n_events */ - if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 6th keyword (n_events) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lineshapes:n_events=%d",n_events) { - /* Processing variable weights */ - weights_Dims[0]=n_events; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 3rd argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable scatt_events */ - scatt_events_Dims[0]=nirrqpt; - capi_scatt_events_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 4th argument `scatt_events`"; - capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); - if (capi_scatt_events_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 7th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 6th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 11st argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 12nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 13rd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable smear_id */ - smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; - capi_smear_id_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 14th argument `smear_id`"; - capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); - if (capi_smear_id_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); - - /* Processing variable lineshapes */ - lineshapes_Dims[0]=nirrqpt,lineshapes_Dims[1]=3 * nat,lineshapes_Dims[2]=ne; - capi_lineshapes_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the hidden `lineshapes`"; - capi_lineshapes_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,lineshapes_Dims,lineshapes_Rank, capi_lineshapes_intent,Py_None,capi_errmess); - if (capi_lineshapes_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lineshapes = (double *)(PyArray_DATA(capi_lineshapes_as_array)); - - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lineshapes() 5th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lineshapes:nfc3=%d",nfc3) { - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 8th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes: failed to create array from the 9th argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,lineshapes); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lineshapes_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /* if (capi_lineshapes_as_array == NULL) ... else of lineshapes */ - /* End of cleaning variable lineshapes */ - if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { - Py_XDECREF(capi_smear_id_as_array); } - } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ - /* End of cleaning variable smear_id */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { - Py_XDECREF(capi_scatt_events_as_array); } - } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ - /* End of cleaning variable scatt_events */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ - } /*if (f2py_success) of n_events*/ - /* End of cleaning variable n_events */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_rprim_as_array!=rprim_capi) { - Py_XDECREF(capi_rprim_as_array); } - } /* if (capi_rprim_as_array == NULL) ... else of rprim */ - /* End of cleaning variable rprim */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of calculate_lineshapes ************************/ - -/********************** calculate_lineshapes_mode_mixing **********************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing[] = "\ -lineshapes = calculate_lineshapes_mode_mixing(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lineshapes_mode_mixing``.\ -\n\nParameters\n----------\n" -"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" -"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" -"weights : input rank-1 array('i') with bounds (n_events)\n" -"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"rprim : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"t : input float\n" -"gaussian : input int\n" -"classical : input int\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"n_events : input int, optional\n Default: shape(qgrid, 1)\n" -"\nReturns\n-------\n" -"lineshapes : rank-4 array('D') with bounds (nirrqpt,3 * nat,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - int *scatt_events = NULL; - npy_intp scatt_events_Dims[1] = {-1}; - const int scatt_events_Rank = 1; - PyArrayObject *capi_scatt_events_as_array = NULL; - int capi_scatt_events_intent = 0; - PyObject *scatt_events_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *rprim = NULL; - npy_intp rprim_Dims[2] = {-1, -1}; - const int rprim_Rank = 2; - PyArrayObject *capi_rprim_as_array = NULL; - int capi_rprim_intent = 0; - PyObject *rprim_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[2] = {-1, -1}; - const int smear_Rank = 2; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double *smear_id = NULL; - npy_intp smear_id_Dims[2] = {-1, -1}; - const int smear_id_Rank = 2; - PyArrayObject *capi_smear_id_as_array = NULL; - int capi_smear_id_intent = 0; - PyObject *smear_id_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int n_events = 0; - PyObject *n_events_capi = Py_None; - complex_double *lineshapes = NULL; - npy_intp lineshapes_Dims[4] = {-1, -1, -1, -1}; - const int lineshapes_Rank = 4; - PyArrayObject *capi_lineshapes_as_array = NULL; - int capi_lineshapes_intent = 0; - static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing",\ - capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable irrqgrid */ - irrqgrid_Dims[0]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 1st argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 2nd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 5th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable rprim */ - rprim_Dims[0]=3,rprim_Dims[1]=3; - capi_rprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 10th argument `rprim`"; - capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); - if (capi_rprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 18th argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 15th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 2nd keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lineshapes_mode_mixing:nirrqpt=%d",nirrqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 3rd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lineshapes_mode_mixing:nat=%d",nat) { - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 4th keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lineshapes_mode_mixing:nfc2=%d",nfc2) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lineshapes_mode_mixing:ne=%d",ne) { - /* Processing variable n_events */ - if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 6th keyword (n_events) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lineshapes_mode_mixing:n_events=%d",n_events) { - /* Processing variable weights */ - weights_Dims[0]=n_events; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 3rd argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable scatt_events */ - scatt_events_Dims[0]=nirrqpt; - capi_scatt_events_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 4th argument `scatt_events`"; - capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); - if (capi_scatt_events_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 7th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 6th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 11st argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 12nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 13rd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable smear_id */ - smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; - capi_smear_id_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 14th argument `smear_id`"; - capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); - if (capi_smear_id_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); - - /* Processing variable lineshapes */ - lineshapes_Dims[0]=nirrqpt,lineshapes_Dims[1]=3 * nat,lineshapes_Dims[2]=3 * nat,lineshapes_Dims[3]=ne; - capi_lineshapes_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the hidden `lineshapes`"; - capi_lineshapes_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lineshapes_Dims,lineshapes_Rank, capi_lineshapes_intent,Py_None,capi_errmess); - if (capi_lineshapes_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lineshapes = (complex_double *)(PyArray_DATA(capi_lineshapes_as_array)); - - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing() 5th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lineshapes_mode_mixing:nfc3=%d",nfc3) { - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 8th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_mode_mixing: failed to create array from the 9th argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,lineshapes); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lineshapes_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /* if (capi_lineshapes_as_array == NULL) ... else of lineshapes */ - /* End of cleaning variable lineshapes */ - if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { - Py_XDECREF(capi_smear_id_as_array); } - } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ - /* End of cleaning variable smear_id */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { - Py_XDECREF(capi_scatt_events_as_array); } - } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ - /* End of cleaning variable scatt_events */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ - } /*if (f2py_success) of n_events*/ - /* End of cleaning variable n_events */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_rprim_as_array!=rprim_capi) { - Py_XDECREF(capi_rprim_as_array); } - } /* if (capi_rprim_as_array == NULL) ... else of rprim */ - /* End of cleaning variable rprim */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************** end of calculate_lineshapes_mode_mixing ******************/ - -/*********************** calculate_lineshapes_cartesian ***********************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian[] = "\ -lineshapes = calculate_lineshapes_cartesian(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lineshapes_cartesian``.\ -\n\nParameters\n----------\n" -"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" -"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" -"weights : input rank-1 array('i') with bounds (n_events)\n" -"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"rprim : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"t : input float\n" -"gaussian : input int\n" -"classical : input int\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"n_events : input int, optional\n Default: shape(qgrid, 1)\n" -"\nReturns\n-------\n" -"lineshapes : rank-4 array('D') with bounds (nirrqpt,3 * nat,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - int *scatt_events = NULL; - npy_intp scatt_events_Dims[1] = {-1}; - const int scatt_events_Rank = 1; - PyArrayObject *capi_scatt_events_as_array = NULL; - int capi_scatt_events_intent = 0; - PyObject *scatt_events_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *rprim = NULL; - npy_intp rprim_Dims[2] = {-1, -1}; - const int rprim_Rank = 2; - PyArrayObject *capi_rprim_as_array = NULL; - int capi_rprim_intent = 0; - PyObject *rprim_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[2] = {-1, -1}; - const int smear_Rank = 2; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double *smear_id = NULL; - npy_intp smear_id_Dims[2] = {-1, -1}; - const int smear_id_Rank = 2; - PyArrayObject *capi_smear_id_as_array = NULL; - int capi_smear_id_intent = 0; - PyObject *smear_id_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int n_events = 0; - PyObject *n_events_capi = Py_None; - complex_double *lineshapes = NULL; - npy_intp lineshapes_Dims[4] = {-1, -1, -1, -1}; - const int lineshapes_Rank = 4; - PyArrayObject *capi_lineshapes_as_array = NULL; - int capi_lineshapes_intent = 0; - static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lineshapes_cartesian",\ - capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable irrqgrid */ - irrqgrid_Dims[0]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 1st argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 2nd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 5th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable rprim */ - rprim_Dims[0]=3,rprim_Dims[1]=3; - capi_rprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 10th argument `rprim`"; - capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); - if (capi_rprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 18th argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 15th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 2nd keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lineshapes_cartesian:nirrqpt=%d",nirrqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 3rd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lineshapes_cartesian:nat=%d",nat) { - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 4th keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lineshapes_cartesian:nfc2=%d",nfc2) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lineshapes_cartesian:ne=%d",ne) { - /* Processing variable n_events */ - if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 6th keyword (n_events) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lineshapes_cartesian:n_events=%d",n_events) { - /* Processing variable weights */ - weights_Dims[0]=n_events; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 3rd argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable scatt_events */ - scatt_events_Dims[0]=nirrqpt; - capi_scatt_events_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 4th argument `scatt_events`"; - capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); - if (capi_scatt_events_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 7th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 6th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 11st argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 12nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 13rd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable smear_id */ - smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; - capi_smear_id_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 14th argument `smear_id`"; - capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); - if (capi_smear_id_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); - - /* Processing variable lineshapes */ - lineshapes_Dims[0]=nirrqpt,lineshapes_Dims[1]=3 * nat,lineshapes_Dims[2]=3 * nat,lineshapes_Dims[3]=ne; - capi_lineshapes_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the hidden `lineshapes`"; - capi_lineshapes_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lineshapes_Dims,lineshapes_Rank, capi_lineshapes_intent,Py_None,capi_errmess); - if (capi_lineshapes_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lineshapes = (complex_double *)(PyArray_DATA(capi_lineshapes_as_array)); - - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lineshapes_cartesian() 5th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lineshapes_cartesian:nfc3=%d",nfc3) { - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 8th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lineshapes_cartesian: failed to create array from the 9th argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,lineshapes); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lineshapes_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /* if (capi_lineshapes_as_array == NULL) ... else of lineshapes */ - /* End of cleaning variable lineshapes */ - if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { - Py_XDECREF(capi_smear_id_as_array); } - } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ - /* End of cleaning variable smear_id */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { - Py_XDECREF(capi_scatt_events_as_array); } - } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ - /* End of cleaning variable scatt_events */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ - } /*if (f2py_success) of n_events*/ - /* End of cleaning variable n_events */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_rprim_as_array!=rprim_capi) { - Py_XDECREF(capi_rprim_as_array); } - } /* if (capi_rprim_as_array == NULL) ... else of rprim */ - /* End of cleaning variable rprim */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************* end of calculate_lineshapes_cartesian *******************/ - -/******************** calculate_lifetimes_selfconsistently ********************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently[] = "\ -selfengs = calculate_lifetimes_selfconsistently(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,t,gaussian,classical,energies,[ne,nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lifetimes_selfconsistently``.\ -\n\nParameters\n----------\n" -"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" -"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" -"weights : input rank-1 array('i') with bounds (n_events)\n" -"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"rprim : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"smear_id : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"t : input float\n" -"gaussian : input int\n" -"classical : input int\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"n_events : input int, optional\n Default: shape(qgrid, 1)\n" -"\nReturns\n-------\n" -"selfengs : rank-2 array('D') with bounds (nirrqpt,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,double*,int*,int*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - int *scatt_events = NULL; - npy_intp scatt_events_Dims[1] = {-1}; - const int scatt_events_Rank = 1; - PyArrayObject *capi_scatt_events_as_array = NULL; - int capi_scatt_events_intent = 0; - PyObject *scatt_events_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *rprim = NULL; - npy_intp rprim_Dims[2] = {-1, -1}; - const int rprim_Rank = 2; - PyArrayObject *capi_rprim_as_array = NULL; - int capi_rprim_intent = 0; - PyObject *rprim_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[2] = {-1, -1}; - const int smear_Rank = 2; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double *smear_id = NULL; - npy_intp smear_id_Dims[2] = {-1, -1}; - const int smear_id_Rank = 2; - PyArrayObject *capi_smear_id_as_array = NULL; - int capi_smear_id_intent = 0; - PyObject *smear_id_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int n_events = 0; - PyObject *n_events_capi = Py_None; - complex_double *selfengs = NULL; - npy_intp selfengs_Dims[2] = {-1, -1}; - const int selfengs_Rank = 2; - PyArrayObject *capi_selfengs_as_array = NULL; - int capi_selfengs_intent = 0; - static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","smear_id","t","gaussian","classical","energies","ne","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOO|OOOOOO:thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently",\ - capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&smear_id_capi,&t_capi,&gaussian_capi,&classical_capi,&energies_capi,&ne_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable irrqgrid */ - irrqgrid_Dims[0]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 1st argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 2nd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 5th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable rprim */ - rprim_Dims[0]=3,rprim_Dims[1]=3; - capi_rprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 10th argument `rprim`"; - capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); - if (capi_rprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 18th argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 15th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 2nd keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","2nd keyword nirrqpt","calculate_lifetimes_selfconsistently:nirrqpt=%d",nirrqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 3rd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","3rd keyword nat","calculate_lifetimes_selfconsistently:nat=%d",nat) { - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 4th keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","4th keyword nfc2","calculate_lifetimes_selfconsistently:nfc2=%d",nfc2) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","calculate_lifetimes_selfconsistently:ne=%d",ne) { - /* Processing variable n_events */ - if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 6th keyword (n_events) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","6th keyword n_events","calculate_lifetimes_selfconsistently:n_events=%d",n_events) { - /* Processing variable weights */ - weights_Dims[0]=n_events; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 3rd argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable scatt_events */ - scatt_events_Dims[0]=nirrqpt; - capi_scatt_events_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 4th argument `scatt_events`"; - capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); - if (capi_scatt_events_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 7th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 6th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 11st argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 12nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 13rd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable smear_id */ - smear_id_Dims[0]=3 * nat,smear_id_Dims[1]=nirrqpt; - capi_smear_id_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 14th argument `smear_id`"; - capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); - if (capi_smear_id_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); - - /* Processing variable selfengs */ - selfengs_Dims[0]=nirrqpt,selfengs_Dims[1]=3 * nat; - capi_selfengs_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the hidden `selfengs`"; - capi_selfengs_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfengs_Dims,selfengs_Rank, capi_selfengs_intent,Py_None,capi_errmess); - if (capi_selfengs_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfengs = (complex_double *)(PyArray_DATA(capi_selfengs_as_array)); - - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently() 5th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","5th keyword nfc3","calculate_lifetimes_selfconsistently:nfc3=%d",nfc3) { - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 8th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_selfconsistently: failed to create array from the 9th argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,smear_id,&t,&gaussian,&classical,energies,&ne,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,selfengs); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_selfengs_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /* if (capi_selfengs_as_array == NULL) ... else of selfengs */ - /* End of cleaning variable selfengs */ - if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { - Py_XDECREF(capi_smear_id_as_array); } - } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ - /* End of cleaning variable smear_id */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { - Py_XDECREF(capi_scatt_events_as_array); } - } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ - /* End of cleaning variable scatt_events */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ - } /*if (f2py_success) of n_events*/ - /* End of cleaning variable n_events */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_rprim_as_array!=rprim_capi) { - Py_XDECREF(capi_rprim_as_array); } - } /* if (capi_rprim_as_array == NULL) ... else of rprim */ - /* End of cleaning variable rprim */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************** end of calculate_lifetimes_selfconsistently ****************/ - -/*********************** solve_selfconsistent_equation ***********************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation[] = "\ -solve_selfconsistent_equation(w_q,self_energy,energies,tau,omega,[ne,nband])\n\nWrapper for ``solve_selfconsistent_equation``.\ -\n\nParameters\n----------\n" -"w_q : input rank-1 array('d') with bounds (nband)\n" -"self_energy : input rank-2 array('D') with bounds (ne,nband)\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"tau : in/output rank-1 array('d') with bounds (nband)\n" -"omega : in/output rank-1 array('d') with bounds (nband)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(self_energy, 0)\n" -"nband : input int, optional\n Default: shape(w_q, 0)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,double*,complex_double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - int nband = 0; - PyObject *nband_capi = Py_None; - double *w_q = NULL; - npy_intp w_q_Dims[1] = {-1}; - const int w_q_Rank = 1; - PyArrayObject *capi_w_q_as_array = NULL; - int capi_w_q_intent = 0; - PyObject *w_q_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[2] = {-1, -1}; - const int self_energy_Rank = 2; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - PyObject *self_energy_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[1] = {-1}; - const int tau_Rank = 1; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *omega = NULL; - npy_intp omega_Dims[1] = {-1}; - const int omega_Rank = 1; - PyArrayObject *capi_omega_as_array = NULL; - int capi_omega_intent = 0; - PyObject *omega_capi = Py_None; - static char *capi_kwlist[] = {"w_q","self_energy","energies","tau","omega","ne","nband",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:thermal_conductivity.get_lf.solve_selfconsistent_equation",\ - capi_kwlist,&w_q_capi,&self_energy_capi,&energies_capi,&tau_capi,&omega_capi,&ne_capi,&nband_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_q */ - ; - capi_w_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 1st argument `w_q`"; - capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); - if (capi_w_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); - - /* Processing variable nband */ - if (nband_capi == Py_None) nband = shape(w_q, 0); else - f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.solve_selfconsistent_equation() 2nd keyword (nband) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_q, 0) == nband,"shape(w_q, 0) == nband","2nd keyword nband","solve_selfconsistent_equation:nband=%d",nband) { - /* Processing variable self_energy */ - self_energy_Dims[1]=nband; - capi_self_energy_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 2nd argument `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable tau */ - tau_Dims[0]=nband; - capi_tau_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 4th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable omega */ - omega_Dims[0]=nband; - capi_omega_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 5th argument `omega`"; - capi_omega_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,omega_Dims,omega_Rank, capi_omega_intent,omega_capi,capi_errmess); - if (capi_omega_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - omega = (double *)(PyArray_DATA(capi_omega_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(self_energy, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.solve_selfconsistent_equation() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","solve_selfconsistent_equation:ne=%d",ne) { - /* Processing variable energies */ - energies_Dims[0]=ne; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.solve_selfconsistent_equation: failed to create array from the 3rd argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,&nband,w_q,self_energy,energies,tau,omega); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_omega_as_array!=omega_capi) { - Py_XDECREF(capi_omega_as_array); } - } /* if (capi_omega_as_array == NULL) ... else of omega */ - /* End of cleaning variable omega */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { - Py_XDECREF(capi_self_energy_as_array); } - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ - } /*CHECKSCALAR(shape(w_q, 0) == nband)*/ - } /*if (f2py_success) of nband*/ - /* End of cleaning variable nband */ - if((PyObject *)capi_w_q_as_array!=w_q_capi) { - Py_XDECREF(capi_w_q_as_array); } - } /* if (capi_w_q_as_array == NULL) ... else of w_q */ - /* End of cleaning variable w_q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of solve_selfconsistent_equation ********************/ - -/*********************** calculate_correlation_function ***********************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function[] = "\ -calculate_correlation_function(energies,w_q,self_energy,lineshape,[nat,ne])\n\nWrapper for ``calculate_correlation_function``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"w_q : input rank-1 array('d') with bounds (3 * nat)\n" -"self_energy : input rank-2 array('D') with bounds (ne,3 * nat)\n" -"lineshape : in/output rank-2 array('d') with bounds (ne,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" -"ne : input int, optional\n Default: shape(energies, 0)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *w_q = NULL; - npy_intp w_q_Dims[1] = {-1}; - const int w_q_Rank = 1; - PyArrayObject *capi_w_q_as_array = NULL; - int capi_w_q_intent = 0; - PyObject *w_q_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[2] = {-1, -1}; - const int self_energy_Rank = 2; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - PyObject *self_energy_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *lineshape = NULL; - npy_intp lineshape_Dims[2] = {-1, -1}; - const int lineshape_Rank = 2; - PyArrayObject *capi_lineshape_as_array = NULL; - int capi_lineshape_intent = 0; - PyObject *lineshape_capi = Py_None; - static char *capi_kwlist[] = {"energies","w_q","self_energy","lineshape","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|OO:thermal_conductivity.get_lf.calculate_correlation_function",\ - capi_kwlist,&energies_capi,&w_q_capi,&self_energy_capi,&lineshape_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_q */ - ; - capi_w_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 2nd argument `w_q`"; - capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); - if (capi_w_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_correlation_function() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","1st keyword nat","calculate_correlation_function:nat=%d",nat) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_correlation_function() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","2nd keyword ne","calculate_correlation_function:ne=%d",ne) { - /* Processing variable self_energy */ - self_energy_Dims[0]=ne,self_energy_Dims[1]=3 * nat; - capi_self_energy_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 3rd argument `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable lineshape */ - lineshape_Dims[0]=ne,lineshape_Dims[1]=3 * nat; - capi_lineshape_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_correlation_function: failed to create array from the 4th argument `lineshape`"; - capi_lineshape_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,lineshape_Dims,lineshape_Rank, capi_lineshape_intent,lineshape_capi,capi_errmess); - if (capi_lineshape_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lineshape = (double *)(PyArray_DATA(capi_lineshape_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(energies,w_q,self_energy,&nat,&ne,lineshape); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_lineshape_as_array!=lineshape_capi) { - Py_XDECREF(capi_lineshape_as_array); } - } /* if (capi_lineshape_as_array == NULL) ... else of lineshape */ - /* End of cleaning variable lineshape */ - if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { - Py_XDECREF(capi_self_energy_as_array); } - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_w_q_as_array!=w_q_capi) { - Py_XDECREF(capi_w_q_as_array); } - } /* if (capi_w_q_as_array == NULL) ... else of w_q */ - /* End of cleaning variable w_q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************* end of calculate_correlation_function *******************/ - -/********************** calculate_lifetimes_perturbative **********************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative[] = "\ -self_energies = calculate_lifetimes_perturbative(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,t,gaussian,classical,[nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lifetimes_perturbative``.\ -\n\nParameters\n----------\n" -"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" -"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" -"weights : input rank-1 array('i') with bounds (n_events)\n" -"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"rprim : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"t : input float\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"n_events : input int, optional\n Default: shape(qgrid, 1)\n" -"\nReturns\n-------\n" -"self_energies : rank-2 array('D') with bounds (nirrqpt,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - int *scatt_events = NULL; - npy_intp scatt_events_Dims[1] = {-1}; - const int scatt_events_Rank = 1; - PyArrayObject *capi_scatt_events_as_array = NULL; - int capi_scatt_events_intent = 0; - PyObject *scatt_events_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *rprim = NULL; - npy_intp rprim_Dims[2] = {-1, -1}; - const int rprim_Rank = 2; - PyArrayObject *capi_rprim_as_array = NULL; - int capi_rprim_intent = 0; - PyObject *rprim_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[2] = {-1, -1}; - const int smear_Rank = 2; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int n_events = 0; - PyObject *n_events_capi = Py_None; - complex_double *self_energies = NULL; - npy_intp self_energies_Dims[2] = {-1, -1}; - const int self_energies_Rank = 2; - PyArrayObject *capi_self_energies_as_array = NULL; - int capi_self_energies_intent = 0; - static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","t","gaussian","classical","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_lifetimes_perturbative",\ - capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&t_capi,&gaussian_capi,&classical_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable irrqgrid */ - irrqgrid_Dims[0]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 1st argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 2nd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 5th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable rprim */ - rprim_Dims[0]=3,rprim_Dims[1]=3; - capi_rprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 10th argument `rprim`"; - capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); - if (capi_rprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 14th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 1st keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","1st keyword nirrqpt","calculate_lifetimes_perturbative:nirrqpt=%d",nirrqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","2nd keyword nat","calculate_lifetimes_perturbative:nat=%d",nat) { - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 3rd keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_lifetimes_perturbative:nfc2=%d",nfc2) { - /* Processing variable n_events */ - if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 5th keyword (n_events) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","5th keyword n_events","calculate_lifetimes_perturbative:n_events=%d",n_events) { - /* Processing variable weights */ - weights_Dims[0]=n_events; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 3rd argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable scatt_events */ - scatt_events_Dims[0]=nirrqpt; - capi_scatt_events_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 4th argument `scatt_events`"; - capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); - if (capi_scatt_events_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 7th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 6th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 11st argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 12nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 13rd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable self_energies */ - self_energies_Dims[0]=nirrqpt,self_energies_Dims[1]=3 * nat; - capi_self_energies_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the hidden `self_energies`"; - capi_self_energies_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energies_Dims,self_energies_Rank, capi_self_energies_intent,Py_None,capi_errmess); - if (capi_self_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energies = (complex_double *)(PyArray_DATA(capi_self_energies_as_array)); - - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lifetimes_perturbative() 4th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_lifetimes_perturbative:nfc3=%d",nfc3) { - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 8th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes_perturbative: failed to create array from the 9th argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,&t,&gaussian,&classical,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,self_energies); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_self_energies_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /* if (capi_self_energies_as_array == NULL) ... else of self_energies */ - /* End of cleaning variable self_energies */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { - Py_XDECREF(capi_scatt_events_as_array); } - } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ - /* End of cleaning variable scatt_events */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ - } /*if (f2py_success) of n_events*/ - /* End of cleaning variable n_events */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_rprim_as_array!=rprim_capi) { - Py_XDECREF(capi_rprim_as_array); } - } /* if (capi_rprim_as_array == NULL) ... else of rprim */ - /* End of cleaning variable rprim */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************** end of calculate_lifetimes_perturbative ******************/ - -/**************************** calculate_lifetimes ****************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes[] = "\ -self_energies = calculate_lifetimes(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,t,gaussian,classical,[nirrqpt,nat,nfc2,nfc3,n_events])\n\nWrapper for ``calculate_lifetimes``.\ -\n\nParameters\n----------\n" -"irrqgrid : input rank-2 array('d') with bounds (3,nirrqpt)\n" -"qgrid : input rank-2 array('d') with bounds (3,n_events)\n" -"weights : input rank-1 array('i') with bounds (n_events)\n" -"scatt_events : input rank-1 array('i') with bounds (nirrqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"rprim : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-2 array('d') with bounds (3 * nat,nirrqpt)\n" -"t : input float\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 1)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"n_events : input int, optional\n Default: shape(qgrid, 1)\n" -"\nReturns\n-------\n" -"self_energies : rank-2 array('D') with bounds (nirrqpt,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - int *scatt_events = NULL; - npy_intp scatt_events_Dims[1] = {-1}; - const int scatt_events_Rank = 1; - PyArrayObject *capi_scatt_events_as_array = NULL; - int capi_scatt_events_intent = 0; - PyObject *scatt_events_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *rprim = NULL; - npy_intp rprim_Dims[2] = {-1, -1}; - const int rprim_Rank = 2; - PyArrayObject *capi_rprim_as_array = NULL; - int capi_rprim_intent = 0; - PyObject *rprim_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[2] = {-1, -1}; - const int smear_Rank = 2; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int n_events = 0; - PyObject *n_events_capi = Py_None; - complex_double *self_energies = NULL; - npy_intp self_energies_Dims[2] = {-1, -1}; - const int self_energies_Rank = 2; - PyArrayObject *capi_self_energies_as_array = NULL; - int capi_self_energies_intent = 0; - static char *capi_kwlist[] = {"irrqgrid","qgrid","weights","scatt_events","fc2","r2_2","fc3","r3_2","r3_3","rprim","pos","masses","smear","t","gaussian","classical","nirrqpt","nat","nfc2","nfc3","n_events",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_lifetimes",\ - capi_kwlist,&irrqgrid_capi,&qgrid_capi,&weights_capi,&scatt_events_capi,&fc2_capi,&r2_2_capi,&fc3_capi,&r3_2_capi,&r3_3_capi,&rprim_capi,&pos_capi,&masses_capi,&smear_capi,&t_capi,&gaussian_capi,&classical_capi,&nirrqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&n_events_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable irrqgrid */ - irrqgrid_Dims[0]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 1st argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 2nd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 5th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable rprim */ - rprim_Dims[0]=3,rprim_Dims[1]=3; - capi_rprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 10th argument `rprim`"; - capi_rprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rprim_Dims,rprim_Rank, capi_rprim_intent,rprim_capi,capi_errmess); - if (capi_rprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rprim = (double *)(PyArray_DATA(capi_rprim_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 14th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 1); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 1st keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt,"shape(irrqgrid, 1) == nirrqpt","1st keyword nirrqpt","calculate_lifetimes:nirrqpt=%d",nirrqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","2nd keyword nat","calculate_lifetimes:nat=%d",nat) { - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 3rd keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_lifetimes:nfc2=%d",nfc2) { - /* Processing variable n_events */ - if (n_events_capi == Py_None) n_events = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&n_events,n_events_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 5th keyword (n_events) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == n_events,"shape(qgrid, 1) == n_events","5th keyword n_events","calculate_lifetimes:n_events=%d",n_events) { - /* Processing variable weights */ - weights_Dims[0]=n_events; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 3rd argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable scatt_events */ - scatt_events_Dims[0]=nirrqpt; - capi_scatt_events_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 4th argument `scatt_events`"; - capi_scatt_events_as_array = ndarray_from_pyobj( NPY_INT,1,scatt_events_Dims,scatt_events_Rank, capi_scatt_events_intent,scatt_events_capi,capi_errmess); - if (capi_scatt_events_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_events = (int *)(PyArray_DATA(capi_scatt_events_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 7th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 6th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 11st argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 12nd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat,smear_Dims[1]=nirrqpt; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 13rd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable self_energies */ - self_energies_Dims[0]=nirrqpt,self_energies_Dims[1]=3 * nat; - capi_self_energies_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the hidden `self_energies`"; - capi_self_energies_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energies_Dims,self_energies_Rank, capi_self_energies_intent,Py_None,capi_errmess); - if (capi_self_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energies = (complex_double *)(PyArray_DATA(capi_self_energies_as_array)); - - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_lifetimes() 4th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_lifetimes:nfc3=%d",nfc3) { - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 8th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_lifetimes: failed to create array from the 9th argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(irrqgrid,qgrid,weights,scatt_events,fc2,r2_2,fc3,r3_2,r3_3,rprim,pos,masses,smear,&t,&gaussian,&classical,&nirrqpt,&nat,&nfc2,&nfc3,&n_events,self_energies); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_self_energies_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /* if (capi_self_energies_as_array == NULL) ... else of self_energies */ - /* End of cleaning variable self_energies */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_scatt_events_as_array!=scatt_events_capi) { - Py_XDECREF(capi_scatt_events_as_array); } - } /* if (capi_scatt_events_as_array == NULL) ... else of scatt_events */ - /* End of cleaning variable scatt_events */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(qgrid, 1) == n_events)*/ - } /*if (f2py_success) of n_events*/ - /* End of cleaning variable n_events */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(irrqgrid, 1) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_rprim_as_array!=rprim_capi) { - Py_XDECREF(capi_rprim_as_array); } - } /* if (capi_rprim_as_array == NULL) ... else of rprim */ - /* End of cleaning variable rprim */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of calculate_lifetimes *************************/ - -/************************** calculate_self_energy_la **************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la[] = "\ -self_energy = calculate_self_energy_la(w_q,qpt,pols_q,is_q_gamma,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,t,parallelize,gaussian,classical,[nqpt,nat,nfc2,nfc3])\n\nWrapper for ``calculate_self_energy_la``.\ -\n\nParameters\n----------\n" -"w_q : input rank-1 array('d') with bounds (3 * nat)\n" -"qpt : input rank-1 array('d') with bounds (3)\n" -"pols_q : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"is_q_gamma : input int\n" -"qgrid : input rank-2 array('d') with bounds (3,nqpt)\n" -"weights : input rank-1 array('i') with bounds (nqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"kprim : input rank-2 array('d') with bounds (3,3)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"t : input float\n" -"parallelize : input int\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"nqpt : input int, optional\n Default: shape(qgrid, 1)\n" -"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"\nReturns\n-------\n" -"self_energy : rank-1 array('D') with bounds (3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,int*,int*,int*,int*,int*,double*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *w_q = NULL; - npy_intp w_q_Dims[1] = {-1}; - const int w_q_Rank = 1; - PyArrayObject *capi_w_q_as_array = NULL; - int capi_w_q_intent = 0; - PyObject *w_q_capi = Py_None; - double *qpt = NULL; - npy_intp qpt_Dims[1] = {-1}; - const int qpt_Rank = 1; - PyArrayObject *capi_qpt_as_array = NULL; - int capi_qpt_intent = 0; - PyObject *qpt_capi = Py_None; - complex_double *pols_q = NULL; - npy_intp pols_q_Dims[2] = {-1, -1}; - const int pols_q_Rank = 2; - PyArrayObject *capi_pols_q_as_array = NULL; - int capi_pols_q_intent = 0; - PyObject *pols_q_capi = Py_None; - int is_q_gamma = 0; - PyObject *is_q_gamma_capi = Py_None; - int nqpt = 0; - PyObject *nqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *kprim = NULL; - npy_intp kprim_Dims[2] = {-1, -1}; - const int kprim_Rank = 2; - PyArrayObject *capi_kprim_as_array = NULL; - int capi_kprim_intent = 0; - PyObject *kprim_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int parallelize = 0; - PyObject *parallelize_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[1] = {-1}; - const int self_energy_Rank = 1; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - static char *capi_kwlist[] = {"w_q","qpt","pols_q","is_q_gamma","qgrid","weights","fc2","fc3","r2_2","r3_2","r3_3","pos","kprim","masses","smear","t","parallelize","gaussian","classical","nqpt","nat","nfc2","nfc3",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOOO|OOOO:thermal_conductivity.get_lf.calculate_self_energy_la",\ - capi_kwlist,&w_q_capi,&qpt_capi,&pols_q_capi,&is_q_gamma_capi,&qgrid_capi,&weights_capi,&fc2_capi,&fc3_capi,&r2_2_capi,&r3_2_capi,&r3_3_capi,&pos_capi,&kprim_capi,&masses_capi,&smear_capi,&t_capi,¶llelize_capi,&gaussian_capi,&classical_capi,&nqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_q */ - ; - capi_w_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 1st argument `w_q`"; - capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); - if (capi_w_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); - - /* Processing variable qpt */ - qpt_Dims[0]=3; - capi_qpt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 2nd argument `qpt`"; - capi_qpt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qpt_Dims,qpt_Rank, capi_qpt_intent,qpt_capi,capi_errmess); - if (capi_qpt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qpt = (double *)(PyArray_DATA(capi_qpt_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 5th argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable kprim */ - kprim_Dims[0]=3,kprim_Dims[1]=3; - capi_kprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 13rd argument `kprim`"; - capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); - if (capi_kprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 16th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_q_gamma */ - is_q_gamma = (int)PyObject_IsTrue(is_q_gamma_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable parallelize */ - parallelize = (int)PyObject_IsTrue(parallelize_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nqpt */ - if (nqpt_capi == Py_None) nqpt = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 1st keyword (nqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == nqpt,"shape(qgrid, 1) == nqpt","1st keyword nqpt","calculate_self_energy_la:nqpt=%d",nqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","2nd keyword nat","calculate_self_energy_la:nat=%d",nat) { - /* Processing variable weights */ - weights_Dims[0]=nqpt; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 6th argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable fc2 */ - fc2_Dims[1]=3 * nat,fc2_Dims[2]=3 * nat; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 7th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 8th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 12nd argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 14th argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 15th argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable pols_q */ - pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; - capi_pols_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 3rd argument `pols_q`"; - capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,pols_q_capi,capi_errmess); - if (capi_pols_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); - - /* Processing variable self_energy */ - self_energy_Dims[0]=3 * nat; - capi_self_energy_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the hidden `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,Py_None,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 3rd keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_self_energy_la:nfc2=%d",nfc2) { - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_self_energy_la() 4th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_self_energy_la:nfc3=%d",nfc3) { - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 9th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 10th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_la: failed to create array from the 11st argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(w_q,qpt,pols_q,&is_q_gamma,&nqpt,&nat,&nfc2,&nfc3,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,&t,¶llelize,&gaussian,&classical,self_energy); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_self_energy_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ - if((PyObject *)capi_pols_q_as_array!=pols_q_capi) { - Py_XDECREF(capi_pols_q_as_array); } - } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ - /* End of cleaning variable pols_q */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(qgrid, 1) == nqpt)*/ - } /*if (f2py_success) of nqpt*/ - /* End of cleaning variable nqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of parallelize*/ - /* End of cleaning variable parallelize */ - } /*if (f2py_success) of is_q_gamma*/ - /* End of cleaning variable is_q_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_kprim_as_array!=kprim_capi) { - Py_XDECREF(capi_kprim_as_array); } - } /* if (capi_kprim_as_array == NULL) ... else of kprim */ - /* End of cleaning variable kprim */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_qpt_as_array!=qpt_capi) { - Py_XDECREF(capi_qpt_as_array); } - } /* if (capi_qpt_as_array == NULL) ... else of qpt */ - /* End of cleaning variable qpt */ - if((PyObject *)capi_w_q_as_array!=w_q_capi) { - Py_XDECREF(capi_w_q_as_array); } - } /* if (capi_w_q_as_array == NULL) ... else of w_q */ - /* End of cleaning variable w_q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************** end of calculate_self_energy_la **********************/ - -/************************** calculate_self_energy_p **************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p[] = "\ -self_energy = calculate_self_energy_p(w_q,qpt,pols_q,is_q_gamma,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,t,energies,parallelize,gaussian,classical,[nqpt,nat,nfc2,nfc3,ne])\n\nWrapper for ``calculate_self_energy_p``.\ -\n\nParameters\n----------\n" -"w_q : input rank-1 array('d') with bounds (3 * nat)\n" -"qpt : input rank-1 array('d') with bounds (3)\n" -"pols_q : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"is_q_gamma : input int\n" -"qgrid : input rank-2 array('d') with bounds (3,nqpt)\n" -"weights : input rank-1 array('i') with bounds (nqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"kprim : input rank-2 array('d') with bounds (3,3)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"t : input float\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"parallelize : input int\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"nqpt : input int, optional\n Default: shape(qgrid, 1)\n" -"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"\nReturns\n-------\n" -"self_energy : rank-2 array('D') with bounds (ne,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,int*,int*,int*,int*,int*,int*,double*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *w_q = NULL; - npy_intp w_q_Dims[1] = {-1}; - const int w_q_Rank = 1; - PyArrayObject *capi_w_q_as_array = NULL; - int capi_w_q_intent = 0; - PyObject *w_q_capi = Py_None; - double *qpt = NULL; - npy_intp qpt_Dims[1] = {-1}; - const int qpt_Rank = 1; - PyArrayObject *capi_qpt_as_array = NULL; - int capi_qpt_intent = 0; - PyObject *qpt_capi = Py_None; - complex_double *pols_q = NULL; - npy_intp pols_q_Dims[2] = {-1, -1}; - const int pols_q_Rank = 2; - PyArrayObject *capi_pols_q_as_array = NULL; - int capi_pols_q_intent = 0; - PyObject *pols_q_capi = Py_None; - int is_q_gamma = 0; - PyObject *is_q_gamma_capi = Py_None; - int nqpt = 0; - PyObject *nqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *kprim = NULL; - npy_intp kprim_Dims[2] = {-1, -1}; - const int kprim_Rank = 2; - PyArrayObject *capi_kprim_as_array = NULL; - int capi_kprim_intent = 0; - PyObject *kprim_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int parallelize = 0; - PyObject *parallelize_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[2] = {-1, -1}; - const int self_energy_Rank = 2; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - static char *capi_kwlist[] = {"w_q","qpt","pols_q","is_q_gamma","qgrid","weights","fc2","fc3","r2_2","r3_2","r3_3","pos","kprim","masses","smear","t","energies","parallelize","gaussian","classical","nqpt","nat","nfc2","nfc3","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_self_energy_p",\ - capi_kwlist,&w_q_capi,&qpt_capi,&pols_q_capi,&is_q_gamma_capi,&qgrid_capi,&weights_capi,&fc2_capi,&fc3_capi,&r2_2_capi,&r3_2_capi,&r3_3_capi,&pos_capi,&kprim_capi,&masses_capi,&smear_capi,&t_capi,&energies_capi,¶llelize_capi,&gaussian_capi,&classical_capi,&nqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_q */ - ; - capi_w_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 1st argument `w_q`"; - capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); - if (capi_w_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); - - /* Processing variable qpt */ - qpt_Dims[0]=3; - capi_qpt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 2nd argument `qpt`"; - capi_qpt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qpt_Dims,qpt_Rank, capi_qpt_intent,qpt_capi,capi_errmess); - if (capi_qpt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qpt = (double *)(PyArray_DATA(capi_qpt_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 5th argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable kprim */ - kprim_Dims[0]=3,kprim_Dims[1]=3; - capi_kprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 13rd argument `kprim`"; - capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); - if (capi_kprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 17th argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 16th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_q_gamma */ - is_q_gamma = (int)PyObject_IsTrue(is_q_gamma_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable parallelize */ - parallelize = (int)PyObject_IsTrue(parallelize_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nqpt */ - if (nqpt_capi == Py_None) nqpt = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 1st keyword (nqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == nqpt,"shape(qgrid, 1) == nqpt","1st keyword nqpt","calculate_self_energy_p:nqpt=%d",nqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","2nd keyword nat","calculate_self_energy_p:nat=%d",nat) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 5th keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","5th keyword ne","calculate_self_energy_p:ne=%d",ne) { - /* Processing variable weights */ - weights_Dims[0]=nqpt; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 6th argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable fc2 */ - fc2_Dims[1]=3 * nat,fc2_Dims[2]=3 * nat; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 7th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 8th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 12nd argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 14th argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 15th argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable pols_q */ - pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; - capi_pols_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 3rd argument `pols_q`"; - capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,pols_q_capi,capi_errmess); - if (capi_pols_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); - - /* Processing variable self_energy */ - self_energy_Dims[0]=ne,self_energy_Dims[1]=3 * nat; - capi_self_energy_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the hidden `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,Py_None,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 3rd keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_self_energy_p:nfc2=%d",nfc2) { - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_self_energy_p() 4th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_self_energy_p:nfc3=%d",nfc3) { - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 9th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 10th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_p: failed to create array from the 11st argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(w_q,qpt,pols_q,&is_q_gamma,&nqpt,&nat,&nfc2,&nfc3,&ne,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,&t,energies,¶llelize,&gaussian,&classical,self_energy); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_self_energy_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ - if((PyObject *)capi_pols_q_as_array!=pols_q_capi) { - Py_XDECREF(capi_pols_q_as_array); } - } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ - /* End of cleaning variable pols_q */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(qgrid, 1) == nqpt)*/ - } /*if (f2py_success) of nqpt*/ - /* End of cleaning variable nqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of parallelize*/ - /* End of cleaning variable parallelize */ - } /*if (f2py_success) of is_q_gamma*/ - /* End of cleaning variable is_q_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_kprim_as_array!=kprim_capi) { - Py_XDECREF(capi_kprim_as_array); } - } /* if (capi_kprim_as_array == NULL) ... else of kprim */ - /* End of cleaning variable kprim */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_qpt_as_array!=qpt_capi) { - Py_XDECREF(capi_qpt_as_array); } - } /* if (capi_qpt_as_array == NULL) ... else of qpt */ - /* End of cleaning variable qpt */ - if((PyObject *)capi_w_q_as_array!=w_q_capi) { - Py_XDECREF(capi_w_q_as_array); } - } /* if (capi_w_q_as_array == NULL) ... else of w_q */ - /* End of cleaning variable w_q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of calculate_self_energy_p ***********************/ - -/************************* calculate_self_energy_full *************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full[] = "\ -self_energy = calculate_self_energy_full(w_q,qpt,pols_q,is_q_gamma,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,t,energies,parallelize,gaussian,classical,[nqpt,nat,nfc2,nfc3,ne])\n\nWrapper for ``calculate_self_energy_full``.\ -\n\nParameters\n----------\n" -"w_q : input rank-1 array('d') with bounds (3 * nat)\n" -"qpt : input rank-1 array('d') with bounds (3)\n" -"pols_q : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"is_q_gamma : input int\n" -"qgrid : input rank-2 array('d') with bounds (3,nqpt)\n" -"weights : input rank-1 array('i') with bounds (nqpt)\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"fc3 : input rank-4 array('d') with bounds (nfc3,3 * nat,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"r3_2 : input rank-2 array('d') with bounds (3,nfc3)\n" -"r3_3 : input rank-2 array('d') with bounds (3,nfc3)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"kprim : input rank-2 array('d') with bounds (3,3)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"t : input float\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"parallelize : input int\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"nqpt : input int, optional\n Default: shape(qgrid, 1)\n" -"nat : input int, optional\n Default: shape(w_q, 0) / 3\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nfc3 : input int, optional\n Default: shape(fc3, 0)\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"\nReturns\n-------\n" -"self_energy : rank-3 array('D') with bounds (ne,3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,int*,int*,int*,int*,int*,int*,double*,int*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *w_q = NULL; - npy_intp w_q_Dims[1] = {-1}; - const int w_q_Rank = 1; - PyArrayObject *capi_w_q_as_array = NULL; - int capi_w_q_intent = 0; - PyObject *w_q_capi = Py_None; - double *qpt = NULL; - npy_intp qpt_Dims[1] = {-1}; - const int qpt_Rank = 1; - PyArrayObject *capi_qpt_as_array = NULL; - int capi_qpt_intent = 0; - PyObject *qpt_capi = Py_None; - complex_double *pols_q = NULL; - npy_intp pols_q_Dims[2] = {-1, -1}; - const int pols_q_Rank = 2; - PyArrayObject *capi_pols_q_as_array = NULL; - int capi_pols_q_intent = 0; - PyObject *pols_q_capi = Py_None; - int is_q_gamma = 0; - PyObject *is_q_gamma_capi = Py_None; - int nqpt = 0; - PyObject *nqpt_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nfc3 = 0; - PyObject *nfc3_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - int *weights = NULL; - npy_intp weights_Dims[1] = {-1}; - const int weights_Rank = 1; - PyArrayObject *capi_weights_as_array = NULL; - int capi_weights_intent = 0; - PyObject *weights_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *fc3 = NULL; - npy_intp fc3_Dims[4] = {-1, -1, -1, -1}; - const int fc3_Rank = 4; - PyArrayObject *capi_fc3_as_array = NULL; - int capi_fc3_intent = 0; - PyObject *fc3_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *r3_2 = NULL; - npy_intp r3_2_Dims[2] = {-1, -1}; - const int r3_2_Rank = 2; - PyArrayObject *capi_r3_2_as_array = NULL; - int capi_r3_2_intent = 0; - PyObject *r3_2_capi = Py_None; - double *r3_3 = NULL; - npy_intp r3_3_Dims[2] = {-1, -1}; - const int r3_3_Rank = 2; - PyArrayObject *capi_r3_3_as_array = NULL; - int capi_r3_3_intent = 0; - PyObject *r3_3_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *kprim = NULL; - npy_intp kprim_Dims[2] = {-1, -1}; - const int kprim_Rank = 2; - PyArrayObject *capi_kprim_as_array = NULL; - int capi_kprim_intent = 0; - PyObject *kprim_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int parallelize = 0; - PyObject *parallelize_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[3] = {-1, -1, -1}; - const int self_energy_Rank = 3; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - static char *capi_kwlist[] = {"w_q","qpt","pols_q","is_q_gamma","qgrid","weights","fc2","fc3","r2_2","r3_2","r3_3","pos","kprim","masses","smear","t","energies","parallelize","gaussian","classical","nqpt","nat","nfc2","nfc3","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOOOOOOOOOOOO|OOOOO:thermal_conductivity.get_lf.calculate_self_energy_full",\ - capi_kwlist,&w_q_capi,&qpt_capi,&pols_q_capi,&is_q_gamma_capi,&qgrid_capi,&weights_capi,&fc2_capi,&fc3_capi,&r2_2_capi,&r3_2_capi,&r3_3_capi,&pos_capi,&kprim_capi,&masses_capi,&smear_capi,&t_capi,&energies_capi,¶llelize_capi,&gaussian_capi,&classical_capi,&nqpt_capi,&nat_capi,&nfc2_capi,&nfc3_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable w_q */ - ; - capi_w_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 1st argument `w_q`"; - capi_w_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q_Dims,w_q_Rank, capi_w_q_intent,w_q_capi,capi_errmess); - if (capi_w_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q = (double *)(PyArray_DATA(capi_w_q_as_array)); - - /* Processing variable qpt */ - qpt_Dims[0]=3; - capi_qpt_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 2nd argument `qpt`"; - capi_qpt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qpt_Dims,qpt_Rank, capi_qpt_intent,qpt_capi,capi_errmess); - if (capi_qpt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qpt = (double *)(PyArray_DATA(capi_qpt_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[0]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 5th argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable kprim */ - kprim_Dims[0]=3,kprim_Dims[1]=3; - capi_kprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 13rd argument `kprim`"; - capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); - if (capi_kprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); - - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 17th argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 16th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_q_gamma */ - is_q_gamma = (int)PyObject_IsTrue(is_q_gamma_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable parallelize */ - parallelize = (int)PyObject_IsTrue(parallelize_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable nqpt */ - if (nqpt_capi == Py_None) nqpt = shape(qgrid, 1); else - f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 1st keyword (nqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 1) == nqpt,"shape(qgrid, 1) == nqpt","1st keyword nqpt","calculate_self_energy_full:nqpt=%d",nqpt) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(w_q, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w_q, 0) == 3 * nat,"shape(w_q, 0) == 3 * nat","2nd keyword nat","calculate_self_energy_full:nat=%d",nat) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 5th keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","5th keyword ne","calculate_self_energy_full:ne=%d",ne) { - /* Processing variable weights */ - weights_Dims[0]=nqpt; - capi_weights_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 6th argument `weights`"; - capi_weights_as_array = ndarray_from_pyobj( NPY_INT,1,weights_Dims,weights_Rank, capi_weights_intent,weights_capi,capi_errmess); - if (capi_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weights = (int *)(PyArray_DATA(capi_weights_as_array)); - - /* Processing variable fc2 */ - fc2_Dims[1]=3 * nat,fc2_Dims[2]=3 * nat; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 7th argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable fc3 */ - fc3_Dims[1]=3 * nat,fc3_Dims[2]=3 * nat,fc3_Dims[3]=3 * nat; - capi_fc3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 8th argument `fc3`"; - capi_fc3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc3_Dims,fc3_Rank, capi_fc3_intent,fc3_capi,capi_errmess); - if (capi_fc3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc3 = (double *)(PyArray_DATA(capi_fc3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 12nd argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 14th argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable smear */ - smear_Dims[0]=3 * nat; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 15th argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable pols_q */ - pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; - capi_pols_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 3rd argument `pols_q`"; - capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,pols_q_capi,capi_errmess); - if (capi_pols_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); - - /* Processing variable self_energy */ - self_energy_Dims[0]=ne,self_energy_Dims[1]=3 * nat,self_energy_Dims[2]=3 * nat; - capi_self_energy_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the hidden `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,Py_None,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 3rd keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","3rd keyword nfc2","calculate_self_energy_full:nfc2=%d",nfc2) { - /* Processing variable nfc3 */ - if (nfc3_capi == Py_None) nfc3 = shape(fc3, 0); else - f2py_success = int_from_pyobj(&nfc3,nfc3_capi,"thermal_conductivity.get_lf.calculate_self_energy_full() 4th keyword (nfc3) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc3, 0) == nfc3,"shape(fc3, 0) == nfc3","4th keyword nfc3","calculate_self_energy_full:nfc3=%d",nfc3) { - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 9th argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable r3_2 */ - r3_2_Dims[0]=3,r3_2_Dims[1]=nfc3; - capi_r3_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 10th argument `r3_2`"; - capi_r3_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_2_Dims,r3_2_Rank, capi_r3_2_intent,r3_2_capi,capi_errmess); - if (capi_r3_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_2 = (double *)(PyArray_DATA(capi_r3_2_as_array)); - - /* Processing variable r3_3 */ - r3_3_Dims[0]=3,r3_3_Dims[1]=nfc3; - capi_r3_3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_self_energy_full: failed to create array from the 11st argument `r3_3`"; - capi_r3_3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_3_Dims,r3_3_Rank, capi_r3_3_intent,r3_3_capi,capi_errmess); - if (capi_r3_3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3_3 = (double *)(PyArray_DATA(capi_r3_3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(w_q,qpt,pols_q,&is_q_gamma,&nqpt,&nat,&nfc2,&nfc3,&ne,qgrid,weights,fc2,fc3,r2_2,r3_2,r3_3,pos,kprim,masses,smear,&t,energies,¶llelize,&gaussian,&classical,self_energy); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_self_energy_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r3_3_as_array!=r3_3_capi) { - Py_XDECREF(capi_r3_3_as_array); } - } /* if (capi_r3_3_as_array == NULL) ... else of r3_3 */ - /* End of cleaning variable r3_3 */ - if((PyObject *)capi_r3_2_as_array!=r3_2_capi) { - Py_XDECREF(capi_r3_2_as_array); } - } /* if (capi_r3_2_as_array == NULL) ... else of r3_2 */ - /* End of cleaning variable r3_2 */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - } /*CHECKSCALAR(shape(fc3, 0) == nfc3)*/ - } /*if (f2py_success) of nfc3*/ - /* End of cleaning variable nfc3 */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ - if((PyObject *)capi_pols_q_as_array!=pols_q_capi) { - Py_XDECREF(capi_pols_q_as_array); } - } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ - /* End of cleaning variable pols_q */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_fc3_as_array!=fc3_capi) { - Py_XDECREF(capi_fc3_as_array); } - } /* if (capi_fc3_as_array == NULL) ... else of fc3 */ - /* End of cleaning variable fc3 */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ - if((PyObject *)capi_weights_as_array!=weights_capi) { - Py_XDECREF(capi_weights_as_array); } - } /* if (capi_weights_as_array == NULL) ... else of weights */ - /* End of cleaning variable weights */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(w_q, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(qgrid, 1) == nqpt)*/ - } /*if (f2py_success) of nqpt*/ - /* End of cleaning variable nqpt */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of parallelize*/ - /* End of cleaning variable parallelize */ - } /*if (f2py_success) of is_q_gamma*/ - /* End of cleaning variable is_q_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - if((PyObject *)capi_kprim_as_array!=kprim_capi) { - Py_XDECREF(capi_kprim_as_array); } - } /* if (capi_kprim_as_array == NULL) ... else of kprim */ - /* End of cleaning variable kprim */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_qpt_as_array!=qpt_capi) { - Py_XDECREF(capi_qpt_as_array); } - } /* if (capi_qpt_as_array == NULL) ... else of qpt */ - /* End of cleaning variable qpt */ - if((PyObject *)capi_w_q_as_array!=w_q_capi) { - Py_XDECREF(capi_w_q_as_array); } - } /* if (capi_w_q_as_array == NULL) ... else of w_q */ - /* End of cleaning variable w_q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of calculate_self_energy_full *********************/ - -/******************************* check_if_gamma *******************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_check_if_gamma[] = "\ -is_gamma = check_if_gamma(q,kprim,w2_q,[nat])\n\nWrapper for ``check_if_gamma``.\ -\n\nParameters\n----------\n" -"q : input rank-1 array('d') with bounds (3)\n" -"kprim : input rank-2 array('d') with bounds (3,3)\n" -"w2_q : in/output rank-1 array('d') with bounds (3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(w2_q, 0) / 3\n" -"\nReturns\n-------\n" -"is_gamma : int"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_check_if_gamma(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nat = 0; - PyObject *nat_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[1] = {-1}; - const int q_Rank = 1; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *kprim = NULL; - npy_intp kprim_Dims[2] = {-1, -1}; - const int kprim_Rank = 2; - PyArrayObject *capi_kprim_as_array = NULL; - int capi_kprim_intent = 0; - PyObject *kprim_capi = Py_None; - double *w2_q = NULL; - npy_intp w2_q_Dims[1] = {-1}; - const int w2_q_Rank = 1; - PyArrayObject *capi_w2_q_as_array = NULL; - int capi_w2_q_intent = 0; - PyObject *w2_q_capi = Py_None; - int is_gamma = 0; - static char *capi_kwlist[] = {"q","kprim","w2_q","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:thermal_conductivity.get_lf.check_if_gamma",\ - capi_kwlist,&q_capi,&kprim_capi,&w2_q_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.check_if_gamma: failed to create array from the 1st argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable kprim */ - kprim_Dims[0]=3,kprim_Dims[1]=3; - capi_kprim_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.check_if_gamma: failed to create array from the 2nd argument `kprim`"; - capi_kprim_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,kprim_Dims,kprim_Rank, capi_kprim_intent,kprim_capi,capi_errmess); - if (capi_kprim_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - kprim = (double *)(PyArray_DATA(capi_kprim_as_array)); - - /* Processing variable w2_q */ - ; - capi_w2_q_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.check_if_gamma: failed to create array from the 3rd argument `w2_q`"; - capi_w2_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w2_q_Dims,w2_q_Rank, capi_w2_q_intent,w2_q_capi,capi_errmess); - if (capi_w2_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w2_q = (double *)(PyArray_DATA(capi_w2_q_as_array)); - - /* Processing variable is_gamma */ - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(w2_q, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.check_if_gamma() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(w2_q, 0) == 3 * nat,"shape(w2_q, 0) == 3 * nat","1st keyword nat","check_if_gamma:nat=%d",nat) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nat,q,kprim,w2_q,&is_gamma); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",is_gamma); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(w2_q, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - /* End of cleaning variable is_gamma */ - if((PyObject *)capi_w2_q_as_array!=w2_q_capi) { - Py_XDECREF(capi_w2_q_as_array); } - } /* if (capi_w2_q_as_array == NULL) ... else of w2_q */ - /* End of cleaning variable w2_q */ - if((PyObject *)capi_kprim_as_array!=kprim_capi) { - Py_XDECREF(capi_kprim_as_array); } - } /* if (capi_kprim_as_array == NULL) ... else of kprim */ - /* End of cleaning variable kprim */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of check_if_gamma ***************************/ - -/******************************** vec_dot_mat ********************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_vec_dot_mat[] = "\ -v2 = vec_dot_mat(v1,m1)\n\nWrapper for ``vec_dot_mat``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (f2py_v1_d0)\n" -"m1 : input rank-2 array('d') with bounds (f2py_m1_d0,f2py_m1_d1)\n" -"\nReturns\n-------\n" -"v2 : rank-1 array('d') with bounds (size(v1)) and vec_dot_matf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_vec_dot_mat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *vec_dot_matf2pywrap = NULL; - npy_intp vec_dot_matf2pywrap_Dims[1] = {-1}; - const int vec_dot_matf2pywrap_Rank = 1; - PyArrayObject *capi_vec_dot_matf2pywrap_as_array = NULL; - int capi_vec_dot_matf2pywrap_intent = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *m1 = NULL; - npy_intp m1_Dims[2] = {-1, -1}; - const int m1_Rank = 2; - PyArrayObject *capi_m1_as_array = NULL; - int capi_m1_intent = 0; - PyObject *m1_capi = Py_None; - int f2py_v1_d0 = 0; - int f2py_m1_d0 = 0; - int f2py_m1_d1 = 0; - static char *capi_kwlist[] = {"v1","m1",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.get_lf.vec_dot_mat",\ - capi_kwlist,&v1_capi,&m1_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable m1 */ - ; - capi_m1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.vec_dot_mat: failed to create array from the 2nd argument `m1`"; - capi_m1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m1_Dims,m1_Rank, capi_m1_intent,m1_capi,capi_errmess); - if (capi_m1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m1 = (double *)(PyArray_DATA(capi_m1_as_array)); - - /* Processing variable v1 */ - ; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.vec_dot_mat: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable vec_dot_matf2pywrap */ - vec_dot_matf2pywrap_Dims[0]=size(v1); - capi_vec_dot_matf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.vec_dot_mat: failed to create array from the hidden `vec_dot_matf2pywrap`"; - capi_vec_dot_matf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,vec_dot_matf2pywrap_Dims,vec_dot_matf2pywrap_Rank, capi_vec_dot_matf2pywrap_intent,Py_None,capi_errmess); - if (capi_vec_dot_matf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - vec_dot_matf2pywrap = (double *)(PyArray_DATA(capi_vec_dot_matf2pywrap_as_array)); - - /* Processing variable f2py_v1_d0 */ - f2py_v1_d0 = shape(v1, 0); - /* Processing variable f2py_m1_d0 */ - f2py_m1_d0 = shape(m1, 0); - /* Processing variable f2py_m1_d1 */ - f2py_m1_d1 = shape(m1, 1); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(vec_dot_matf2pywrap,v1,m1,&f2py_v1_d0,&f2py_m1_d0,&f2py_m1_d1); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_vec_dot_matf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_m1_d1 */ - /* End of cleaning variable f2py_m1_d0 */ - /* End of cleaning variable f2py_v1_d0 */ - } /* if (capi_vec_dot_matf2pywrap_as_array == NULL) ... else of vec_dot_matf2pywrap */ - /* End of cleaning variable vec_dot_matf2pywrap */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ - if((PyObject *)capi_m1_as_array!=m1_capi) { - Py_XDECREF(capi_m1_as_array); } - } /* if (capi_m1_as_array == NULL) ... else of m1 */ - /* End of cleaning variable m1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of vec_dot_mat *****************************/ - -/******************* calculate_real_part_via_kramers_kronig *******************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig[] = "\ -calculate_real_part_via_kramers_kronig(self_energy,energies,freq,[ne,nband])\n\nWrapper for ``calculate_real_part_via_kramers_kronig``.\ -\n\nParameters\n----------\n" -"self_energy : in/output rank-2 array('D') with bounds (ne,nband)\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"freq : input rank-1 array('d') with bounds (nband)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(self_energy, 0)\n" -"nband : input int, optional\n Default: shape(self_energy, 1)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,complex_double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - int nband = 0; - PyObject *nband_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[2] = {-1, -1}; - const int self_energy_Rank = 2; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - PyObject *self_energy_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - static char *capi_kwlist[] = {"self_energy","energies","freq","ne","nband",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig",\ - capi_kwlist,&self_energy_capi,&energies_capi,&freq_capi,&ne_capi,&nband_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable self_energy */ - ; - capi_self_energy_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig: failed to create array from the 1st argument `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(self_energy, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","calculate_real_part_via_kramers_kronig:ne=%d",ne) { - /* Processing variable nband */ - if (nband_capi == Py_None) nband = shape(self_energy, 1); else - f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig() 2nd keyword (nband) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 1) == nband,"shape(self_energy, 1) == nband","2nd keyword nband","calculate_real_part_via_kramers_kronig:nband=%d",nband) { - /* Processing variable energies */ - energies_Dims[0]=ne; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig: failed to create array from the 2nd argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=nband; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig: failed to create array from the 3rd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,&nband,self_energy,energies,freq); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - } /*CHECKSCALAR(shape(self_energy, 1) == nband)*/ - } /*if (f2py_success) of nband*/ - /* End of cleaning variable nband */ - } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { - Py_XDECREF(capi_self_energy_as_array); } - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************** end of calculate_real_part_via_kramers_kronig ***************/ - -/***************** calculate_real_part_via_kramers_kronig_2d *****************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d[] = "\ -calculate_real_part_via_kramers_kronig_2d(self_energy,energies,freq,[ne,nband])\n\nWrapper for ``calculate_real_part_via_kramers_kronig_2d``.\ -\n\nParameters\n----------\n" -"self_energy : in/output rank-3 array('D') with bounds (ne,nband,nband)\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"freq : input rank-1 array('d') with bounds (nband)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(self_energy, 0)\n" -"nband : input int, optional\n Default: shape(self_energy, 1)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,complex_double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - int nband = 0; - PyObject *nband_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[3] = {-1, -1, -1}; - const int self_energy_Rank = 3; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - PyObject *self_energy_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - static char *capi_kwlist[] = {"self_energy","energies","freq","ne","nband",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d",\ - capi_kwlist,&self_energy_capi,&energies_capi,&freq_capi,&ne_capi,&nband_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable self_energy */ - ; - capi_self_energy_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d: failed to create array from the 1st argument `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(self_energy, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","calculate_real_part_via_kramers_kronig_2d:ne=%d",ne) { - /* Processing variable nband */ - if (nband_capi == Py_None) nband = shape(self_energy, 1); else - f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d() 2nd keyword (nband) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 1) == nband,"shape(self_energy, 1) == nband","2nd keyword nband","calculate_real_part_via_kramers_kronig_2d:nband=%d",nband) { - /* Processing variable energies */ - energies_Dims[0]=ne; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d: failed to create array from the 2nd argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=nband; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.calculate_real_part_via_kramers_kronig_2d: failed to create array from the 3rd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,&nband,self_energy,energies,freq); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - } /*CHECKSCALAR(shape(self_energy, 1) == nband)*/ - } /*if (f2py_success) of nband*/ - /* End of cleaning variable nband */ - } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { - Py_XDECREF(capi_self_energy_as_array); } - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************** end of calculate_real_part_via_kramers_kronig_2d **************/ - -/************************* hilbert_transform_via_fft *************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft[] = "\ -hilbert_transform_via_fft(self_energy,[ne,nband])\n\nWrapper for ``hilbert_transform_via_fft``.\ -\n\nParameters\n----------\n" -"self_energy : in/output rank-2 array('D') with bounds (ne,nband)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(self_energy, 0)\n" -"nband : input int, optional\n Default: shape(self_energy, 1)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - int nband = 0; - PyObject *nband_capi = Py_None; - complex_double *self_energy = NULL; - npy_intp self_energy_Dims[2] = {-1, -1}; - const int self_energy_Rank = 2; - PyArrayObject *capi_self_energy_as_array = NULL; - int capi_self_energy_intent = 0; - PyObject *self_energy_capi = Py_None; - static char *capi_kwlist[] = {"self_energy","ne","nband",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|OO:thermal_conductivity.get_lf.hilbert_transform_via_fft",\ - capi_kwlist,&self_energy_capi,&ne_capi,&nband_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable self_energy */ - ; - capi_self_energy_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.hilbert_transform_via_fft: failed to create array from the 1st argument `self_energy`"; - capi_self_energy_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,self_energy_Dims,self_energy_Rank, capi_self_energy_intent,self_energy_capi,capi_errmess); - if (capi_self_energy_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - self_energy = (complex_double *)(PyArray_DATA(capi_self_energy_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(self_energy, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.get_lf.hilbert_transform_via_fft() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 0) == ne,"shape(self_energy, 0) == ne","1st keyword ne","hilbert_transform_via_fft:ne=%d",ne) { - /* Processing variable nband */ - if (nband_capi == Py_None) nband = shape(self_energy, 1); else - f2py_success = int_from_pyobj(&nband,nband_capi,"thermal_conductivity.get_lf.hilbert_transform_via_fft() 2nd keyword (nband) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(self_energy, 1) == nband,"shape(self_energy, 1) == nband","2nd keyword nband","hilbert_transform_via_fft:nband=%d",nband) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,&nband,self_energy); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(self_energy, 1) == nband)*/ - } /*if (f2py_success) of nband*/ - /* End of cleaning variable nband */ - } /*CHECKSCALAR(shape(self_energy, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_self_energy_as_array!=self_energy_capi) { - Py_XDECREF(capi_self_energy_as_array); } - } /* if (capi_self_energy_as_array == NULL) ... else of self_energy */ - /* End of cleaning variable self_energy */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************** end of hilbert_transform_via_fft **********************/ - -/************************************* ht *************************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_ht[] = "\ -ht(x,[n])\n\nWrapper for ``ht``.\ -\n\nParameters\n----------\n" -"x : in/output rank-1 array('d') with bounds (n)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(x, 0)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_ht(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *x = NULL; - npy_intp x_Dims[1] = {-1}; - const int x_Rank = 1; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - int n = 0; - PyObject *n_capi = Py_None; - static char *capi_kwlist[] = {"x","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:thermal_conductivity.get_lf.ht",\ - capi_kwlist,&x_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - ; - capi_x_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.ht: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (double *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(x, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"thermal_conductivity.get_lf.ht() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(x, 0) == n,"shape(x, 0) == n","1st keyword n","ht:n=%d",n) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(x,&n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(x, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of ht *********************************/ - -/************************************ cfft ************************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_cfft[] = "\ -cfft(x,isig,[n])\n\nWrapper for ``cfft``.\ -\n\nParameters\n----------\n" -"x : in/output rank-1 array('D') with bounds (n)\n" -"isig : input int\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(x, 0)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_cfft(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *x = NULL; - npy_intp x_Dims[1] = {-1}; - const int x_Rank = 1; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - int n = 0; - PyObject *n_capi = Py_None; - int isig = 0; - PyObject *isig_capi = Py_None; - static char *capi_kwlist[] = {"x","isig","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thermal_conductivity.get_lf.cfft",\ - capi_kwlist,&x_capi,&isig_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable isig */ - f2py_success = int_from_pyobj(&isig,isig_capi,"thermal_conductivity.get_lf.cfft() 2nd argument (isig) can't be converted to int"); - if (f2py_success) { - /* Processing variable x */ - ; - capi_x_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.cfft: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (complex_double *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(x, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"thermal_conductivity.get_lf.cfft() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(x, 0) == n,"shape(x, 0) == n","1st keyword n","cfft:n=%d",n) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(x,&n,&isig); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(x, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ - } /*if (f2py_success) of isig*/ - /* End of cleaning variable isig */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of cfft ********************************/ - -/************************************ inv ************************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_inv[] = "\ -ainv = inv(a)\n\nWrapper for ``inv``.\ -\n\nParameters\n----------\n" -"a : input rank-2 array('d') with bounds (f2py_a_d0,f2py_a_d1)\n" -"\nReturns\n-------\n" -"ainv : rank-2 array('d') with bounds (size(a, 1),size(a, 2)) and invf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_inv(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *invf2pywrap = NULL; - npy_intp invf2pywrap_Dims[2] = {-1, -1}; - const int invf2pywrap_Rank = 2; - PyArrayObject *capi_invf2pywrap_as_array = NULL; - int capi_invf2pywrap_intent = 0; - double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int f2py_a_d0 = 0; - int f2py_a_d1 = 0; - static char *capi_kwlist[] = {"a",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thermal_conductivity.get_lf.inv",\ - capi_kwlist,&a_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.inv: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable invf2pywrap */ - invf2pywrap_Dims[0]=size(a, 1),invf2pywrap_Dims[1]=size(a, 2); - capi_invf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.inv: failed to create array from the hidden `invf2pywrap`"; - capi_invf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,invf2pywrap_Dims,invf2pywrap_Rank, capi_invf2pywrap_intent,Py_None,capi_errmess); - if (capi_invf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - invf2pywrap = (double *)(PyArray_DATA(capi_invf2pywrap_as_array)); - - /* Processing variable f2py_a_d0 */ - f2py_a_d0 = shape(a, 0); - /* Processing variable f2py_a_d1 */ - f2py_a_d1 = shape(a, 1); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(invf2pywrap,a,&f2py_a_d0,&f2py_a_d1); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_invf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_a_d1 */ - /* End of cleaning variable f2py_a_d0 */ - } /* if (capi_invf2pywrap_as_array == NULL) ... else of invf2pywrap */ - /* End of cleaning variable invf2pywrap */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of inv *********************************/ - -/****************************** interpolate_fc2 ******************************/ -static char doc_f2py_rout_thermal_conductivity_get_lf_interpolate_fc2[] = "\ -w2_q,pols_q,pols_q1 = interpolate_fc2(fc2,r2_2,masses,pos,q,[nfc2,nat])\n\nWrapper for ``interpolate_fc2``.\ -\n\nParameters\n----------\n" -"fc2 : input rank-3 array('d') with bounds (nfc2,3 * nat,3 * nat)\n" -"r2_2 : input rank-2 array('d') with bounds (3,nfc2)\n" -"masses : input rank-1 array('d') with bounds (nat)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"q : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"nfc2 : input int, optional\n Default: shape(fc2, 0)\n" -"nat : input int, optional\n Default: shape(fc2, 1) / 3\n" -"\nReturns\n-------\n" -"w2_q : rank-1 array('d') with bounds (3 * nat)\n" -"pols_q : rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"pols_q1 : rank-2 array('D') with bounds (3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_get_lf_interpolate_fc2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,double*,double*,double*,double*,double*,double*,complex_double*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nfc2 = 0; - PyObject *nfc2_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double *fc2 = NULL; - npy_intp fc2_Dims[3] = {-1, -1, -1}; - const int fc2_Rank = 3; - PyArrayObject *capi_fc2_as_array = NULL; - int capi_fc2_intent = 0; - PyObject *fc2_capi = Py_None; - double *r2_2 = NULL; - npy_intp r2_2_Dims[2] = {-1, -1}; - const int r2_2_Rank = 2; - PyArrayObject *capi_r2_2_as_array = NULL; - int capi_r2_2_intent = 0; - PyObject *r2_2_capi = Py_None; - double *masses = NULL; - npy_intp masses_Dims[1] = {-1}; - const int masses_Rank = 1; - PyArrayObject *capi_masses_as_array = NULL; - int capi_masses_intent = 0; - PyObject *masses_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *q = NULL; - npy_intp q_Dims[1] = {-1}; - const int q_Rank = 1; - PyArrayObject *capi_q_as_array = NULL; - int capi_q_intent = 0; - PyObject *q_capi = Py_None; - double *w2_q = NULL; - npy_intp w2_q_Dims[1] = {-1}; - const int w2_q_Rank = 1; - PyArrayObject *capi_w2_q_as_array = NULL; - int capi_w2_q_intent = 0; - complex_double *pols_q = NULL; - npy_intp pols_q_Dims[2] = {-1, -1}; - const int pols_q_Rank = 2; - PyArrayObject *capi_pols_q_as_array = NULL; - int capi_pols_q_intent = 0; - complex_double *pols_q1 = NULL; - npy_intp pols_q1_Dims[2] = {-1, -1}; - const int pols_q1_Rank = 2; - PyArrayObject *capi_pols_q1_as_array = NULL; - int capi_pols_q1_intent = 0; - static char *capi_kwlist[] = {"fc2","r2_2","masses","pos","q","nfc2","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:thermal_conductivity.get_lf.interpolate_fc2",\ - capi_kwlist,&fc2_capi,&r2_2_capi,&masses_capi,&pos_capi,&q_capi,&nfc2_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc2 */ - ; - capi_fc2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 1st argument `fc2`"; - capi_fc2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc2_Dims,fc2_Rank, capi_fc2_intent,fc2_capi,capi_errmess); - if (capi_fc2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc2 = (double *)(PyArray_DATA(capi_fc2_as_array)); - - /* Processing variable q */ - q_Dims[0]=3; - capi_q_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 5th argument `q`"; - capi_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q_Dims,q_Rank, capi_q_intent,q_capi,capi_errmess); - if (capi_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q = (double *)(PyArray_DATA(capi_q_as_array)); - - /* Processing variable nfc2 */ - if (nfc2_capi == Py_None) nfc2 = shape(fc2, 0); else - f2py_success = int_from_pyobj(&nfc2,nfc2_capi,"thermal_conductivity.get_lf.interpolate_fc2() 1st keyword (nfc2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 0) == nfc2,"shape(fc2, 0) == nfc2","1st keyword nfc2","interpolate_fc2:nfc2=%d",nfc2) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc2, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.get_lf.interpolate_fc2() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc2, 1) == 3 * nat,"shape(fc2, 1) == 3 * nat","2nd keyword nat","interpolate_fc2:nat=%d",nat) { - /* Processing variable r2_2 */ - r2_2_Dims[0]=3,r2_2_Dims[1]=nfc2; - capi_r2_2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 2nd argument `r2_2`"; - capi_r2_2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_2_Dims,r2_2_Rank, capi_r2_2_intent,r2_2_capi,capi_errmess); - if (capi_r2_2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2_2 = (double *)(PyArray_DATA(capi_r2_2_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 4th argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable masses */ - masses_Dims[0]=nat; - capi_masses_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the 3rd argument `masses`"; - capi_masses_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,masses_Dims,masses_Rank, capi_masses_intent,masses_capi,capi_errmess); - if (capi_masses_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - masses = (double *)(PyArray_DATA(capi_masses_as_array)); - - /* Processing variable w2_q */ - w2_q_Dims[0]=3 * nat; - capi_w2_q_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the hidden `w2_q`"; - capi_w2_q_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w2_q_Dims,w2_q_Rank, capi_w2_q_intent,Py_None,capi_errmess); - if (capi_w2_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w2_q = (double *)(PyArray_DATA(capi_w2_q_as_array)); - - /* Processing variable pols_q */ - pols_q_Dims[0]=3 * nat,pols_q_Dims[1]=3 * nat; - capi_pols_q_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the hidden `pols_q`"; - capi_pols_q_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q_Dims,pols_q_Rank, capi_pols_q_intent,Py_None,capi_errmess); - if (capi_pols_q_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pols_q = (complex_double *)(PyArray_DATA(capi_pols_q_as_array)); - - /* Processing variable pols_q1 */ - pols_q1_Dims[0]=3 * nat,pols_q1_Dims[1]=3 * nat; - capi_pols_q1_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.get_lf.interpolate_fc2: failed to create array from the hidden `pols_q1`"; - capi_pols_q1_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pols_q1_Dims,pols_q1_Rank, capi_pols_q1_intent,Py_None,capi_errmess); - if (capi_pols_q1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pols_q1 = (complex_double *)(PyArray_DATA(capi_pols_q1_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nfc2,&nat,fc2,r2_2,masses,pos,q,w2_q,pols_q,pols_q1); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNN",capi_w2_q_as_array,capi_pols_q_as_array,capi_pols_q1_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_pols_q1_as_array == NULL) ... else of pols_q1 */ - /* End of cleaning variable pols_q1 */ - } /* if (capi_pols_q_as_array == NULL) ... else of pols_q */ - /* End of cleaning variable pols_q */ - } /* if (capi_w2_q_as_array == NULL) ... else of w2_q */ - /* End of cleaning variable w2_q */ - if((PyObject *)capi_masses_as_array!=masses_capi) { - Py_XDECREF(capi_masses_as_array); } - } /* if (capi_masses_as_array == NULL) ... else of masses */ - /* End of cleaning variable masses */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r2_2_as_array!=r2_2_capi) { - Py_XDECREF(capi_r2_2_as_array); } - } /* if (capi_r2_2_as_array == NULL) ... else of r2_2 */ - /* End of cleaning variable r2_2 */ - } /*CHECKSCALAR(shape(fc2, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(fc2, 0) == nfc2)*/ - } /*if (f2py_success) of nfc2*/ - /* End of cleaning variable nfc2 */ - if((PyObject *)capi_q_as_array!=q_capi) { - Py_XDECREF(capi_q_as_array); } - } /* if (capi_q_as_array == NULL) ... else of q */ - /* End of cleaning variable q */ - if((PyObject *)capi_fc2_as_array!=fc2_capi) { - Py_XDECREF(capi_fc2_as_array); } - } /* if (capi_fc2_as_array == NULL) ... else of fc2 */ - /* End of cleaning variable fc2 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of interpolate_fc2 ***************************/ - -/*************************** get_scattering_q_grid ***************************/ -static char doc_f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid[] = "\ -scattering_grid,scattering_weights = get_scattering_q_grid(rotations,irrqgrid,qgrid,scatt_qgrid,[nirrqpt,nqpt,scatt_nqpt,nsym])\n\nWrapper for ``get_scattering_q_grid``.\ -\n\nParameters\n----------\n" -"rotations : input rank-3 array('d') with bounds (nsym,3,3)\n" -"irrqgrid : input rank-2 array('d') with bounds (nirrqpt,3)\n" -"qgrid : input rank-2 array('d') with bounds (nqpt,3)\n" -"scatt_qgrid : input rank-2 array('d') with bounds (scatt_nqpt,3)\n" -"\nOther Parameters\n----------------\n" -"nirrqpt : input int, optional\n Default: shape(irrqgrid, 0)\n" -"nqpt : input int, optional\n Default: shape(qgrid, 0)\n" -"scatt_nqpt : input int, optional\n Default: shape(scatt_qgrid, 0)\n" -"nsym : input int, optional\n Default: shape(rotations, 0)\n" -"\nReturns\n-------\n" -"scattering_grid : rank-3 array('d') with bounds (nirrqpt,scatt_nqpt,3)\n" -"scattering_weights : rank-2 array('i') with bounds (nirrqpt,scatt_nqpt)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,int*,int*,int*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *rotations = NULL; - npy_intp rotations_Dims[3] = {-1, -1, -1}; - const int rotations_Rank = 3; - PyArrayObject *capi_rotations_as_array = NULL; - int capi_rotations_intent = 0; - PyObject *rotations_capi = Py_None; - double *irrqgrid = NULL; - npy_intp irrqgrid_Dims[2] = {-1, -1}; - const int irrqgrid_Rank = 2; - PyArrayObject *capi_irrqgrid_as_array = NULL; - int capi_irrqgrid_intent = 0; - PyObject *irrqgrid_capi = Py_None; - double *qgrid = NULL; - npy_intp qgrid_Dims[2] = {-1, -1}; - const int qgrid_Rank = 2; - PyArrayObject *capi_qgrid_as_array = NULL; - int capi_qgrid_intent = 0; - PyObject *qgrid_capi = Py_None; - double *scatt_qgrid = NULL; - npy_intp scatt_qgrid_Dims[2] = {-1, -1}; - const int scatt_qgrid_Rank = 2; - PyArrayObject *capi_scatt_qgrid_as_array = NULL; - int capi_scatt_qgrid_intent = 0; - PyObject *scatt_qgrid_capi = Py_None; - int nirrqpt = 0; - PyObject *nirrqpt_capi = Py_None; - int nqpt = 0; - PyObject *nqpt_capi = Py_None; - int scatt_nqpt = 0; - PyObject *scatt_nqpt_capi = Py_None; - int nsym = 0; - PyObject *nsym_capi = Py_None; - double *scattering_grid = NULL; - npy_intp scattering_grid_Dims[3] = {-1, -1, -1}; - const int scattering_grid_Rank = 3; - PyArrayObject *capi_scattering_grid_as_array = NULL; - int capi_scattering_grid_intent = 0; - int *scattering_weights = NULL; - npy_intp scattering_weights_Dims[2] = {-1, -1}; - const int scattering_weights_Rank = 2; - PyArrayObject *capi_scattering_weights_as_array = NULL; - int capi_scattering_weights_intent = 0; - static char *capi_kwlist[] = {"rotations","irrqgrid","qgrid","scatt_qgrid","nirrqpt","nqpt","scatt_nqpt","nsym",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|OOOO:thermal_conductivity.scattering_grids.get_scattering_q_grid",\ - capi_kwlist,&rotations_capi,&irrqgrid_capi,&qgrid_capi,&scatt_qgrid_capi,&nirrqpt_capi,&nqpt_capi,&scatt_nqpt_capi,&nsym_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable rotations */ - rotations_Dims[1]=3,rotations_Dims[2]=3; - capi_rotations_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 1st argument `rotations`"; - capi_rotations_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rotations_Dims,rotations_Rank, capi_rotations_intent,rotations_capi,capi_errmess); - if (capi_rotations_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rotations = (double *)(PyArray_DATA(capi_rotations_as_array)); - - /* Processing variable irrqgrid */ - irrqgrid_Dims[1]=3; - capi_irrqgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 2nd argument `irrqgrid`"; - capi_irrqgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irrqgrid_Dims,irrqgrid_Rank, capi_irrqgrid_intent,irrqgrid_capi,capi_errmess); - if (capi_irrqgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irrqgrid = (double *)(PyArray_DATA(capi_irrqgrid_as_array)); - - /* Processing variable qgrid */ - qgrid_Dims[1]=3; - capi_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 3rd argument `qgrid`"; - capi_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,qgrid_Dims,qgrid_Rank, capi_qgrid_intent,qgrid_capi,capi_errmess); - if (capi_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - qgrid = (double *)(PyArray_DATA(capi_qgrid_as_array)); - - /* Processing variable scatt_qgrid */ - scatt_qgrid_Dims[1]=3; - capi_scatt_qgrid_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the 4th argument `scatt_qgrid`"; - capi_scatt_qgrid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,scatt_qgrid_Dims,scatt_qgrid_Rank, capi_scatt_qgrid_intent,scatt_qgrid_capi,capi_errmess); - if (capi_scatt_qgrid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scatt_qgrid = (double *)(PyArray_DATA(capi_scatt_qgrid_as_array)); - - /* Processing variable nirrqpt */ - if (nirrqpt_capi == Py_None) nirrqpt = shape(irrqgrid, 0); else - f2py_success = int_from_pyobj(&nirrqpt,nirrqpt_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 1st keyword (nirrqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(irrqgrid, 0) == nirrqpt,"shape(irrqgrid, 0) == nirrqpt","1st keyword nirrqpt","get_scattering_q_grid:nirrqpt=%d",nirrqpt) { - /* Processing variable nqpt */ - if (nqpt_capi == Py_None) nqpt = shape(qgrid, 0); else - f2py_success = int_from_pyobj(&nqpt,nqpt_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 2nd keyword (nqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(qgrid, 0) == nqpt,"shape(qgrid, 0) == nqpt","2nd keyword nqpt","get_scattering_q_grid:nqpt=%d",nqpt) { - /* Processing variable nsym */ - if (nsym_capi == Py_None) nsym = shape(rotations, 0); else - f2py_success = int_from_pyobj(&nsym,nsym_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 4th keyword (nsym) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(rotations, 0) == nsym,"shape(rotations, 0) == nsym","4th keyword nsym","get_scattering_q_grid:nsym=%d",nsym) { - /* Processing variable scatt_nqpt */ - if (scatt_nqpt_capi == Py_None) scatt_nqpt = shape(scatt_qgrid, 0); else - f2py_success = int_from_pyobj(&scatt_nqpt,scatt_nqpt_capi,"thermal_conductivity.scattering_grids.get_scattering_q_grid() 3rd keyword (scatt_nqpt) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(scatt_qgrid, 0) == scatt_nqpt,"shape(scatt_qgrid, 0) == scatt_nqpt","3rd keyword scatt_nqpt","get_scattering_q_grid:scatt_nqpt=%d",scatt_nqpt) { - /* Processing variable scattering_grid */ - scattering_grid_Dims[0]=nirrqpt,scattering_grid_Dims[1]=scatt_nqpt,scattering_grid_Dims[2]=3; - capi_scattering_grid_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the hidden `scattering_grid`"; - capi_scattering_grid_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,scattering_grid_Dims,scattering_grid_Rank, capi_scattering_grid_intent,Py_None,capi_errmess); - if (capi_scattering_grid_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scattering_grid = (double *)(PyArray_DATA(capi_scattering_grid_as_array)); - - /* Processing variable scattering_weights */ - scattering_weights_Dims[0]=nirrqpt,scattering_weights_Dims[1]=scatt_nqpt; - capi_scattering_weights_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.get_scattering_q_grid: failed to create array from the hidden `scattering_weights`"; - capi_scattering_weights_as_array = ndarray_from_pyobj( NPY_INT,1,scattering_weights_Dims,scattering_weights_Rank, capi_scattering_weights_intent,Py_None,capi_errmess); - if (capi_scattering_weights_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - scattering_weights = (int *)(PyArray_DATA(capi_scattering_weights_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(rotations,irrqgrid,qgrid,scatt_qgrid,&nirrqpt,&nqpt,&scatt_nqpt,&nsym,scattering_grid,scattering_weights); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NN",capi_scattering_grid_as_array,capi_scattering_weights_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_scattering_weights_as_array == NULL) ... else of scattering_weights */ - /* End of cleaning variable scattering_weights */ - } /* if (capi_scattering_grid_as_array == NULL) ... else of scattering_grid */ - /* End of cleaning variable scattering_grid */ - } /*CHECKSCALAR(shape(scatt_qgrid, 0) == scatt_nqpt)*/ - } /*if (f2py_success) of scatt_nqpt*/ - /* End of cleaning variable scatt_nqpt */ - } /*CHECKSCALAR(shape(rotations, 0) == nsym)*/ - } /*if (f2py_success) of nsym*/ - /* End of cleaning variable nsym */ - } /*CHECKSCALAR(shape(qgrid, 0) == nqpt)*/ - } /*if (f2py_success) of nqpt*/ - /* End of cleaning variable nqpt */ - } /*CHECKSCALAR(shape(irrqgrid, 0) == nirrqpt)*/ - } /*if (f2py_success) of nirrqpt*/ - /* End of cleaning variable nirrqpt */ - if((PyObject *)capi_scatt_qgrid_as_array!=scatt_qgrid_capi) { - Py_XDECREF(capi_scatt_qgrid_as_array); } - } /* if (capi_scatt_qgrid_as_array == NULL) ... else of scatt_qgrid */ - /* End of cleaning variable scatt_qgrid */ - if((PyObject *)capi_qgrid_as_array!=qgrid_capi) { - Py_XDECREF(capi_qgrid_as_array); } - } /* if (capi_qgrid_as_array == NULL) ... else of qgrid */ - /* End of cleaning variable qgrid */ - if((PyObject *)capi_irrqgrid_as_array!=irrqgrid_capi) { - Py_XDECREF(capi_irrqgrid_as_array); } - } /* if (capi_irrqgrid_as_array == NULL) ... else of irrqgrid */ - /* End of cleaning variable irrqgrid */ - if((PyObject *)capi_rotations_as_array!=rotations_capi) { - Py_XDECREF(capi_rotations_as_array); } - } /* if (capi_rotations_as_array == NULL) ... else of rotations */ - /* End of cleaning variable rotations */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of get_scattering_q_grid ************************/ - -/******************************** same_vector ********************************/ -static char doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector[] = "\ -same_vector = same_vector(v1,v2)\n\nWrapper for ``same_vector``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"same_vector : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_scattering_grids_same_vector(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int same_vectorf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.scattering_grids.same_vector",\ - capi_kwlist,&v1_capi,&v2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable same_vectorf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&same_vectorf2pywrap,v1,v2); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",same_vectorf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable same_vectorf2pywrap */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of same_vector *****************************/ - -/***************************** same_vector_nopbc *****************************/ -static char doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc[] = "\ -same_vector_nopbc = same_vector_nopbc(v1,v2)\n\nWrapper for ``same_vector_nopbc``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"same_vector_nopbc : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int same_vector_nopbcf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.scattering_grids.same_vector_nopbc",\ - capi_kwlist,&v1_capi,&v2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector_nopbc: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.scattering_grids.same_vector_nopbc: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable same_vector_nopbcf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&same_vector_nopbcf2pywrap,v1,v2); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",same_vector_nopbcf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable same_vector_nopbcf2pywrap */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of same_vector_nopbc **************************/ - -/********************************** analysis **********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_analysis[] = "\ -weight,xr2,xr3 = analysis(far,tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,[nat,n_blocks])\n\nWrapper for ``analysis``.\ -\n\nParameters\n----------\n" -"far : input int\n" -"tol : input float\n" -"dmax : input rank-1 array('d') with bounds (nat)\n" -"sc_size : input rank-1 array('i') with bounds (3)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"tau : input rank-2 array('d') with bounds (nat,3)\n" -"tensor : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(dmax, 0)\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"\nReturns\n-------\n" -"weight : rank-4 array('i') with bounds (nat,nat,nat,n_blocks)\n" -"xr2 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)\n" -"xr3 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_analysis(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,int*,int*,int*,double*,double*,double*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int far = 0; - PyObject *far_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - double *dmax = NULL; - npy_intp dmax_Dims[1] = {-1}; - const int dmax_Rank = 1; - PyArrayObject *capi_dmax_as_array = NULL; - int capi_dmax_intent = 0; - PyObject *dmax_capi = Py_None; - int *sc_size = NULL; - npy_intp sc_size_Dims[1] = {-1}; - const int sc_size_Rank = 1; - PyArrayObject *capi_sc_size_as_array = NULL; - int capi_sc_size_intent = 0; - PyObject *sc_size_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr3_list = NULL; - npy_intp xr3_list_Dims[2] = {-1, -1}; - const int xr3_list_Rank = 2; - PyArrayObject *capi_xr3_list_as_array = NULL; - int capi_xr3_list_intent = 0; - PyObject *xr3_list_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[4] = {-1, -1, -1, -1}; - const int weight_Rank = 4; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - int *xr2 = NULL; - npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr2_Rank = 6; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - int *xr3 = NULL; - npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr3_Rank = 6; - PyArrayObject *capi_xr3_as_array = NULL; - int capi_xr3_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"far","tol","dmax","sc_size","xr2_list","xr3_list","alat","tau","tensor","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOO|OO:thermal_conductivity.third_order_centering.analysis",\ - capi_kwlist,&far_capi,&tol_capi,&dmax_capi,&sc_size_capi,&xr2_list_capi,&xr3_list_capi,&alat_capi,&tau_capi,&tensor_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.analysis() 1st argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable dmax */ - ; - capi_dmax_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 3rd argument `dmax`"; - capi_dmax_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dmax_Dims,dmax_Rank, capi_dmax_intent,dmax_capi,capi_errmess); - if (capi_dmax_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dmax = (double *)(PyArray_DATA(capi_dmax_as_array)); - - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 7th argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 5th argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"thermal_conductivity.third_order_centering.analysis() 2nd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable sc_size */ - sc_size_Dims[0]=3; - capi_sc_size_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 4th argument `sc_size`"; - capi_sc_size_as_array = ndarray_from_pyobj( NPY_INT,1,sc_size_Dims,sc_size_Rank, capi_sc_size_intent,sc_size_capi,capi_errmess); - if (capi_sc_size_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sc_size = (int *)(PyArray_DATA(capi_sc_size_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(dmax, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.analysis() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(dmax, 0) == nat,"shape(dmax, 0) == nat","1st keyword nat","analysis:nat=%d",nat) { - /* Processing variable tau */ - tau_Dims[0]=nat,tau_Dims[1]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 8th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_centering.analysis() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","analysis:n_blocks=%d",n_blocks) { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks; - capi_weight_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the hidden `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,Py_None,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks; - capi_xr2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the hidden `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,Py_None,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - /* Processing variable xr3 */ - xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks; - capi_xr3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the hidden `xr3`"; - capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,Py_None,capi_errmess); - if (capi_xr3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); - - /* Processing variable xr3_list */ - xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; - capi_xr3_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 6th argument `xr3_list`"; - capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); - if (capi_xr3_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); - - /* Processing variable tensor */ - tensor_Dims[0]=3 * nat,tensor_Dims[1]=3 * nat,tensor_Dims[2]=3 * nat,tensor_Dims[3]=n_blocks; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.analysis: failed to create array from the 9th argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&far,&tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,weight,xr2,xr3,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNN",capi_weight_as_array,capi_xr2_as_array,capi_xr3_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ - if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { - Py_XDECREF(capi_xr3_list_as_array); } - } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ - /* End of cleaning variable xr3_list */ - } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ - /* End of cleaning variable xr3 */ - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*CHECKSCALAR(shape(dmax, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_sc_size_as_array!=sc_size_capi) { - Py_XDECREF(capi_sc_size_as_array); } - } /* if (capi_sc_size_as_array == NULL) ... else of sc_size */ - /* End of cleaning variable sc_size */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - if((PyObject *)capi_dmax_as_array!=dmax_capi) { - Py_XDECREF(capi_dmax_as_array); } - } /* if (capi_dmax_as_array == NULL) ... else of dmax */ - /* End of cleaning variable dmax */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of analysis ******************************/ - -/*********************************** center ***********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_center[] = "\ -centered = center(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_blocks,n_blocks_old])\n\nWrapper for ``center``.\ -\n\nParameters\n----------\n" -"original : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks_old)\n" -"weight : input rank-4 array('i') with bounds (nat,nat,nat,n_blocks_old)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" -"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr3 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" -"far : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(original, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"n_blocks_old : input int, optional\n Default: shape(original, 3)\n" -"\nReturns\n-------\n" -"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_center(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,int*,int*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *original = NULL; - npy_intp original_Dims[4] = {-1, -1, -1, -1}; - const int original_Rank = 4; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[4] = {-1, -1, -1, -1}; - const int weight_Rank = 4; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - PyObject *weight_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr2_Rank = 6; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr3_list = NULL; - npy_intp xr3_list_Dims[2] = {-1, -1}; - const int xr3_list_Rank = 2; - PyArrayObject *capi_xr3_list_as_array = NULL; - int capi_xr3_list_intent = 0; - PyObject *xr3_list_capi = Py_None; - int *xr3 = NULL; - npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr3_Rank = 6; - PyArrayObject *capi_xr3_as_array = NULL; - int capi_xr3_intent = 0; - PyObject *xr3_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[4] = {-1, -1, -1, -1}; - const int centered_Rank = 4; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int far = 0; - PyObject *far_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int n_blocks_old = 0; - PyObject *n_blocks_old_capi = Py_None; - static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_blocks","n_blocks_old",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OOO:thermal_conductivity.third_order_centering.center",\ - capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_blocks_capi,&n_blocks_old_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.center() 7th argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 3rd argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable original */ - ; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 1st argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(original, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.center() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_centering.center() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","center:n_blocks=%d",n_blocks) { - /* Processing variable xr3_list */ - xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; - capi_xr3_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 5th argument `xr3_list`"; - capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); - if (capi_xr3_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); - - /* Processing variable n_blocks_old */ - if (n_blocks_old_capi == Py_None) n_blocks_old = shape(original, 3); else - f2py_success = int_from_pyobj(&n_blocks_old,n_blocks_old_capi,"thermal_conductivity.third_order_centering.center() 3rd keyword (n_blocks_old) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 3) == n_blocks_old,"shape(original, 3) == n_blocks_old","3rd keyword n_blocks_old","center:n_blocks_old=%d",n_blocks_old) { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks_old; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 4th argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","4th argument xr2") { - /* Processing variable xr3 */ - xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks_old; - capi_xr3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 6th argument `xr3`"; - capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); - if (capi_xr3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); - - CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","6th argument xr3") { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks_old; - capi_weight_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center: failed to create array from the 2nd argument `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,&nat,centered,&far,&n_blocks,&n_blocks_old); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_centered_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_weight_as_array!=weight_capi) { - Py_XDECREF(capi_weight_as_array); } - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ - if((PyObject *)capi_xr3_as_array!=xr3_capi) { - Py_XDECREF(capi_xr3_as_array); } - } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ - /* End of cleaning variable xr3 */ - } /*CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKSCALAR(shape(original, 3) == n_blocks_old)*/ - } /*if (f2py_success) of n_blocks_old*/ - /* End of cleaning variable n_blocks_old */ - if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { - Py_XDECREF(capi_xr3_list_as_array); } - } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ - /* End of cleaning variable xr3_list */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of center *******************************/ - -/******************************* center_sparse *******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_center_sparse[] = "\ -centered,n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list = center_sparse(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_sup,n_blocks])\n\nWrapper for ``center_sparse``.\ -\n\nParameters\n----------\n" -"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup,n_sup)\n" -"weight : input rank-5 array('i') with bounds (nat,nat,n_sup,nat,n_sup)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" -"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr3 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" -"far : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(original, 0) / 3\n" -"n_sup : input int, optional\n Default: shape(original, 3)\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"\nReturns\n-------\n" -"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"n_sparse_blocks : int\n" -"xr2_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" -"xr3_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" -"atom_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" -"r_blocks_sparse_list : rank-1 array('i') with bounds (n_blocks * nat * nat * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_center_sparse(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,int*,double*,int*,int*,int*,int*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *original = NULL; - npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; - const int original_Rank = 5; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[5] = {-1, -1, -1, -1, -1}; - const int weight_Rank = 5; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - PyObject *weight_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int xr2_Rank = 7; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr3_list = NULL; - npy_intp xr3_list_Dims[2] = {-1, -1}; - const int xr3_list_Rank = 2; - PyArrayObject *capi_xr3_list_as_array = NULL; - int capi_xr3_list_intent = 0; - PyObject *xr3_list_capi = Py_None; - int *xr3 = NULL; - npy_intp xr3_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int xr3_Rank = 7; - PyArrayObject *capi_xr3_as_array = NULL; - int capi_xr3_intent = 0; - PyObject *xr3_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[4] = {-1, -1, -1, -1}; - const int centered_Rank = 4; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int n_sparse_blocks = 0; - int *xr2_sparse_list = NULL; - npy_intp xr2_sparse_list_Dims[2] = {-1, -1}; - const int xr2_sparse_list_Rank = 2; - PyArrayObject *capi_xr2_sparse_list_as_array = NULL; - int capi_xr2_sparse_list_intent = 0; - int *xr3_sparse_list = NULL; - npy_intp xr3_sparse_list_Dims[2] = {-1, -1}; - const int xr3_sparse_list_Rank = 2; - PyArrayObject *capi_xr3_sparse_list_as_array = NULL; - int capi_xr3_sparse_list_intent = 0; - int *atom_sparse_list = NULL; - npy_intp atom_sparse_list_Dims[2] = {-1, -1}; - const int atom_sparse_list_Rank = 2; - PyArrayObject *capi_atom_sparse_list_as_array = NULL; - int capi_atom_sparse_list_intent = 0; - int *r_blocks_sparse_list = NULL; - npy_intp r_blocks_sparse_list_Dims[1] = {-1}; - const int r_blocks_sparse_list_Rank = 1; - PyArrayObject *capi_r_blocks_sparse_list_as_array = NULL; - int capi_r_blocks_sparse_list_intent = 0; - int far = 0; - PyObject *far_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_sup = 0; - PyObject *n_sup_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_sup","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OOO:thermal_conductivity.third_order_centering.center_sparse",\ - capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_sup_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.center_sparse() 7th argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 3rd argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable original */ - ; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 1st argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - /* Processing variable n_sparse_blocks */ - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(original, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.center_sparse() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center_sparse:nat=%d",nat) { - /* Processing variable n_sup */ - if (n_sup_capi == Py_None) n_sup = shape(original, 3); else - f2py_success = int_from_pyobj(&n_sup,n_sup_capi,"thermal_conductivity.third_order_centering.center_sparse() 2nd keyword (n_sup) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 3) == n_sup,"shape(original, 3) == n_sup","2nd keyword n_sup","center_sparse:n_sup=%d",n_sup) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_centering.center_sparse() 3rd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","3rd keyword n_blocks","center_sparse:n_blocks=%d",n_blocks) { - /* Processing variable xr3_list */ - xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; - capi_xr3_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 5th argument `xr3_list`"; - capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); - if (capi_xr3_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_sup,xr2_Dims[5]=nat,xr2_Dims[6]=n_sup; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 4th argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","4th argument xr2") { - /* Processing variable xr3 */ - xr3_Dims[0]=3,xr3_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=n_sup,xr3_Dims[5]=nat,xr3_Dims[6]=n_sup; - capi_xr3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 6th argument `xr3`"; - capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); - if (capi_xr3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); - - CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","6th argument xr3") { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_sup,weight_Dims[3]=nat,weight_Dims[4]=n_sup; - capi_weight_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the 2nd argument `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable xr2_sparse_list */ - xr2_sparse_list_Dims[0]=3,xr2_sparse_list_Dims[1]=n_blocks * nat * nat * nat; - capi_xr2_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `xr2_sparse_list`"; - capi_xr2_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_sparse_list_Dims,xr2_sparse_list_Rank, capi_xr2_sparse_list_intent,Py_None,capi_errmess); - if (capi_xr2_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_sparse_list = (int *)(PyArray_DATA(capi_xr2_sparse_list_as_array)); - - /* Processing variable xr3_sparse_list */ - xr3_sparse_list_Dims[0]=3,xr3_sparse_list_Dims[1]=n_blocks * nat * nat * nat; - capi_xr3_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `xr3_sparse_list`"; - capi_xr3_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_sparse_list_Dims,xr3_sparse_list_Rank, capi_xr3_sparse_list_intent,Py_None,capi_errmess); - if (capi_xr3_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_sparse_list = (int *)(PyArray_DATA(capi_xr3_sparse_list_as_array)); - - /* Processing variable atom_sparse_list */ - atom_sparse_list_Dims[0]=3,atom_sparse_list_Dims[1]=n_blocks * nat * nat * nat; - capi_atom_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `atom_sparse_list`"; - capi_atom_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,atom_sparse_list_Dims,atom_sparse_list_Rank, capi_atom_sparse_list_intent,Py_None,capi_errmess); - if (capi_atom_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - atom_sparse_list = (int *)(PyArray_DATA(capi_atom_sparse_list_as_array)); - - /* Processing variable r_blocks_sparse_list */ - r_blocks_sparse_list_Dims[0]=n_blocks * nat * nat * nat; - capi_r_blocks_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.center_sparse: failed to create array from the hidden `r_blocks_sparse_list`"; - capi_r_blocks_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,r_blocks_sparse_list_Dims,r_blocks_sparse_list_Rank, capi_r_blocks_sparse_list_intent,Py_None,capi_errmess); - if (capi_r_blocks_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_blocks_sparse_list = (int *)(PyArray_DATA(capi_r_blocks_sparse_list_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,centered,&n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list,&far,&nat,&n_sup,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NiNNNN",capi_centered_as_array,n_sparse_blocks,capi_xr2_sparse_list_as_array,capi_xr3_sparse_list_as_array,capi_atom_sparse_list_as_array,capi_r_blocks_sparse_list_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_r_blocks_sparse_list_as_array == NULL) ... else of r_blocks_sparse_list */ - /* End of cleaning variable r_blocks_sparse_list */ - } /* if (capi_atom_sparse_list_as_array == NULL) ... else of atom_sparse_list */ - /* End of cleaning variable atom_sparse_list */ - } /* if (capi_xr3_sparse_list_as_array == NULL) ... else of xr3_sparse_list */ - /* End of cleaning variable xr3_sparse_list */ - } /* if (capi_xr2_sparse_list_as_array == NULL) ... else of xr2_sparse_list */ - /* End of cleaning variable xr2_sparse_list */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - if((PyObject *)capi_weight_as_array!=weight_capi) { - Py_XDECREF(capi_weight_as_array); } - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ - if((PyObject *)capi_xr3_as_array!=xr3_capi) { - Py_XDECREF(capi_xr3_as_array); } - } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ - /* End of cleaning variable xr3 */ - } /*CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { - Py_XDECREF(capi_xr3_list_as_array); } - } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ - /* End of cleaning variable xr3_list */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(original, 3) == n_sup)*/ - } /*if (f2py_success) of n_sup*/ - /* End of cleaning variable n_sup */ - } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - /* End of cleaning variable n_sparse_blocks */ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of center_sparse ****************************/ - -/********************************* pre_center *********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_pre_center[] = "\ -centered,lat_min,lat_max = pre_center(far,nq1,nq2,nq3,tol,alat,tau,original,[nat])\n\nWrapper for ``pre_center``.\ -\n\nParameters\n----------\n" -"far : input int\n" -"nq1 : input int\n" -"nq2 : input int\n" -"nq3 : input int\n" -"tol : input float\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"tau : input rank-2 array('d') with bounds (nat,3)\n" -"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,nq1 * nq2 * nq3,nq1 * nq2 * nq3)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 0)\n" -"\nReturns\n-------\n" -"centered : rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3)\n" -"lat_min : rank-1 array('i') with bounds (3)\n" -"lat_max : rank-1 array('i') with bounds (3)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_pre_center(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,int*,double*,double*,double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int far = 0; - PyObject *far_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nq1 = 0; - PyObject *nq1_capi = Py_None; - int nq2 = 0; - PyObject *nq2_capi = Py_None; - int nq3 = 0; - PyObject *nq3_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *original = NULL; - npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; - const int original_Rank = 5; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[5] = {-1, -1, -1, -1, -1}; - const int centered_Rank = 5; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int *lat_min = NULL; - npy_intp lat_min_Dims[1] = {-1}; - const int lat_min_Rank = 1; - PyArrayObject *capi_lat_min_as_array = NULL; - int capi_lat_min_intent = 0; - int *lat_max = NULL; - npy_intp lat_max_Dims[1] = {-1}; - const int lat_max_Rank = 1; - PyArrayObject *capi_lat_max_as_array = NULL; - int capi_lat_max_intent = 0; - static char *capi_kwlist[] = {"far","nq1","nq2","nq3","tol","alat","tau","original","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|O:thermal_conductivity.third_order_centering.pre_center",\ - capi_kwlist,&far_capi,&nq1_capi,&nq2_capi,&nq3_capi,&tol_capi,&alat_capi,&tau_capi,&original_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nq1 */ - f2py_success = int_from_pyobj(&nq1,nq1_capi,"thermal_conductivity.third_order_centering.pre_center() 2nd argument (nq1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nq2 */ - f2py_success = int_from_pyobj(&nq2,nq2_capi,"thermal_conductivity.third_order_centering.pre_center() 3rd argument (nq2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nq3 */ - f2py_success = int_from_pyobj(&nq3,nq3_capi,"thermal_conductivity.third_order_centering.pre_center() 4th argument (nq3) can't be converted to int"); - if (f2py_success) { - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the 6th argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable tau */ - tau_Dims[1]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the 7th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thermal_conductivity.third_order_centering.pre_center() 1st argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"thermal_conductivity.third_order_centering.pre_center() 5th argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable lat_min */ - lat_min_Dims[0]=3; - capi_lat_min_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the hidden `lat_min`"; - capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,Py_None,capi_errmess); - if (capi_lat_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); - - /* Processing variable lat_max */ - lat_max_Dims[0]=3; - capi_lat_max_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the hidden `lat_max`"; - capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,Py_None,capi_errmess); - if (capi_lat_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.pre_center() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 0) == nat,"shape(tau, 0) == nat","1st keyword nat","pre_center:nat=%d",nat) { - /* Processing variable original */ - original_Dims[0]=3 * nat,original_Dims[1]=3 * nat,original_Dims[2]=3 * nat,original_Dims[3]=nq1 * nq2 * nq3,original_Dims[4]=nq1 * nq2 * nq3; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the 8th argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { - CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { - CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,centered_Dims[4]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.pre_center: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&far,&nat,&nq1,&nq2,&nq3,&tol,alat,tau,original,centered,lat_min,lat_max); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNN",capi_centered_as_array,capi_lat_min_as_array,capi_lat_max_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ - } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ - } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - } /*CHECKSCALAR(shape(tau, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ - /* End of cleaning variable lat_max */ - } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ - /* End of cleaning variable lat_min */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - } /*if (f2py_success) of nq3*/ - /* End of cleaning variable nq3 */ - } /*if (f2py_success) of nq2*/ - /* End of cleaning variable nq2 */ - } /*if (f2py_success) of nq1*/ - /* End of cleaning variable nq1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of pre_center *****************************/ - -/*********************************** assign ***********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_assign[] = "\ -centered,x2,x3,r2,r3 = assign(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,n_sup_ws,[nat,n_sup_ws_prev])\n\nWrapper for ``assign``.\ -\n\nParameters\n----------\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"lat_min_prev : input rank-1 array('i') with bounds (3)\n" -"lat_max_prev : input rank-1 array('i') with bounds (3)\n" -"centered_prev : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws_prev,n_sup_ws_prev)\n" -"lat_min : input rank-1 array('i') with bounds (3)\n" -"lat_max : input rank-1 array('i') with bounds (3)\n" -"n_sup_ws : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(centered_prev, 0) / 3\n" -"n_sup_ws_prev : input int, optional\n Default: shape(centered_prev, 3)\n" -"\nReturns\n-------\n" -"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws * n_sup_ws)\n" -"x2 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" -"x3 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" -"r2 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)\n" -"r3 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_assign(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,double*,int*,int*,int*,int*,int*,double*,int*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - int *lat_min_prev = NULL; - npy_intp lat_min_prev_Dims[1] = {-1}; - const int lat_min_prev_Rank = 1; - PyArrayObject *capi_lat_min_prev_as_array = NULL; - int capi_lat_min_prev_intent = 0; - PyObject *lat_min_prev_capi = Py_None; - int *lat_max_prev = NULL; - npy_intp lat_max_prev_Dims[1] = {-1}; - const int lat_max_prev_Rank = 1; - PyArrayObject *capi_lat_max_prev_as_array = NULL; - int capi_lat_max_prev_intent = 0; - PyObject *lat_max_prev_capi = Py_None; - double *centered_prev = NULL; - npy_intp centered_prev_Dims[5] = {-1, -1, -1, -1, -1}; - const int centered_prev_Rank = 5; - PyArrayObject *capi_centered_prev_as_array = NULL; - int capi_centered_prev_intent = 0; - PyObject *centered_prev_capi = Py_None; - int *lat_min = NULL; - npy_intp lat_min_Dims[1] = {-1}; - const int lat_min_Rank = 1; - PyArrayObject *capi_lat_min_as_array = NULL; - int capi_lat_min_intent = 0; - PyObject *lat_min_capi = Py_None; - int *lat_max = NULL; - npy_intp lat_max_Dims[1] = {-1}; - const int lat_max_Rank = 1; - PyArrayObject *capi_lat_max_as_array = NULL; - int capi_lat_max_intent = 0; - PyObject *lat_max_capi = Py_None; - int n_sup_ws = 0; - PyObject *n_sup_ws_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_sup_ws_prev = 0; - PyObject *n_sup_ws_prev_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[4] = {-1, -1, -1, -1}; - const int centered_Rank = 4; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int *x2 = NULL; - npy_intp x2_Dims[2] = {-1, -1}; - const int x2_Rank = 2; - PyArrayObject *capi_x2_as_array = NULL; - int capi_x2_intent = 0; - int *x3 = NULL; - npy_intp x3_Dims[2] = {-1, -1}; - const int x3_Rank = 2; - PyArrayObject *capi_x3_as_array = NULL; - int capi_x3_intent = 0; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - static char *capi_kwlist[] = {"alat","lat_min_prev","lat_max_prev","centered_prev","lat_min","lat_max","n_sup_ws","nat","n_sup_ws_prev",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OO:thermal_conductivity.third_order_centering.assign",\ - capi_kwlist,&alat_capi,&lat_min_prev_capi,&lat_max_prev_capi,¢ered_prev_capi,&lat_min_capi,&lat_max_capi,&n_sup_ws_capi,&nat_capi,&n_sup_ws_prev_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable n_sup_ws */ - f2py_success = int_from_pyobj(&n_sup_ws,n_sup_ws_capi,"thermal_conductivity.third_order_centering.assign() 7th argument (n_sup_ws) can't be converted to int"); - if (f2py_success) { - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 1st argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable lat_min_prev */ - lat_min_prev_Dims[0]=3; - capi_lat_min_prev_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 2nd argument `lat_min_prev`"; - capi_lat_min_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_prev_Dims,lat_min_prev_Rank, capi_lat_min_prev_intent,lat_min_prev_capi,capi_errmess); - if (capi_lat_min_prev_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_min_prev = (int *)(PyArray_DATA(capi_lat_min_prev_as_array)); - - /* Processing variable lat_max_prev */ - lat_max_prev_Dims[0]=3; - capi_lat_max_prev_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 3rd argument `lat_max_prev`"; - capi_lat_max_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_prev_Dims,lat_max_prev_Rank, capi_lat_max_prev_intent,lat_max_prev_capi,capi_errmess); - if (capi_lat_max_prev_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_max_prev = (int *)(PyArray_DATA(capi_lat_max_prev_as_array)); - - /* Processing variable lat_min */ - lat_min_Dims[0]=3; - capi_lat_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 5th argument `lat_min`"; - capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,lat_min_capi,capi_errmess); - if (capi_lat_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); - - /* Processing variable lat_max */ - lat_max_Dims[0]=3; - capi_lat_max_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 6th argument `lat_max`"; - capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,lat_max_capi,capi_errmess); - if (capi_lat_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); - - /* Processing variable centered_prev */ - ; - capi_centered_prev_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the 4th argument `centered_prev`"; - capi_centered_prev_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_prev_Dims,centered_prev_Rank, capi_centered_prev_intent,centered_prev_capi,capi_errmess); - if (capi_centered_prev_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered_prev = (double *)(PyArray_DATA(capi_centered_prev_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(centered_prev, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_centering.assign() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(centered_prev, 0) == 3 * nat,"shape(centered_prev, 0) == 3 * nat","1st keyword nat","assign:nat=%d",nat) { - /* Processing variable n_sup_ws_prev */ - if (n_sup_ws_prev_capi == Py_None) n_sup_ws_prev = shape(centered_prev, 3); else - f2py_success = int_from_pyobj(&n_sup_ws_prev,n_sup_ws_prev_capi,"thermal_conductivity.third_order_centering.assign() 2nd keyword (n_sup_ws_prev) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev,"shape(centered_prev, 3) == n_sup_ws_prev","2nd keyword n_sup_ws_prev","assign:n_sup_ws_prev=%d",n_sup_ws_prev) { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_sup_ws * n_sup_ws; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable x2 */ - x2_Dims[0]=3,x2_Dims[1]=n_sup_ws * n_sup_ws; - capi_x2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `x2`"; - capi_x2_as_array = ndarray_from_pyobj( NPY_INT,1,x2_Dims,x2_Rank, capi_x2_intent,Py_None,capi_errmess); - if (capi_x2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x2 = (int *)(PyArray_DATA(capi_x2_as_array)); - - /* Processing variable x3 */ - x3_Dims[0]=3,x3_Dims[1]=n_sup_ws * n_sup_ws; - capi_x3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `x3`"; - capi_x3_as_array = ndarray_from_pyobj( NPY_INT,1,x3_Dims,x3_Rank, capi_x3_intent,Py_None,capi_errmess); - if (capi_x3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x3 = (int *)(PyArray_DATA(capi_x3_as_array)); - - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_sup_ws * n_sup_ws; - capi_r2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,Py_None,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_sup_ws * n_sup_ws; - capi_r3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.assign: failed to create array from the hidden `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,Py_None,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,&n_sup_ws,&nat,&n_sup_ws_prev,centered,x2,x3,r2,r3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNNNN",capi_centered_as_array,capi_x2_as_array,capi_x3_as_array,capi_r2_as_array,capi_r3_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /* if (capi_x3_as_array == NULL) ... else of x3 */ - /* End of cleaning variable x3 */ - } /* if (capi_x2_as_array == NULL) ... else of x2 */ - /* End of cleaning variable x2 */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev)*/ - } /*if (f2py_success) of n_sup_ws_prev*/ - /* End of cleaning variable n_sup_ws_prev */ - } /*CHECKSCALAR(shape(centered_prev, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_centered_prev_as_array!=centered_prev_capi) { - Py_XDECREF(capi_centered_prev_as_array); } - } /* if (capi_centered_prev_as_array == NULL) ... else of centered_prev */ - /* End of cleaning variable centered_prev */ - if((PyObject *)capi_lat_max_as_array!=lat_max_capi) { - Py_XDECREF(capi_lat_max_as_array); } - } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ - /* End of cleaning variable lat_max */ - if((PyObject *)capi_lat_min_as_array!=lat_min_capi) { - Py_XDECREF(capi_lat_min_as_array); } - } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ - /* End of cleaning variable lat_min */ - if((PyObject *)capi_lat_max_prev_as_array!=lat_max_prev_capi) { - Py_XDECREF(capi_lat_max_prev_as_array); } - } /* if (capi_lat_max_prev_as_array == NULL) ... else of lat_max_prev */ - /* End of cleaning variable lat_max_prev */ - if((PyObject *)capi_lat_min_prev_as_array!=lat_min_prev_capi) { - Py_XDECREF(capi_lat_min_prev_as_array); } - } /* if (capi_lat_min_prev_as_array == NULL) ... else of lat_min_prev */ - /* End of cleaning variable lat_min_prev */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - } /*if (f2py_success) of n_sup_ws*/ - /* End of cleaning variable n_sup_ws */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of assign *******************************/ - -/******************************** within_dmax ********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_within_dmax[] = "\ -within_dmax = within_dmax(v1,v2,v3,d1,d2,d3,tol)\n\nWrapper for ``within_dmax``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"v3 : input rank-1 array('d') with bounds (3)\n" -"d1 : input float\n" -"d2 : input float\n" -"d3 : input float\n" -"tol : input float\n" -"\nReturns\n-------\n" -"within_dmax : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_within_dmax(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int within_dmaxf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - double *v3 = NULL; - npy_intp v3_Dims[1] = {-1}; - const int v3_Rank = 1; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - double d1 = 0; - PyObject *d1_capi = Py_None; - double d2 = 0; - PyObject *d2_capi = Py_None; - double d3 = 0; - PyObject *d3_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2","v3","d1","d2","d3","tol",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|:thermal_conductivity.third_order_centering.within_dmax",\ - capi_kwlist,&v1_capi,&v2_capi,&v3_capi,&d1_capi,&d2_capi,&d3_capi,&tol_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.within_dmax: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.within_dmax: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable v3 */ - v3_Dims[0]=3; - capi_v3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.within_dmax: failed to create array from the 3rd argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable d1 */ - f2py_success = double_from_pyobj(&d1,d1_capi,"thermal_conductivity.third_order_centering.within_dmax() 4th argument (d1) can't be converted to double"); - if (f2py_success) { - /* Processing variable d2 */ - f2py_success = double_from_pyobj(&d2,d2_capi,"thermal_conductivity.third_order_centering.within_dmax() 5th argument (d2) can't be converted to double"); - if (f2py_success) { - /* Processing variable d3 */ - f2py_success = double_from_pyobj(&d3,d3_capi,"thermal_conductivity.third_order_centering.within_dmax() 6th argument (d3) can't be converted to double"); - if (f2py_success) { - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"thermal_conductivity.third_order_centering.within_dmax() 7th argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable within_dmaxf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&within_dmaxf2pywrap,v1,v2,v3,&d1,&d2,&d3,&tol); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",within_dmaxf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable within_dmaxf2pywrap */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - } /*if (f2py_success) of d3*/ - /* End of cleaning variable d3 */ - } /*if (f2py_success) of d2*/ - /* End of cleaning variable d2 */ - } /*if (f2py_success) of d1*/ - /* End of cleaning variable d1 */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of within_dmax *****************************/ - -/***************************** compute_perimeter *****************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter[] = "\ -compute_perimeter = compute_perimeter(v1,v2,v3)\n\nWrapper for ``compute_perimeter``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"v3 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"compute_perimeter : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double compute_perimeterf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - double *v3 = NULL; - npy_intp v3_Dims[1] = {-1}; - const int v3_Rank = 1; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2","v3",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.compute_perimeter",\ - capi_kwlist,&v1_capi,&v2_capi,&v3_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.compute_perimeter: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.compute_perimeter: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable v3 */ - v3_Dims[0]=3; - capi_v3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.compute_perimeter: failed to create array from the 3rd argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable compute_perimeterf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&compute_perimeterf2pywrap,v1,v2,v3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",compute_perimeterf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable compute_perimeterf2pywrap */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of compute_perimeter **************************/ - -/****************************** three_to_one_len ******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len[] = "\ -three_to_one_len = three_to_one_len(v,v_min,v_len)\n\nWrapper for ``three_to_one_len``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_len : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"three_to_one_len : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int three_to_one_lenf2pywrap = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_len = NULL; - npy_intp v_len_Dims[1] = {-1}; - const int v_len_Rank = 1; - PyArrayObject *capi_v_len_as_array = NULL; - int capi_v_len_intent = 0; - PyObject *v_len_capi = Py_None; - static char *capi_kwlist[] = {"v","v_min","v_len",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.three_to_one_len",\ - capi_kwlist,&v_capi,&v_min_capi,&v_len_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one_len: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one_len: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_len */ - v_len_Dims[0]=3; - capi_v_len_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one_len: failed to create array from the 3rd argument `v_len`"; - capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); - if (capi_v_len_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); - - /* Processing variable three_to_one_lenf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&three_to_one_lenf2pywrap,v,v_min,v_len); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",three_to_one_lenf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable three_to_one_lenf2pywrap */ - if((PyObject *)capi_v_len_as_array!=v_len_capi) { - Py_XDECREF(capi_v_len_as_array); } - } /* if (capi_v_len_as_array == NULL) ... else of v_len */ - /* End of cleaning variable v_len */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of three_to_one_len **************************/ - -/******************************** three_to_one ********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one[] = "\ -three_to_one = three_to_one(v,v_min,v_max)\n\nWrapper for ``three_to_one``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_max : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"three_to_one : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_three_to_one(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int three_to_onef2pywrap = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_max = NULL; - npy_intp v_max_Dims[1] = {-1}; - const int v_max_Rank = 1; - PyArrayObject *capi_v_max_as_array = NULL; - int capi_v_max_intent = 0; - PyObject *v_max_capi = Py_None; - static char *capi_kwlist[] = {"v","v_min","v_max",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.three_to_one",\ - capi_kwlist,&v_capi,&v_min_capi,&v_max_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_max */ - v_max_Dims[0]=3; - capi_v_max_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.three_to_one: failed to create array from the 3rd argument `v_max`"; - capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); - if (capi_v_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); - - /* Processing variable three_to_onef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&three_to_onef2pywrap,v,v_min,v_max); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",three_to_onef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable three_to_onef2pywrap */ - if((PyObject *)capi_v_max_as_array!=v_max_capi) { - Py_XDECREF(capi_v_max_as_array); } - } /* if (capi_v_max_as_array == NULL) ... else of v_max */ - /* End of cleaning variable v_max */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of three_to_one ****************************/ - -/****************************** one_to_three_len ******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len[] = "\ -one_to_three_len = one_to_three_len(j,v_min,v_len)\n\nWrapper for ``one_to_three_len``.\ -\n\nParameters\n----------\n" -"j : input int\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_len : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"one_to_three_len : rank-1 array('i') with bounds (3) and one_to_three_lenf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *one_to_three_lenf2pywrap = NULL; - npy_intp one_to_three_lenf2pywrap_Dims[1] = {-1}; - const int one_to_three_lenf2pywrap_Rank = 1; - PyArrayObject *capi_one_to_three_lenf2pywrap_as_array = NULL; - int capi_one_to_three_lenf2pywrap_intent = 0; - int j = 0; - PyObject *j_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_len = NULL; - npy_intp v_len_Dims[1] = {-1}; - const int v_len_Rank = 1; - PyArrayObject *capi_v_len_as_array = NULL; - int capi_v_len_intent = 0; - PyObject *v_len_capi = Py_None; - static char *capi_kwlist[] = {"j","v_min","v_len",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.one_to_three_len",\ - capi_kwlist,&j_capi,&v_min_capi,&v_len_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable j */ - f2py_success = int_from_pyobj(&j,j_capi,"thermal_conductivity.third_order_centering.one_to_three_len() 1st argument (j) can't be converted to int"); - if (f2py_success) { - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three_len: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_len */ - v_len_Dims[0]=3; - capi_v_len_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three_len: failed to create array from the 3rd argument `v_len`"; - capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); - if (capi_v_len_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); - - /* Processing variable one_to_three_lenf2pywrap */ - one_to_three_lenf2pywrap_Dims[0]=3; - capi_one_to_three_lenf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three_len: failed to create array from the hidden `one_to_three_lenf2pywrap`"; - capi_one_to_three_lenf2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_three_lenf2pywrap_Dims,one_to_three_lenf2pywrap_Rank, capi_one_to_three_lenf2pywrap_intent,Py_None,capi_errmess); - if (capi_one_to_three_lenf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - one_to_three_lenf2pywrap = (int *)(PyArray_DATA(capi_one_to_three_lenf2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(one_to_three_lenf2pywrap,&j,v_min,v_len); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_one_to_three_lenf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_one_to_three_lenf2pywrap_as_array == NULL) ... else of one_to_three_lenf2pywrap */ - /* End of cleaning variable one_to_three_lenf2pywrap */ - if((PyObject *)capi_v_len_as_array!=v_len_capi) { - Py_XDECREF(capi_v_len_as_array); } - } /* if (capi_v_len_as_array == NULL) ... else of v_len */ - /* End of cleaning variable v_len */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - } /*if (f2py_success) of j*/ - /* End of cleaning variable j */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of one_to_three_len **************************/ - -/******************************** one_to_three ********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three[] = "\ -one_to_three = one_to_three(j,v_min,v_max)\n\nWrapper for ``one_to_three``.\ -\n\nParameters\n----------\n" -"j : input int\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_max : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"one_to_three : rank-1 array('i') with bounds (3) and one_to_threef2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_one_to_three(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *one_to_threef2pywrap = NULL; - npy_intp one_to_threef2pywrap_Dims[1] = {-1}; - const int one_to_threef2pywrap_Rank = 1; - PyArrayObject *capi_one_to_threef2pywrap_as_array = NULL; - int capi_one_to_threef2pywrap_intent = 0; - int j = 0; - PyObject *j_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_max = NULL; - npy_intp v_max_Dims[1] = {-1}; - const int v_max_Rank = 1; - PyArrayObject *capi_v_max_as_array = NULL; - int capi_v_max_intent = 0; - PyObject *v_max_capi = Py_None; - static char *capi_kwlist[] = {"j","v_min","v_max",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.one_to_three",\ - capi_kwlist,&j_capi,&v_min_capi,&v_max_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable j */ - f2py_success = int_from_pyobj(&j,j_capi,"thermal_conductivity.third_order_centering.one_to_three() 1st argument (j) can't be converted to int"); - if (f2py_success) { - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_max */ - v_max_Dims[0]=3; - capi_v_max_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three: failed to create array from the 3rd argument `v_max`"; - capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); - if (capi_v_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); - - /* Processing variable one_to_threef2pywrap */ - one_to_threef2pywrap_Dims[0]=3; - capi_one_to_threef2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.one_to_three: failed to create array from the hidden `one_to_threef2pywrap`"; - capi_one_to_threef2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_threef2pywrap_Dims,one_to_threef2pywrap_Rank, capi_one_to_threef2pywrap_intent,Py_None,capi_errmess); - if (capi_one_to_threef2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - one_to_threef2pywrap = (int *)(PyArray_DATA(capi_one_to_threef2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(one_to_threef2pywrap,&j,v_min,v_max); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_one_to_threef2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_one_to_threef2pywrap_as_array == NULL) ... else of one_to_threef2pywrap */ - /* End of cleaning variable one_to_threef2pywrap */ - if((PyObject *)capi_v_max_as_array!=v_max_capi) { - Py_XDECREF(capi_v_max_as_array); } - } /* if (capi_v_max_as_array == NULL) ... else of v_max */ - /* End of cleaning variable v_max */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - } /*if (f2py_success) of j*/ - /* End of cleaning variable j */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of one_to_three ****************************/ - -/******************************* min_el_wise_2 *******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2[] = "\ -min_el_wise_2 = min_el_wise_2(a,b)\n\nWrapper for ``min_el_wise_2``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"min_el_wise_2 : rank-1 array('i') with bounds (3) and min_el_wise_2f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *min_el_wise_2f2pywrap = NULL; - npy_intp min_el_wise_2f2pywrap_Dims[1] = {-1}; - const int min_el_wise_2f2pywrap_Rank = 1; - PyArrayObject *capi_min_el_wise_2f2pywrap_as_array = NULL; - int capi_min_el_wise_2f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - static char *capi_kwlist[] = {"a","b",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.third_order_centering.min_el_wise_2",\ - capi_kwlist,&a_capi,&b_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_2: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_2: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable min_el_wise_2f2pywrap */ - min_el_wise_2f2pywrap_Dims[0]=3; - capi_min_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_2: failed to create array from the hidden `min_el_wise_2f2pywrap`"; - capi_min_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_2f2pywrap_Dims,min_el_wise_2f2pywrap_Rank, capi_min_el_wise_2f2pywrap_intent,Py_None,capi_errmess); - if (capi_min_el_wise_2f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - min_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_2f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(min_el_wise_2f2pywrap,a,b); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_2f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_min_el_wise_2f2pywrap_as_array == NULL) ... else of min_el_wise_2f2pywrap */ - /* End of cleaning variable min_el_wise_2f2pywrap */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of min_el_wise_2 ****************************/ - -/******************************* max_el_wise_2 *******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2[] = "\ -max_el_wise_2 = max_el_wise_2(a,b)\n\nWrapper for ``max_el_wise_2``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"max_el_wise_2 : rank-1 array('i') with bounds (3) and max_el_wise_2f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *max_el_wise_2f2pywrap = NULL; - npy_intp max_el_wise_2f2pywrap_Dims[1] = {-1}; - const int max_el_wise_2f2pywrap_Rank = 1; - PyArrayObject *capi_max_el_wise_2f2pywrap_as_array = NULL; - int capi_max_el_wise_2f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - static char *capi_kwlist[] = {"a","b",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.third_order_centering.max_el_wise_2",\ - capi_kwlist,&a_capi,&b_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_2: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_2: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable max_el_wise_2f2pywrap */ - max_el_wise_2f2pywrap_Dims[0]=3; - capi_max_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_2: failed to create array from the hidden `max_el_wise_2f2pywrap`"; - capi_max_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_2f2pywrap_Dims,max_el_wise_2f2pywrap_Rank, capi_max_el_wise_2f2pywrap_intent,Py_None,capi_errmess); - if (capi_max_el_wise_2f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - max_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_2f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(max_el_wise_2f2pywrap,a,b); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_2f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_max_el_wise_2f2pywrap_as_array == NULL) ... else of max_el_wise_2f2pywrap */ - /* End of cleaning variable max_el_wise_2f2pywrap */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of max_el_wise_2 ****************************/ - -/******************************* min_el_wise_3 *******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3[] = "\ -min_el_wise_3 = min_el_wise_3(a,b,c)\n\nWrapper for ``min_el_wise_3``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"c : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"min_el_wise_3 : rank-1 array('i') with bounds (3) and min_el_wise_3f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *min_el_wise_3f2pywrap = NULL; - npy_intp min_el_wise_3f2pywrap_Dims[1] = {-1}; - const int min_el_wise_3f2pywrap_Rank = 1; - PyArrayObject *capi_min_el_wise_3f2pywrap_as_array = NULL; - int capi_min_el_wise_3f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - int *c = NULL; - npy_intp c_Dims[1] = {-1}; - const int c_Rank = 1; - PyArrayObject *capi_c_as_array = NULL; - int capi_c_intent = 0; - PyObject *c_capi = Py_None; - static char *capi_kwlist[] = {"a","b","c",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.min_el_wise_3",\ - capi_kwlist,&a_capi,&b_capi,&c_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable c */ - c_Dims[0]=3; - capi_c_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the 3rd argument `c`"; - capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); - if (capi_c_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - c = (int *)(PyArray_DATA(capi_c_as_array)); - - /* Processing variable min_el_wise_3f2pywrap */ - min_el_wise_3f2pywrap_Dims[0]=3; - capi_min_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.min_el_wise_3: failed to create array from the hidden `min_el_wise_3f2pywrap`"; - capi_min_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_3f2pywrap_Dims,min_el_wise_3f2pywrap_Rank, capi_min_el_wise_3f2pywrap_intent,Py_None,capi_errmess); - if (capi_min_el_wise_3f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - min_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_3f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(min_el_wise_3f2pywrap,a,b,c); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_3f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_min_el_wise_3f2pywrap_as_array == NULL) ... else of min_el_wise_3f2pywrap */ - /* End of cleaning variable min_el_wise_3f2pywrap */ - if((PyObject *)capi_c_as_array!=c_capi) { - Py_XDECREF(capi_c_as_array); } - } /* if (capi_c_as_array == NULL) ... else of c */ - /* End of cleaning variable c */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of min_el_wise_3 ****************************/ - -/******************************* max_el_wise_3 *******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3[] = "\ -max_el_wise_3 = max_el_wise_3(a,b,c)\n\nWrapper for ``max_el_wise_3``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"c : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"max_el_wise_3 : rank-1 array('i') with bounds (3) and max_el_wise_3f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *max_el_wise_3f2pywrap = NULL; - npy_intp max_el_wise_3f2pywrap_Dims[1] = {-1}; - const int max_el_wise_3f2pywrap_Rank = 1; - PyArrayObject *capi_max_el_wise_3f2pywrap_as_array = NULL; - int capi_max_el_wise_3f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - int *c = NULL; - npy_intp c_Dims[1] = {-1}; - const int c_Rank = 1; - PyArrayObject *capi_c_as_array = NULL; - int capi_c_intent = 0; - PyObject *c_capi = Py_None; - static char *capi_kwlist[] = {"a","b","c",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thermal_conductivity.third_order_centering.max_el_wise_3",\ - capi_kwlist,&a_capi,&b_capi,&c_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable c */ - c_Dims[0]=3; - capi_c_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the 3rd argument `c`"; - capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); - if (capi_c_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - c = (int *)(PyArray_DATA(capi_c_as_array)); - - /* Processing variable max_el_wise_3f2pywrap */ - max_el_wise_3f2pywrap_Dims[0]=3; - capi_max_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.max_el_wise_3: failed to create array from the hidden `max_el_wise_3f2pywrap`"; - capi_max_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_3f2pywrap_Dims,max_el_wise_3f2pywrap_Rank, capi_max_el_wise_3f2pywrap_intent,Py_None,capi_errmess); - if (capi_max_el_wise_3f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - max_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_3f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(max_el_wise_3f2pywrap,a,b,c); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_3f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_max_el_wise_3f2pywrap_as_array == NULL) ... else of max_el_wise_3f2pywrap */ - /* End of cleaning variable max_el_wise_3f2pywrap */ - if((PyObject *)capi_c_as_array!=c_capi) { - Py_XDECREF(capi_c_as_array); } - } /* if (capi_c_as_array == NULL) ... else of c */ - /* End of cleaning variable c */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of max_el_wise_3 ****************************/ - -/******************************* cryst_to_cart *******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart[] = "\ -cryst_to_cart = cryst_to_cart(v,alat)\n\nWrapper for ``cryst_to_cart``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"cryst_to_cart : rank-1 array('d') with bounds (3) and cryst_to_cartf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *cryst_to_cartf2pywrap = NULL; - npy_intp cryst_to_cartf2pywrap_Dims[1] = {-1}; - const int cryst_to_cartf2pywrap_Rank = 1; - PyArrayObject *capi_cryst_to_cartf2pywrap_as_array = NULL; - int capi_cryst_to_cartf2pywrap_intent = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - static char *capi_kwlist[] = {"v","alat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.third_order_centering.cryst_to_cart",\ - capi_kwlist,&v_capi,&alat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.cryst_to_cart: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.cryst_to_cart: failed to create array from the 2nd argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable cryst_to_cartf2pywrap */ - cryst_to_cartf2pywrap_Dims[0]=3; - capi_cryst_to_cartf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_centering.cryst_to_cart: failed to create array from the hidden `cryst_to_cartf2pywrap`"; - capi_cryst_to_cartf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cryst_to_cartf2pywrap_Dims,cryst_to_cartf2pywrap_Rank, capi_cryst_to_cartf2pywrap_intent,Py_None,capi_errmess); - if (capi_cryst_to_cartf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - cryst_to_cartf2pywrap = (double *)(PyArray_DATA(capi_cryst_to_cartf2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(cryst_to_cartf2pywrap,v,alat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_cryst_to_cartf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_cryst_to_cartf2pywrap_as_array == NULL) ... else of cryst_to_cartf2pywrap */ - /* End of cleaning variable cryst_to_cartf2pywrap */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of cryst_to_cart ****************************/ - -/******************************** interpol_v2 ********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v2[] = "\ -fc_interp = interpol_v2(fc,r2,r3,pos,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v2``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" -"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"q2 : input rank-1 array('d') with bounds (3)\n" -"q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(fc, 0)\n" -"nat : input int, optional\n Default: shape(fc, 1) / 3\n" -"\nReturns\n-------\n" -"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_interpol_v2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - PyObject *r3_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *q2 = NULL; - npy_intp q2_Dims[1] = {-1}; - const int q2_Rank = 1; - PyArrayObject *capi_q2_as_array = NULL; - int capi_q2_intent = 0; - PyObject *q2_capi = Py_None; - double *q3 = NULL; - npy_intp q3_Dims[1] = {-1}; - const int q3_Rank = 1; - PyArrayObject *capi_q3_as_array = NULL; - int capi_q3_intent = 0; - PyObject *q3_capi = Py_None; - complex_double *fc_interp = NULL; - npy_intp fc_interp_Dims[3] = {-1, -1, -1}; - const int fc_interp_Rank = 3; - PyArrayObject *capi_fc_interp_as_array = NULL; - int capi_fc_interp_intent = 0; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"fc","r2","r3","pos","q2","q3","n_blocks","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thermal_conductivity.third_order_cond.interpol_v2",\ - capi_kwlist,&fc_capi,&r2_capi,&r3_capi,&pos_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable q2 */ - q2_Dims[0]=3; - capi_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 5th argument `q2`"; - capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); - if (capi_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q2 = (double *)(PyArray_DATA(capi_q2_as_array)); - - /* Processing variable q3 */ - q3_Dims[0]=3; - capi_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 6th argument `q3`"; - capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); - if (capi_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q3 = (double *)(PyArray_DATA(capi_q3_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.interpol_v2() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v2:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_cond.interpol_v2() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v2:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 2nd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_blocks; - capi_r3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 3rd argument `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the 4th argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable fc_interp */ - fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; - capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v2: failed to create array from the hidden `fc_interp`"; - capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); - if (capi_fc_interp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r2,r3,pos,q2,q3,fc_interp,&n_blocks,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ - /* End of cleaning variable fc_interp */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r3_as_array!=r3_capi) { - Py_XDECREF(capi_r3_as_array); } - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_q3_as_array!=q3_capi) { - Py_XDECREF(capi_q3_as_array); } - } /* if (capi_q3_as_array == NULL) ... else of q3 */ - /* End of cleaning variable q3 */ - if((PyObject *)capi_q2_as_array!=q2_capi) { - Py_XDECREF(capi_q2_as_array); } - } /* if (capi_q2_as_array == NULL) ... else of q2 */ - /* End of cleaning variable q2 */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of interpol_v2 *****************************/ - -/******************************** interpol_v3 ********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v3[] = "\ -fc_interp = interpol_v3(fc,pos,r2,r3,q1,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v3``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"q1 : input rank-1 array('d') with bounds (3)\n" -"q2 : input rank-1 array('d') with bounds (3)\n" -"q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(fc, 0)\n" -"nat : input int, optional\n Default: shape(fc, 1) / 3\n" -"\nReturns\n-------\n" -"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_interpol_v3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - PyObject *r3_capi = Py_None; - double *q1 = NULL; - npy_intp q1_Dims[1] = {-1}; - const int q1_Rank = 1; - PyArrayObject *capi_q1_as_array = NULL; - int capi_q1_intent = 0; - PyObject *q1_capi = Py_None; - double *q2 = NULL; - npy_intp q2_Dims[1] = {-1}; - const int q2_Rank = 1; - PyArrayObject *capi_q2_as_array = NULL; - int capi_q2_intent = 0; - PyObject *q2_capi = Py_None; - double *q3 = NULL; - npy_intp q3_Dims[1] = {-1}; - const int q3_Rank = 1; - PyArrayObject *capi_q3_as_array = NULL; - int capi_q3_intent = 0; - PyObject *q3_capi = Py_None; - complex_double *fc_interp = NULL; - npy_intp fc_interp_Dims[3] = {-1, -1, -1}; - const int fc_interp_Rank = 3; - PyArrayObject *capi_fc_interp_as_array = NULL; - int capi_fc_interp_intent = 0; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"fc","pos","r2","r3","q1","q2","q3","n_blocks","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OO:thermal_conductivity.third_order_cond.interpol_v3",\ - capi_kwlist,&fc_capi,&pos_capi,&r2_capi,&r3_capi,&q1_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable q2 */ - q2_Dims[0]=3; - capi_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 6th argument `q2`"; - capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); - if (capi_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q2 = (double *)(PyArray_DATA(capi_q2_as_array)); - - /* Processing variable q3 */ - q3_Dims[0]=3; - capi_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 7th argument `q3`"; - capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); - if (capi_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q3 = (double *)(PyArray_DATA(capi_q3_as_array)); - - /* Processing variable q1 */ - q1_Dims[0]=3; - capi_q1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 5th argument `q1`"; - capi_q1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q1_Dims,q1_Rank, capi_q1_intent,q1_capi,capi_errmess); - if (capi_q1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q1 = (double *)(PyArray_DATA(capi_q1_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.interpol_v3() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v3:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thermal_conductivity.third_order_cond.interpol_v3() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v3:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 3rd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_blocks; - capi_r3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 4th argument `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the 2nd argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable fc_interp */ - fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; - capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.interpol_v3: failed to create array from the hidden `fc_interp`"; - capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); - if (capi_fc_interp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,pos,r2,r3,q1,q2,q3,fc_interp,&n_blocks,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ - /* End of cleaning variable fc_interp */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r3_as_array!=r3_capi) { - Py_XDECREF(capi_r3_as_array); } - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_q1_as_array!=q1_capi) { - Py_XDECREF(capi_q1_as_array); } - } /* if (capi_q1_as_array == NULL) ... else of q1 */ - /* End of cleaning variable q1 */ - if((PyObject *)capi_q3_as_array!=q3_capi) { - Py_XDECREF(capi_q3_as_array); } - } /* if (capi_q3_as_array == NULL) ... else of q3 */ - /* End of cleaning variable q3 */ - if((PyObject *)capi_q2_as_array!=q2_capi) { - Py_XDECREF(capi_q2_as_array); } - } /* if (capi_q2_as_array == NULL) ... else of q2 */ - /* End of cleaning variable q2 */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of interpol_v3 *****************************/ - -/********************* compute_full_dynamic_bubble_single *********************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single[] = "\ -bubble = compute_full_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_full_dynamic_bubble_single``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (n_mod)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"n_mod : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-3 array('D') with bounds (ne,n_mod,n_mod)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[3] = {-1, -1, -1}; - const int bubble_Rank = 3; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_full_dynamic_bubble_single:ne=%d",ne) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_full_dynamic_bubble_single:n_mod=%d",n_mod) { - /* Processing variable bubble */ - bubble_Dims[0]=ne,bubble_Dims[1]=n_mod,bubble_Dims[2]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=n_mod,freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************** end of compute_full_dynamic_bubble_single *****************/ - -/********************* compute_diag_dynamic_bubble_single *********************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single[] = "\ -bubble = compute_diag_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_diag_dynamic_bubble_single``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (n_mod)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"n_mod : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-2 array('D') with bounds (ne,n_mod)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[2] = {-1, -1}; - const int bubble_Rank = 2; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_diag_dynamic_bubble_single:n_mod=%d",n_mod) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_diag_dynamic_bubble_single:ne=%d",ne) { - /* Processing variable bubble */ - bubble_Dims[0]=ne,bubble_Dims[1]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=n_mod,freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************** end of compute_diag_dynamic_bubble_single *****************/ - -/*********************** compute_perturb_selfnrg_single ***********************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single[] = "\ -selfnrg = compute_perturb_selfnrg_single(sigma,t,freq,is_gamma,d3,gaussian,classical,[n_mod])\n\nWrapper for ``compute_perturb_selfnrg_single``.\ -\n\nParameters\n----------\n" -"sigma : input rank-1 array('d') with bounds (n_mod)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"selfnrg : rank-1 array('D') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,complex_double*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[1] = {-1}; - const int selfnrg_Rank = 1; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - static char *capi_kwlist[] = {"sigma","t","freq","is_gamma","d3","gaussian","classical","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single",\ - capi_kwlist,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 1st argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 4th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","1st keyword n_mod","compute_perturb_selfnrg_single:n_mod=%d",n_mod) { - /* Processing variable selfnrg */ - selfnrg_Dims[0]=n_mod; - capi_selfnrg_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the hidden `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,Py_None,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=n_mod,freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 3rd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 5th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(sigma,&t,freq,is_gamma,d3,&n_mod,&gaussian,&classical,selfnrg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_selfnrg_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************* end of compute_perturb_selfnrg_single *******************/ - -/*********************** compute_spectralf_diag_single ***********************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single[] = "\ -spectralf = compute_spectralf_diag_single(sigma,ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``compute_spectralf_diag_single``.\ -\n\nParameters\n----------\n" -"sigma : input rank-1 array('d') with bounds (3 * nat)\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" -"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(sigma, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,complex_double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *d2_freq = NULL; - npy_intp d2_freq_Dims[1] = {-1}; - const int d2_freq_Rank = 1; - PyArrayObject *capi_d2_freq_as_array = NULL; - int capi_d2_freq_intent = 0; - PyObject *d2_freq_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[2] = {-1, -1}; - const int selfnrg_Rank = 2; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - PyObject *selfnrg_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *spectralf = NULL; - npy_intp spectralf_Dims[2] = {-1, -1}; - const int spectralf_Rank = 2; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - static char *capi_kwlist[] = {"sigma","ener","d2_freq","selfnrg","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|OO:thermal_conductivity.third_order_cond.compute_spectralf_diag_single",\ - capi_kwlist,&sigma_capi,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 2nd argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 1st argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.compute_spectralf_diag_single() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf_diag_single:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(sigma, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.compute_spectralf_diag_single() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == 3 * nat,"shape(sigma, 0) == 3 * nat","1st keyword nat","compute_spectralf_diag_single:nat=%d",nat) { - /* Processing variable d2_freq */ - d2_freq_Dims[0]=3 * nat; - capi_d2_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 3rd argument `d2_freq`"; - capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); - if (capi_d2_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); - - /* Processing variable selfnrg */ - selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; - capi_selfnrg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the 4th argument `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.compute_spectralf_diag_single: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(sigma,ener,d2_freq,selfnrg,&nat,&ne,spectralf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { - Py_XDECREF(capi_selfnrg_as_array); } - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { - Py_XDECREF(capi_d2_freq_as_array); } - } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ - /* End of cleaning variable d2_freq */ - } /*CHECKSCALAR(shape(sigma, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of compute_spectralf_diag_single ********************/ - -/*************************** lambda_dynamic_single ***************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single[] = "\ -lambda_out = lambda_dynamic_single(energies,sigma,t,static_limit,w_q2,w_q3,gaussian,[ne])\n\nWrapper for ``lambda_dynamic_single``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input float\n" -"t : input float\n" -"static_limit : input int\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"gaussian : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"\nReturns\n-------\n" -"lambda_out : rank-1 array('D') with bounds (ne)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,int*,double*,double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double sigma = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int static_limit = 0; - PyObject *static_limit_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - complex_double *lambda_out = NULL; - npy_intp lambda_out_Dims[1] = {-1}; - const int lambda_out_Rank = 1; - PyArrayObject *capi_lambda_out_as_array = NULL; - int capi_lambda_out_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","static_limit","w_q2","w_q3","gaussian","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:thermal_conductivity.third_order_cond.lambda_dynamic_single",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&static_limit_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable static_limit */ - static_limit = (int)PyObject_IsTrue(static_limit_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - f2py_success = double_from_pyobj(&sigma,sigma_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_single() 2nd argument (sigma) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_single() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the 5th argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the 6th argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_single() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","lambda_dynamic_single:ne=%d",ne) { - /* Processing variable lambda_out */ - lambda_out_Dims[0]=ne; - capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_single: failed to create array from the hidden `lambda_out`"; - capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); - if (capi_lambda_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,energies,&sigma,&t,&static_limit,w_q2,w_q3,&gaussian,lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ - /* End of cleaning variable lambda_out */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of sigma*/ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of static_limit*/ - /* End of cleaning variable static_limit */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of lambda_dynamic_single ************************/ - -/************************ lambda_dynamic_value_single ************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single[] = "\ -lambda_out = lambda_dynamic_value_single(n_mod,value,sigma,t,w_q2,w_q3,gaussian)\n\nWrapper for ``lambda_dynamic_value_single``.\ -\n\nParameters\n----------\n" -"n_mod : input int\n" -"value : input float\n" -"sigma : input float\n" -"t : input float\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"gaussian : input int\n" -"\nReturns\n-------\n" -"lambda_out : complex"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,double*,double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double value = 0; - PyObject *value_capi = Py_None; - double sigma = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - complex_double lambda_out; - PyObject *lambda_out_capi = Py_None; - static char *capi_kwlist[] = {"n_mod","value","sigma","t","w_q2","w_q3","gaussian",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|:thermal_conductivity.third_order_cond.lambda_dynamic_value_single",\ - capi_kwlist,&n_mod_capi,&value_capi,&sigma_capi,&t_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable lambda_out */ - /* Processing variable n_mod */ - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 1st argument (n_mod) can't be converted to int"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable sigma */ - f2py_success = double_from_pyobj(&sigma,sigma_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 3rd argument (sigma) can't be converted to double"); - if (f2py_success) { - /* Processing variable value */ - f2py_success = double_from_pyobj(&value,value_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 2nd argument (value) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.lambda_dynamic_value_single() 4th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_value_single: failed to create array from the 5th argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.lambda_dynamic_value_single: failed to create array from the 6th argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&n_mod,&value,&sigma,&t,w_q2,w_q3,&gaussian,&lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ - lambda_out_capi = pyobj_from_complex_double1(lambda_out); -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",lambda_out_capi); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of value*/ - /* End of cleaning variable value */ - } /*if (f2py_success) of sigma*/ - /* End of cleaning variable sigma */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - /* End of cleaning variable lambda_out */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of lambda_dynamic_value_single *********************/ - -/************************ calculate_spectral_function ************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function[] = "\ -spectralf = calculate_spectral_function(ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``calculate_spectral_function``.\ -\n\nParameters\n----------\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" -"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(d2_freq, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *d2_freq = NULL; - npy_intp d2_freq_Dims[1] = {-1}; - const int d2_freq_Rank = 1; - PyArrayObject *capi_d2_freq_as_array = NULL; - int capi_d2_freq_intent = 0; - PyObject *d2_freq_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[2] = {-1, -1}; - const int selfnrg_Rank = 2; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - PyObject *selfnrg_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *spectralf = NULL; - npy_intp spectralf_Dims[2] = {-1, -1}; - const int spectralf_Rank = 2; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - static char *capi_kwlist[] = {"ener","d2_freq","selfnrg","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thermal_conductivity.third_order_cond.calculate_spectral_function",\ - capi_kwlist,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the 1st argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable d2_freq */ - ; - capi_d2_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the 2nd argument `d2_freq`"; - capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); - if (capi_d2_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(d2_freq, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(d2_freq, 0) == 3 * nat,"shape(d2_freq, 0) == 3 * nat","1st keyword nat","calculate_spectral_function:nat=%d",nat) { - /* Processing variable selfnrg */ - selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; - capi_selfnrg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the 3rd argument `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ener,d2_freq,selfnrg,&nat,&ne,spectralf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { - Py_XDECREF(capi_selfnrg_as_array); } - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - } /*CHECKSCALAR(shape(d2_freq, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { - Py_XDECREF(capi_d2_freq_as_array); } - } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ - /* End of cleaning variable d2_freq */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of calculate_spectral_function *********************/ - -/****************** calculate_spectral_function_mode_mixing ******************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing[] = "\ -spectralf = calculate_spectral_function_mode_mixing(ener,smear,wq,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_mode_mixing``.\ -\n\nParameters\n----------\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"wq : input rank-1 array('d') with bounds (3 * nat)\n" -"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" -"notransl : input int\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(smear, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,complex_double*,int*,complex_double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double *wq = NULL; - npy_intp wq_Dims[1] = {-1}; - const int wq_Rank = 1; - PyArrayObject *capi_wq_as_array = NULL; - int capi_wq_intent = 0; - PyObject *wq_capi = Py_None; - complex_double *pi = NULL; - npy_intp pi_Dims[3] = {-1, -1, -1}; - const int pi_Rank = 3; - PyArrayObject *capi_pi_as_array = NULL; - int capi_pi_intent = 0; - PyObject *pi_capi = Py_None; - int notransl = 0; - PyObject *notransl_capi = Py_None; - complex_double *spectralf = NULL; - npy_intp spectralf_Dims[3] = {-1, -1, -1}; - const int spectralf_Rank = 3; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - static char *capi_kwlist[] = {"ener","smear","wq","pi","notransl","mass","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing",\ - capi_kwlist,&ener_capi,&smear_capi,&wq_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 1st argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable smear */ - ; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 2nd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable notransl */ - notransl = (int)PyObject_IsTrue(notransl_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_mode_mixing:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_mode_mixing:nat=%d",nat) { - /* Processing variable wq */ - wq_Dims[0]=3 * nat; - capi_wq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 3rd argument `wq`"; - capi_wq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,wq_Dims,wq_Rank, capi_wq_intent,wq_capi,capi_errmess); - if (capi_wq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - wq = (double *)(PyArray_DATA(capi_wq_as_array)); - - /* Processing variable pi */ - pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; - capi_pi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 4th argument `pi`"; - capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); - if (capi_pi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); - - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 6th argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ener,smear,wq,pi,¬ransl,spectralf,mass,&nat,&ne); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_pi_as_array!=pi_capi) { - Py_XDECREF(capi_pi_as_array); } - } /* if (capi_pi_as_array == NULL) ... else of pi */ - /* End of cleaning variable pi */ - if((PyObject *)capi_wq_as_array!=wq_capi) { - Py_XDECREF(capi_wq_as_array); } - } /* if (capi_wq_as_array == NULL) ... else of wq */ - /* End of cleaning variable wq */ - } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of notransl*/ - /* End of cleaning variable notransl */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************** end of calculate_spectral_function_mode_mixing ***************/ - -/******************* calculate_spectral_function_cartesian *******************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian[] = "\ -spectralf = calculate_spectral_function_cartesian(ener,smear,d2,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_cartesian``.\ -\n\nParameters\n----------\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"d2 : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" -"notransl : input int\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(smear, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,complex_double*,int*,complex_double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - complex_double *d2 = NULL; - npy_intp d2_Dims[2] = {-1, -1}; - const int d2_Rank = 2; - PyArrayObject *capi_d2_as_array = NULL; - int capi_d2_intent = 0; - PyObject *d2_capi = Py_None; - complex_double *pi = NULL; - npy_intp pi_Dims[3] = {-1, -1, -1}; - const int pi_Rank = 3; - PyArrayObject *capi_pi_as_array = NULL; - int capi_pi_intent = 0; - PyObject *pi_capi = Py_None; - int notransl = 0; - PyObject *notransl_capi = Py_None; - complex_double *spectralf = NULL; - npy_intp spectralf_Dims[3] = {-1, -1, -1}; - const int spectralf_Rank = 3; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - static char *capi_kwlist[] = {"ener","smear","d2","pi","notransl","mass","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian",\ - capi_kwlist,&ener_capi,&smear_capi,&d2_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 1st argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable smear */ - ; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 2nd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable notransl */ - notransl = (int)PyObject_IsTrue(notransl_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_cartesian:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_cartesian:nat=%d",nat) { - /* Processing variable d2 */ - d2_Dims[0]=3 * nat,d2_Dims[1]=3 * nat; - capi_d2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 3rd argument `d2`"; - capi_d2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d2_Dims,d2_Rank, capi_d2_intent,d2_capi,capi_errmess); - if (capi_d2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2 = (complex_double *)(PyArray_DATA(capi_d2_as_array)); - - /* Processing variable pi */ - pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; - capi_pi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 4th argument `pi`"; - capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); - if (capi_pi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); - - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 6th argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ener,smear,d2,pi,¬ransl,spectralf,mass,&nat,&ne); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_pi_as_array!=pi_capi) { - Py_XDECREF(capi_pi_as_array); } - } /* if (capi_pi_as_array == NULL) ... else of pi */ - /* End of cleaning variable pi */ - if((PyObject *)capi_d2_as_array!=d2_capi) { - Py_XDECREF(capi_d2_as_array); } - } /* if (capi_d2_as_array == NULL) ... else of d2 */ - /* End of cleaning variable d2 */ - } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of notransl*/ - /* End of cleaning variable notransl */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************** end of calculate_spectral_function_cartesian ****************/ - -/********************************* bose_freq *********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_bose_freq[] = "\ -bose = bose_freq(t,freq,[n_mod])\n\nWrapper for ``bose_freq``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"freq : input rank-1 array('d') with bounds (n_mod)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bose : rank-1 array('d') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_bose_freq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - double *bose = NULL; - npy_intp bose_Dims[1] = {-1}; - const int bose_Rank = 1; - PyArrayObject *capi_bose_as_array = NULL; - int capi_bose_intent = 0; - static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thermal_conductivity.third_order_cond.bose_freq",\ - capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.bose_freq() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - ; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.bose_freq: failed to create array from the 2nd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.bose_freq() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","bose_freq:n_mod=%d",n_mod) { - /* Processing variable bose */ - bose_Dims[0]=n_mod; - capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.bose_freq: failed to create array from the hidden `bose`"; - capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); - if (capi_bose_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bose = (double *)(PyArray_DATA(capi_bose_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,&n_mod,freq,bose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_bose_as_array == NULL) ... else of bose */ - /* End of cleaning variable bose */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of bose_freq ******************************/ - -/********************************** eq_freq **********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_eq_freq[] = "\ -bose = eq_freq(t,freq,[n_mod])\n\nWrapper for ``eq_freq``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"freq : input rank-1 array('d') with bounds (n_mod)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bose : rank-1 array('d') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_eq_freq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - double *bose = NULL; - npy_intp bose_Dims[1] = {-1}; - const int bose_Rank = 1; - PyArrayObject *capi_bose_as_array = NULL; - int capi_bose_intent = 0; - static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thermal_conductivity.third_order_cond.eq_freq",\ - capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.eq_freq() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - ; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eq_freq: failed to create array from the 2nd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thermal_conductivity.third_order_cond.eq_freq() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","eq_freq:n_mod=%d",n_mod) { - /* Processing variable bose */ - bose_Dims[0]=n_mod; - capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eq_freq: failed to create array from the hidden `bose`"; - capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); - if (capi_bose_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bose = (double *)(PyArray_DATA(capi_bose_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,&n_mod,freq,bose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_bose_as_array == NULL) ... else of bose */ - /* End of cleaning variable bose */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of eq_freq *******************************/ - -/*********************************** f_bose ***********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_f_bose[] = "\ -f_bose = f_bose(freq,t)\n\nWrapper for ``f_bose``.\ -\n\nParameters\n----------\n" -"freq : input float\n" -"t : input float\n" -"\nReturns\n-------\n" -"f_bose : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_f_bose(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double f_bosef2pywrap = 0; - double freq = 0; - PyObject *freq_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - static char *capi_kwlist[] = {"freq","t",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.third_order_cond.f_bose",\ - capi_kwlist,&freq_capi,&t_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable freq */ - f2py_success = double_from_pyobj(&freq,freq_capi,"thermal_conductivity.third_order_cond.f_bose() 1st argument (freq) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.f_bose() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable f_bosef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&f_bosef2pywrap,&freq,&t); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",f_bosef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f_bosef2pywrap */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of freq*/ - /* End of cleaning variable freq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of f_bose *******************************/ - -/********************************** df_bose **********************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_df_bose[] = "\ -df_bose = df_bose(freq,t)\n\nWrapper for ``df_bose``.\ -\n\nParameters\n----------\n" -"freq : input float\n" -"t : input float\n" -"\nReturns\n-------\n" -"df_bose : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_df_bose(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double df_bosef2pywrap = 0; - double freq = 0; - PyObject *freq_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - static char *capi_kwlist[] = {"freq","t",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.third_order_cond.df_bose",\ - capi_kwlist,&freq_capi,&t_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable freq */ - f2py_success = double_from_pyobj(&freq,freq_capi,"thermal_conductivity.third_order_cond.df_bose() 1st argument (freq) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thermal_conductivity.third_order_cond.df_bose() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable df_bosef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&df_bosef2pywrap,&freq,&t); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",df_bosef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable df_bosef2pywrap */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of freq*/ - /* End of cleaning variable freq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of df_bose *******************************/ - -/***************************** gaussian_function *****************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_gaussian_function[] = "\ -gaussian_function = gaussian_function(x,sigma)\n\nWrapper for ``gaussian_function``.\ -\n\nParameters\n----------\n" -"x : input float\n" -"sigma : input float\n" -"\nReturns\n-------\n" -"gaussian_function : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_gaussian_function(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double gaussian_functionf2pywrap = 0; - double x = 0; - PyObject *x_capi = Py_None; - double sigma = 0; - PyObject *sigma_capi = Py_None; - static char *capi_kwlist[] = {"x","sigma",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thermal_conductivity.third_order_cond.gaussian_function",\ - capi_kwlist,&x_capi,&sigma_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - f2py_success = double_from_pyobj(&x,x_capi,"thermal_conductivity.third_order_cond.gaussian_function() 1st argument (x) can't be converted to double"); - if (f2py_success) { - /* Processing variable sigma */ - f2py_success = double_from_pyobj(&sigma,sigma_capi,"thermal_conductivity.third_order_cond.gaussian_function() 2nd argument (sigma) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian_functionf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&gaussian_functionf2pywrap,&x,&sigma); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",gaussian_functionf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable gaussian_functionf2pywrap */ - } /*if (f2py_success) of sigma*/ - /* End of cleaning variable sigma */ - } /*if (f2py_success) of x*/ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of gaussian_function **************************/ - -/****************************** eliminate_transl ******************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl[] = "\ -eliminate_transl(a,mass,[nat])\n\nWrapper for ``eliminate_transl``.\ -\n\nParameters\n----------\n" -"a : in/output rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(a, 0) / 3"; -/* */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"a","mass","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thermal_conductivity.third_order_cond.eliminate_transl",\ - capi_kwlist,&a_capi,&mass_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eliminate_transl: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (complex_double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(a, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thermal_conductivity.third_order_cond.eliminate_transl() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(a, 0) == 3 * nat,"shape(a, 0) == 3 * nat","1st keyword nat","eliminate_transl:nat=%d",nat) { - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.eliminate_transl: failed to create array from the 2nd argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(a,mass,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /*CHECKSCALAR(shape(a, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of eliminate_transl **************************/ - -/************************************ cinv ************************************/ -static char doc_f2py_rout_thermal_conductivity_third_order_cond_cinv[] = "\ -ainv = cinv(a)\n\nWrapper for ``cinv``.\ -\n\nParameters\n----------\n" -"a : input rank-2 array('D') with bounds (f2py_a_d0,f2py_a_d1)\n" -"\nReturns\n-------\n" -"ainv : rank-2 array('D') with bounds (size(a, 1),size(a, 2)) and cinvf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thermal_conductivity_third_order_cond_cinv(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *cinvf2pywrap = NULL; - npy_intp cinvf2pywrap_Dims[2] = {-1, -1}; - const int cinvf2pywrap_Rank = 2; - PyArrayObject *capi_cinvf2pywrap_as_array = NULL; - int capi_cinvf2pywrap_intent = 0; - complex_double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int f2py_a_d0 = 0; - int f2py_a_d1 = 0; - static char *capi_kwlist[] = {"a",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thermal_conductivity.third_order_cond.cinv",\ - capi_kwlist,&a_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.cinv: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (complex_double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable cinvf2pywrap */ - cinvf2pywrap_Dims[0]=size(a, 1),cinvf2pywrap_Dims[1]=size(a, 2); - capi_cinvf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thermal_conductivity.thermal_conductivity.third_order_cond.cinv: failed to create array from the hidden `cinvf2pywrap`"; - capi_cinvf2pywrap_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,cinvf2pywrap_Dims,cinvf2pywrap_Rank, capi_cinvf2pywrap_intent,Py_None,capi_errmess); - if (capi_cinvf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thermal_conductivity_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - cinvf2pywrap = (complex_double *)(PyArray_DATA(capi_cinvf2pywrap_as_array)); - - /* Processing variable f2py_a_d0 */ - f2py_a_d0 = shape(a, 0); - /* Processing variable f2py_a_d1 */ - f2py_a_d1 = shape(a, 1); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(cinvf2pywrap,a,&f2py_a_d0,&f2py_a_d1); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_cinvf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_a_d1 */ - /* End of cleaning variable f2py_a_d0 */ - } /* if (capi_cinvf2pywrap_as_array == NULL) ... else of cinvf2pywrap */ - /* End of cleaning variable cinvf2pywrap */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of cinv ********************************/ -/*eof body*/ - -/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ - -static FortranDataDef f2py_get_lf_def[] = { - {"calculate_lineshapes",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes}, - {"calculate_lineshapes_mode_mixing",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_mode_mixing}, - {"calculate_lineshapes_cartesian",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lineshapes_cartesian}, - {"calculate_lifetimes_selfconsistently",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_selfconsistently}, - {"solve_selfconsistent_equation",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation,doc_f2py_rout_thermal_conductivity_get_lf_solve_selfconsistent_equation}, - {"calculate_correlation_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function,doc_f2py_rout_thermal_conductivity_get_lf_calculate_correlation_function}, - {"calculate_lifetimes_perturbative",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes_perturbative}, - {"calculate_lifetimes",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes,doc_f2py_rout_thermal_conductivity_get_lf_calculate_lifetimes}, - {"calculate_self_energy_la",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la,doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_la}, - {"calculate_self_energy_p",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p,doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_p}, - {"calculate_self_energy_full",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full,doc_f2py_rout_thermal_conductivity_get_lf_calculate_self_energy_full}, - {"check_if_gamma",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_check_if_gamma,doc_f2py_rout_thermal_conductivity_get_lf_check_if_gamma}, - {"vec_dot_mat",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_vec_dot_mat,doc_f2py_rout_thermal_conductivity_get_lf_vec_dot_mat}, - {"calculate_real_part_via_kramers_kronig",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig,doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig}, - {"calculate_real_part_via_kramers_kronig_2d",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d,doc_f2py_rout_thermal_conductivity_get_lf_calculate_real_part_via_kramers_kronig_2d}, - {"hilbert_transform_via_fft",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft,doc_f2py_rout_thermal_conductivity_get_lf_hilbert_transform_via_fft}, - {"ht",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_ht,doc_f2py_rout_thermal_conductivity_get_lf_ht}, - {"cfft",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_cfft,doc_f2py_rout_thermal_conductivity_get_lf_cfft}, - {"inv",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_inv,doc_f2py_rout_thermal_conductivity_get_lf_inv}, - {"interpolate_fc2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_get_lf_interpolate_fc2,doc_f2py_rout_thermal_conductivity_get_lf_interpolate_fc2}, - {NULL} -}; - -static void f2py_setup_get_lf(char *calculate_lineshapes,char *calculate_lineshapes_mode_mixing,char *calculate_lineshapes_cartesian,char *calculate_lifetimes_selfconsistently,char *solve_selfconsistent_equation,char *calculate_correlation_function,char *calculate_lifetimes_perturbative,char *calculate_lifetimes,char *calculate_self_energy_la,char *calculate_self_energy_p,char *calculate_self_energy_full,char *check_if_gamma,char *vec_dot_mat,char *calculate_real_part_via_kramers_kronig,char *calculate_real_part_via_kramers_kronig_2d,char *hilbert_transform_via_fft,char *ht,char *cfft,char *inv,char *interpolate_fc2) { - int i_f2py=0; - f2py_get_lf_def[i_f2py++].data = calculate_lineshapes; - f2py_get_lf_def[i_f2py++].data = calculate_lineshapes_mode_mixing; - f2py_get_lf_def[i_f2py++].data = calculate_lineshapes_cartesian; - f2py_get_lf_def[i_f2py++].data = calculate_lifetimes_selfconsistently; - f2py_get_lf_def[i_f2py++].data = solve_selfconsistent_equation; - f2py_get_lf_def[i_f2py++].data = calculate_correlation_function; - f2py_get_lf_def[i_f2py++].data = calculate_lifetimes_perturbative; - f2py_get_lf_def[i_f2py++].data = calculate_lifetimes; - f2py_get_lf_def[i_f2py++].data = calculate_self_energy_la; - f2py_get_lf_def[i_f2py++].data = calculate_self_energy_p; - f2py_get_lf_def[i_f2py++].data = calculate_self_energy_full; - f2py_get_lf_def[i_f2py++].data = check_if_gamma; - f2py_get_lf_def[i_f2py++].data = vec_dot_mat; - f2py_get_lf_def[i_f2py++].data = calculate_real_part_via_kramers_kronig; - f2py_get_lf_def[i_f2py++].data = calculate_real_part_via_kramers_kronig_2d; - f2py_get_lf_def[i_f2py++].data = hilbert_transform_via_fft; - f2py_get_lf_def[i_f2py++].data = ht; - f2py_get_lf_def[i_f2py++].data = cfft; - f2py_get_lf_def[i_f2py++].data = inv; - f2py_get_lf_def[i_f2py++].data = interpolate_fc2; -} -extern void F_FUNC_US(f2pyinitget_lf,F2PYINITGET_LF)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_get_lf(void) { - F_FUNC_US(f2pyinitget_lf,F2PYINITGET_LF)(f2py_setup_get_lf); -} - - -static FortranDataDef f2py_scattering_grids_def[] = { - {"get_scattering_q_grid",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid,doc_f2py_rout_thermal_conductivity_scattering_grids_get_scattering_q_grid}, - {"same_vector",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_scattering_grids_same_vector,doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector}, - {"same_vector_nopbc",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc,doc_f2py_rout_thermal_conductivity_scattering_grids_same_vector_nopbc}, - {NULL} -}; - -static void f2py_setup_scattering_grids(char *get_scattering_q_grid,char *same_vector,char *same_vector_nopbc) { - int i_f2py=0; - f2py_scattering_grids_def[i_f2py++].data = get_scattering_q_grid; - f2py_scattering_grids_def[i_f2py++].data = same_vector; - f2py_scattering_grids_def[i_f2py++].data = same_vector_nopbc; -} -extern void F_FUNC_US(f2pyinitscattering_grids,F2PYINITSCATTERING_GRIDS)(void (*)(char *,char *,char *)); -static void f2py_init_scattering_grids(void) { - F_FUNC_US(f2pyinitscattering_grids,F2PYINITSCATTERING_GRIDS)(f2py_setup_scattering_grids); -} - - -static FortranDataDef f2py_third_order_centering_def[] = { - {"analysis",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_analysis,doc_f2py_rout_thermal_conductivity_third_order_centering_analysis}, - {"center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_center,doc_f2py_rout_thermal_conductivity_third_order_centering_center}, - {"center_sparse",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_center_sparse,doc_f2py_rout_thermal_conductivity_third_order_centering_center_sparse}, - {"pre_center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_pre_center,doc_f2py_rout_thermal_conductivity_third_order_centering_pre_center}, - {"assign",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_assign,doc_f2py_rout_thermal_conductivity_third_order_centering_assign}, - {"within_dmax",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_within_dmax,doc_f2py_rout_thermal_conductivity_third_order_centering_within_dmax}, - {"compute_perimeter",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter,doc_f2py_rout_thermal_conductivity_third_order_centering_compute_perimeter}, - {"three_to_one_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len,doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one_len}, - {"three_to_one",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_three_to_one,doc_f2py_rout_thermal_conductivity_third_order_centering_three_to_one}, - {"one_to_three_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len,doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three_len}, - {"one_to_three",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_one_to_three,doc_f2py_rout_thermal_conductivity_third_order_centering_one_to_three}, - {"min_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2,doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_2}, - {"max_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2,doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_2}, - {"min_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3,doc_f2py_rout_thermal_conductivity_third_order_centering_min_el_wise_3}, - {"max_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3,doc_f2py_rout_thermal_conductivity_third_order_centering_max_el_wise_3}, - {"cryst_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart,doc_f2py_rout_thermal_conductivity_third_order_centering_cryst_to_cart}, - {NULL} -}; - -static void f2py_setup_third_order_centering(char *analysis,char *center,char *center_sparse,char *pre_center,char *assign,char *within_dmax,char *compute_perimeter,char *three_to_one_len,char *three_to_one,char *one_to_three_len,char *one_to_three,char *min_el_wise_2,char *max_el_wise_2,char *min_el_wise_3,char *max_el_wise_3,char *cryst_to_cart) { - int i_f2py=0; - f2py_third_order_centering_def[i_f2py++].data = analysis; - f2py_third_order_centering_def[i_f2py++].data = center; - f2py_third_order_centering_def[i_f2py++].data = center_sparse; - f2py_third_order_centering_def[i_f2py++].data = pre_center; - f2py_third_order_centering_def[i_f2py++].data = assign; - f2py_third_order_centering_def[i_f2py++].data = within_dmax; - f2py_third_order_centering_def[i_f2py++].data = compute_perimeter; - f2py_third_order_centering_def[i_f2py++].data = three_to_one_len; - f2py_third_order_centering_def[i_f2py++].data = three_to_one; - f2py_third_order_centering_def[i_f2py++].data = one_to_three_len; - f2py_third_order_centering_def[i_f2py++].data = one_to_three; - f2py_third_order_centering_def[i_f2py++].data = min_el_wise_2; - f2py_third_order_centering_def[i_f2py++].data = max_el_wise_2; - f2py_third_order_centering_def[i_f2py++].data = min_el_wise_3; - f2py_third_order_centering_def[i_f2py++].data = max_el_wise_3; - f2py_third_order_centering_def[i_f2py++].data = cryst_to_cart; -} -extern void F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_centering(void) { - F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(f2py_setup_third_order_centering); -} - - -static FortranDataDef f2py_third_order_cond_def[] = { - {"interpol_v2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_interpol_v2,doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v2}, - {"interpol_v3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_interpol_v3,doc_f2py_rout_thermal_conductivity_third_order_cond_interpol_v3}, - {"compute_full_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_full_dynamic_bubble_single}, - {"compute_diag_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_diag_dynamic_bubble_single}, - {"compute_perturb_selfnrg_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_perturb_selfnrg_single}, - {"compute_spectralf_diag_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single,doc_f2py_rout_thermal_conductivity_third_order_cond_compute_spectralf_diag_single}, - {"lambda_dynamic_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single,doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_single}, - {"lambda_dynamic_value_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single,doc_f2py_rout_thermal_conductivity_third_order_cond_lambda_dynamic_value_single}, - {"calculate_spectral_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function,doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function}, - {"calculate_spectral_function_mode_mixing",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing,doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_mode_mixing}, - {"calculate_spectral_function_cartesian",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian,doc_f2py_rout_thermal_conductivity_third_order_cond_calculate_spectral_function_cartesian}, - {"bose_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_bose_freq,doc_f2py_rout_thermal_conductivity_third_order_cond_bose_freq}, - {"eq_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_eq_freq,doc_f2py_rout_thermal_conductivity_third_order_cond_eq_freq}, - {"f_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_f_bose,doc_f2py_rout_thermal_conductivity_third_order_cond_f_bose}, - {"df_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_df_bose,doc_f2py_rout_thermal_conductivity_third_order_cond_df_bose}, - {"gaussian_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_gaussian_function,doc_f2py_rout_thermal_conductivity_third_order_cond_gaussian_function}, - {"eliminate_transl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl,doc_f2py_rout_thermal_conductivity_third_order_cond_eliminate_transl}, - {"cinv",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thermal_conductivity_third_order_cond_cinv,doc_f2py_rout_thermal_conductivity_third_order_cond_cinv}, - {NULL} -}; - -static void f2py_setup_third_order_cond(char *interpol_v2,char *interpol_v3,char *compute_full_dynamic_bubble_single,char *compute_diag_dynamic_bubble_single,char *compute_perturb_selfnrg_single,char *compute_spectralf_diag_single,char *lambda_dynamic_single,char *lambda_dynamic_value_single,char *calculate_spectral_function,char *calculate_spectral_function_mode_mixing,char *calculate_spectral_function_cartesian,char *bose_freq,char *eq_freq,char *f_bose,char *df_bose,char *gaussian_function,char *eliminate_transl,char *cinv) { - int i_f2py=0; - f2py_third_order_cond_def[i_f2py++].data = interpol_v2; - f2py_third_order_cond_def[i_f2py++].data = interpol_v3; - f2py_third_order_cond_def[i_f2py++].data = compute_full_dynamic_bubble_single; - f2py_third_order_cond_def[i_f2py++].data = compute_diag_dynamic_bubble_single; - f2py_third_order_cond_def[i_f2py++].data = compute_perturb_selfnrg_single; - f2py_third_order_cond_def[i_f2py++].data = compute_spectralf_diag_single; - f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_single; - f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_value_single; - f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function; - f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_mode_mixing; - f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_cartesian; - f2py_third_order_cond_def[i_f2py++].data = bose_freq; - f2py_third_order_cond_def[i_f2py++].data = eq_freq; - f2py_third_order_cond_def[i_f2py++].data = f_bose; - f2py_third_order_cond_def[i_f2py++].data = df_bose; - f2py_third_order_cond_def[i_f2py++].data = gaussian_function; - f2py_third_order_cond_def[i_f2py++].data = eliminate_transl; - f2py_third_order_cond_def[i_f2py++].data = cinv; -} -extern void F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_cond(void) { - F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(f2py_setup_third_order_cond); -} - -/*need_f90modhooks*/ - -/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ - -/******************* See f2py2e/common_rules.py: buildhooks *******************/ - -/*need_commonhooks*/ - -/**************************** See f2py2e/rules.py ****************************/ - -static FortranDataDef f2py_routine_defs[] = { - -/*eof routine_defs*/ - {NULL} -}; - -static PyMethodDef f2py_module_methods[] = { - - {NULL,NULL} -}; - -static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "thermal_conductivity", - NULL, - -1, - f2py_module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit_thermal_conductivity(void) { - int i; - PyObject *m,*d, *s, *tmp; - m = thermal_conductivity_module = PyModule_Create(&moduledef); - Py_SET_TYPE(&PyFortran_Type, &PyType_Type); - import_array(); - if (PyErr_Occurred()) - {PyErr_SetString(PyExc_ImportError, "can't initialize module thermal_conductivity (failed to import numpy)"); return m;} - d = PyModule_GetDict(m); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__version__", s); - Py_DECREF(s); - s = PyUnicode_FromString( - "This module 'thermal_conductivity' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" -"Fortran 90/95 modules:\n"" get_lf --- calculate_lineshapes(),calculate_lineshapes_mode_mixing(),calculate_lineshapes_cartesian(),calculate_lifetimes_selfconsistently(),solve_selfconsistent_equation(),calculate_correlation_function(),calculate_lifetimes_perturbative(),calculate_lifetimes(),calculate_self_energy_la(),calculate_self_energy_p(),calculate_self_energy_full(),check_if_gamma(),vec_dot_mat(),calculate_real_part_via_kramers_kronig(),calculate_real_part_via_kramers_kronig_2d(),hilbert_transform_via_fft(),ht(),cfft(),inv(),interpolate_fc2()"" scattering_grids --- get_scattering_q_grid(),same_vector(),same_vector_nopbc()"" third_order_centering --- analysis(),center(),center_sparse(),pre_center(),assign(),within_dmax(),compute_perimeter(),three_to_one_len(),three_to_one(),one_to_three_len(),one_to_three(),min_el_wise_2(),max_el_wise_2(),min_el_wise_3(),max_el_wise_3(),cryst_to_cart()"" third_order_cond --- interpol_v2(),interpol_v3(),compute_full_dynamic_bubble_single(),compute_diag_dynamic_bubble_single(),compute_perturb_selfnrg_single(),compute_spectralf_diag_single(),lambda_dynamic_single(),lambda_dynamic_value_single(),calculate_spectral_function(),calculate_spectral_function_mode_mixing(),calculate_spectral_function_cartesian(),bose_freq(),eq_freq(),f_bose(),df_bose(),gaussian_function(),eliminate_transl(),cinv()""."); - PyDict_SetItemString(d, "__doc__", s); - Py_DECREF(s); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__f2py_numpy_version__", s); - Py_DECREF(s); - thermal_conductivity_error = PyErr_NewException ("thermal_conductivity.error", NULL, NULL); - /* - * Store the error object inside the dict, so that it could get deallocated. - * (in practice, this is a module, so it likely will not and cannot.) - */ - PyDict_SetItemString(d, "_thermal_conductivity_error", thermal_conductivity_error); - Py_DECREF(thermal_conductivity_error); - for(i=0;f2py_routine_defs[i].name!=NULL;i++) { - tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); - PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); - Py_DECREF(tmp); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/*eof initf2pywraphooks*/ - PyDict_SetItemString(d, "third_order_cond", PyFortranObject_New(f2py_third_order_cond_def,f2py_init_third_order_cond)); - PyDict_SetItemString(d, "third_order_centering", PyFortranObject_New(f2py_third_order_centering_def,f2py_init_third_order_centering)); - PyDict_SetItemString(d, "scattering_grids", PyFortranObject_New(f2py_scattering_grids_def,f2py_init_scattering_grids)); - PyDict_SetItemString(d, "get_lf", PyFortranObject_New(f2py_get_lf_def,f2py_init_get_lf)); -/*eof initf90modhooks*/ - -/*eof initcommonhooks*/ - - -#ifdef F2PY_REPORT_ATEXIT - if (! PyErr_Occurred()) - on_exit(f2py_report_on_exit,(void*)"thermal_conductivity"); -#endif - return m; -} -#ifdef __cplusplus -} -#endif diff --git a/f2py_wrappers/thirdorder-f2pywrappers2.f90 b/f2py_wrappers/thirdorder-f2pywrappers2.f90 deleted file mode 100644 index 2e7ee112..00000000 --- a/f2py_wrappers/thirdorder-f2pywrappers2.f90 +++ /dev/null @@ -1,585 +0,0 @@ -! -*- f90 -*- -! This file is autogenerated with f2py (version:1.26.4) -! It contains Fortran 90 wrappers to fortran functions. - - subroutine f2py_third_order_asr_getdims_p(r,s,f2pysetdata,flag) - use third_order_asr, only: d => 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),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_third_order_asr_getdims_p - subroutine f2py_third_order_asr_getdims_index_blocks_r2(r,s,f2pyse& - &tdata,flag) - use third_order_asr, only: d => index_blocks_r2 - - 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_third_order_asr_getdims_index_blocks_r2 - subroutine f2py_third_order_asr_getdims_num_blocks_r2(r,s,f2pysetd& - &ata,flag) - use third_order_asr, only: d => num_blocks_r2 - - 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_third_order_asr_getdims_num_blocks_r2 - subroutine f2pywrap_third_order_asr_geq (geqf2pywrap, v1, v2, lat,& - & pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) - use third_order_asr, only : geq - logical pbc - integer f2py_v1_d0 - integer f2py_v2_d0 - integer f2py_lat_d0 - integer v1(f2py_v1_d0) - integer v2(f2py_v2_d0) - integer lat(f2py_lat_d0) - logical geqf2pywrap - geqf2pywrap = .not.(.not.geq(v1, v2, lat, pbc)) - end subroutine f2pywrap_third_order_asr_geq - subroutine f2pywrap_third_order_asr_f (ff2pywrap, x) - use third_order_asr, only : f - integer x(6) - integer ff2pywrap(6,5) - ff2pywrap = f(x) - end subroutine f2pywrap_third_order_asr_f - - subroutine f2pyinitthird_order_asr(f2pysetupfunc) - use third_order_asr, only : perm_initialized - use third_order_asr, only : p - use third_order_asr, only : r2index_initialized - use third_order_asr, only : index_blocks_r2 - use third_order_asr, only : num_blocks_r2 - use third_order_asr, only : initialize_r2index - use third_order_asr, only : initialize_perm - use third_order_asr, only : impose_perm_sym - use third_order_asr, only : impose_asr_3rd - use third_order_asr, only : impose_asr - interface - subroutine f2pywrap_third_order_asr_geq (geqf2pywrap, v1, v2, lat,& - & pbc, f2py_v1_d0, f2py_v2_d0, f2py_lat_d0) - logical pbc - integer f2py_v1_d0 - integer f2py_v2_d0 - integer f2py_lat_d0 - integer v1(f2py_v1_d0) - integer v2(f2py_v2_d0) - integer lat(f2py_lat_d0) - logical geqf2pywrap - end subroutine f2pywrap_third_order_asr_geq - subroutine f2pywrap_third_order_asr_f (ff2pywrap, x) - integer x(6) - integer ff2pywrap(6,5) - end subroutine f2pywrap_third_order_asr_f - end interface - external f2pysetupfunc - external f2py_third_order_asr_getdims_p - external f2py_third_order_asr_getdims_index_blocks_r2 - external f2py_third_order_asr_getdims_num_blocks_r2 - call f2pysetupfunc(perm_initialized,f2py_third_order_asr_getdims_p& - &,r2index_initialized,f2py_third_order_asr_getdims_index_blocks_r2,& - &f2py_third_order_asr_getdims_num_blocks_r2,initialize_r2index,init& - &ialize_perm,f2pywrap_third_order_asr_geq,f2pywrap_third_order_asr_& - &f,impose_perm_sym,impose_asr_3rd,impose_asr) - end subroutine f2pyinitthird_order_asr - - subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& - &f2pywrap, v1, v2, v3, d1, d2, d3, tol) - use third_order_centering, only : within_dmax - real(kind=8) d1 - real(kind=8) d2 - real(kind=8) d3 - real(kind=8) tol - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - logical within_dmaxf2pywrap - within_dmaxf2pywrap = .not.(.not.within_dmax(v1, v2, v3, d1, d2, d& - &3, tol)) - end subroutine f2pywrap_third_order_centering_within_dmax - subroutine f2pywrap_third_order_centering_compute_perimeter (compu& - &te_perimeterf2pywrap, v1, v2, v3) - use third_order_centering, only : compute_perimeter - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - real(kind=8) compute_perimeterf2pywrap - compute_perimeterf2pywrap = compute_perimeter(v1, v2, v3) - end subroutine f2pywrap_third_order_centering_compute_perimeter - subroutine f2pywrap_third_order_centering_three_to_one_len (three_& - &to_one_lenf2pywrap, v, v_min, v_len) - use third_order_centering, only : three_to_one_len - integer v(3) - integer v_min(3) - integer v_len(3) - integer three_to_one_lenf2pywrap - three_to_one_lenf2pywrap = three_to_one_len(v, v_min, v_len) - end subroutine f2pywrap_third_order_centering_three_to_one_len - subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& - &nef2pywrap, v, v_min, v_max) - use third_order_centering, only : three_to_one - integer v(3) - integer v_min(3) - integer v_max(3) - integer three_to_onef2pywrap - three_to_onef2pywrap = three_to_one(v, v_min, v_max) - end subroutine f2pywrap_third_order_centering_three_to_one - subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& - &_three_lenf2pywrap, j, v_min, v_len) - use third_order_centering, only : one_to_three_len - integer j - integer v_min(3) - integer v_len(3) - integer one_to_three_lenf2pywrap(3) - one_to_three_lenf2pywrap = one_to_three_len(j, v_min, v_len) - end subroutine f2pywrap_third_order_centering_one_to_three_len - subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& - &eef2pywrap, j, v_min, v_max) - use third_order_centering, only : one_to_three - integer j - integer v_min(3) - integer v_max(3) - integer one_to_threef2pywrap(3) - one_to_threef2pywrap = one_to_three(j, v_min, v_max) - end subroutine f2pywrap_third_order_centering_one_to_three - subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& - &se_2f2pywrap, a, b) - use third_order_centering, only : min_el_wise_2 - integer a(3) - integer b(3) - integer min_el_wise_2f2pywrap(3) - min_el_wise_2f2pywrap = min_el_wise_2(a, b) - end subroutine f2pywrap_third_order_centering_min_el_wise_2 - subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& - &se_2f2pywrap, a, b) - use third_order_centering, only : max_el_wise_2 - integer a(3) - integer b(3) - integer max_el_wise_2f2pywrap(3) - max_el_wise_2f2pywrap = max_el_wise_2(a, b) - end subroutine f2pywrap_third_order_centering_max_el_wise_2 - subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& - &se_3f2pywrap, a, b, c) - use third_order_centering, only : min_el_wise_3 - integer a(3) - integer b(3) - integer c(3) - integer min_el_wise_3f2pywrap(3) - min_el_wise_3f2pywrap = min_el_wise_3(a, b, c) - end subroutine f2pywrap_third_order_centering_min_el_wise_3 - subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& - &se_3f2pywrap, a, b, c) - use third_order_centering, only : max_el_wise_3 - integer a(3) - integer b(3) - integer c(3) - integer max_el_wise_3f2pywrap(3) - max_el_wise_3f2pywrap = max_el_wise_3(a, b, c) - end subroutine f2pywrap_third_order_centering_max_el_wise_3 - subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& - &cartf2pywrap, v, alat) - use third_order_centering, only : cryst_to_cart - integer v(3) - real(kind=8) alat(3,3) - real(kind=8) cryst_to_cartf2pywrap(3) - cryst_to_cartf2pywrap = cryst_to_cart(v, alat) - end subroutine f2pywrap_third_order_centering_cryst_to_cart - - subroutine f2pyinitthird_order_centering(f2pysetupfunc) - use third_order_centering, only : analysis - use third_order_centering, only : center - use third_order_centering, only : center_sparse - use third_order_centering, only : pre_center - use third_order_centering, only : assign - interface - subroutine f2pywrap_third_order_centering_within_dmax (within_dmax& - &f2pywrap, v1, v2, v3, d1, d2, d3, tol) - real(kind=8) d1 - real(kind=8) d2 - real(kind=8) d3 - real(kind=8) tol - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - logical within_dmaxf2pywrap - end subroutine f2pywrap_third_order_centering_within_dmax - subroutine f2pywrap_third_order_centering_compute_perimeter (compu& - &te_perimeterf2pywrap, v1, v2, v3) - real(kind=8) v1(3) - real(kind=8) v2(3) - real(kind=8) v3(3) - real(kind=8) compute_perimeterf2pywrap - end subroutine f2pywrap_third_order_centering_compute_perimeter - subroutine f2pywrap_third_order_centering_three_to_one_len (three_& - &to_one_lenf2pywrap, v, v_min, v_len) - integer v(3) - integer v_min(3) - integer v_len(3) - integer three_to_one_lenf2pywrap - end subroutine f2pywrap_third_order_centering_three_to_one_len - subroutine f2pywrap_third_order_centering_three_to_one (three_to_o& - &nef2pywrap, v, v_min, v_max) - integer v(3) - integer v_min(3) - integer v_max(3) - integer three_to_onef2pywrap - end subroutine f2pywrap_third_order_centering_three_to_one - subroutine f2pywrap_third_order_centering_one_to_three_len (one_to& - &_three_lenf2pywrap, j, v_min, v_len) - integer j - integer v_min(3) - integer v_len(3) - integer one_to_three_lenf2pywrap(3) - end subroutine f2pywrap_third_order_centering_one_to_three_len - subroutine f2pywrap_third_order_centering_one_to_three (one_to_thr& - &eef2pywrap, j, v_min, v_max) - integer j - integer v_min(3) - integer v_max(3) - integer one_to_threef2pywrap(3) - end subroutine f2pywrap_third_order_centering_one_to_three - subroutine f2pywrap_third_order_centering_min_el_wise_2 (min_el_wi& - &se_2f2pywrap, a, b) - integer a(3) - integer b(3) - integer min_el_wise_2f2pywrap(3) - end subroutine f2pywrap_third_order_centering_min_el_wise_2 - subroutine f2pywrap_third_order_centering_max_el_wise_2 (max_el_wi& - &se_2f2pywrap, a, b) - integer a(3) - integer b(3) - integer max_el_wise_2f2pywrap(3) - end subroutine f2pywrap_third_order_centering_max_el_wise_2 - subroutine f2pywrap_third_order_centering_min_el_wise_3 (min_el_wi& - &se_3f2pywrap, a, b, c) - integer a(3) - integer b(3) - integer c(3) - integer min_el_wise_3f2pywrap(3) - end subroutine f2pywrap_third_order_centering_min_el_wise_3 - subroutine f2pywrap_third_order_centering_max_el_wise_3 (max_el_wi& - &se_3f2pywrap, a, b, c) - integer a(3) - integer b(3) - integer c(3) - integer max_el_wise_3f2pywrap(3) - end subroutine f2pywrap_third_order_centering_max_el_wise_3 - subroutine f2pywrap_third_order_centering_cryst_to_cart (cryst_to_& - &cartf2pywrap, v, alat) - integer v(3) - real(kind=8) alat(3,3) - real(kind=8) cryst_to_cartf2pywrap(3) - end subroutine f2pywrap_third_order_centering_cryst_to_cart - end interface - external f2pysetupfunc - call f2pysetupfunc(analysis,center,center_sparse,pre_center,assign& - &,f2pywrap_third_order_centering_within_dmax,f2pywrap_third_order_c& - &entering_compute_perimeter,f2pywrap_third_order_centering_three_to& - &_one_len,f2pywrap_third_order_centering_three_to_one,f2pywrap_thir& - &d_order_centering_one_to_three_len,f2pywrap_third_order_centering_& - &one_to_three,f2pywrap_third_order_centering_min_el_wise_2,f2pywrap& - &_third_order_centering_max_el_wise_2,f2pywrap_third_order_centerin& - &g_min_el_wise_3,f2pywrap_third_order_centering_max_el_wise_3,f2pyw& - &rap_third_order_centering_cryst_to_cart) - end subroutine f2pyinitthird_order_centering - - subroutine f2pywrap_third_order_cond_centering_norm (normf2pywrap,& - & r) - use third_order_cond_centering, only : norm - real(kind=8) r(3) - real(kind=8) normf2pywrap - normf2pywrap = norm(r) - end subroutine f2pywrap_third_order_cond_centering_norm - subroutine f2pywrap_third_order_cond_centering_norma2 (norma2f2pyw& - &rap, m, f2py_m_d0, f2py_m_d1) - use third_order_cond_centering, only : norma2 - integer f2py_m_d0 - integer f2py_m_d1 - real(kind=8) m(f2py_m_d0,f2py_m_d1) - real(kind=8) norma2f2pywrap - norma2f2pywrap = norma2(m) - end subroutine f2pywrap_third_order_cond_centering_norma2 - subroutine f2pywrap_third_order_cond_centering_norma3 (norma3f2pyw& - &rap, m, f2py_m_d0, f2py_m_d1, f2py_m_d2) - use third_order_cond_centering, only : norma3 - integer f2py_m_d0 - integer f2py_m_d1 - integer f2py_m_d2 - real(kind=8) m(f2py_m_d0,f2py_m_d1,f2py_m_d2) - real(kind=8) norma3f2pywrap - norma3f2pywrap = norma3(m) - end subroutine f2pywrap_third_order_cond_centering_norma3 - subroutine f2pywrap_third_order_cond_centering_dot (dotf2pywrap, v& - &, m) - use third_order_cond_centering, only : dot - real(kind=8) v(3) - real(kind=8) m(3,3) - real(kind=8) dotf2pywrap(3) - dotf2pywrap = dot(v, m) - end subroutine f2pywrap_third_order_cond_centering_dot - - subroutine f2pyinitthird_order_cond_centering(f2pysetupfunc) - use third_order_cond_centering, only : check_permutation_symmetry - use third_order_cond_centering, only : apply_permutation_symmetry - use third_order_cond_centering, only : apply_permutation_symmetry_& - &local - use third_order_cond_centering, only : number_of_triplets - use third_order_cond_centering, only : find_triplets - use third_order_cond_centering, only : distribute_fc3 - use third_order_cond_centering, only : apply_asr - use third_order_cond_centering, only : find_unique_rvec - interface - subroutine f2pywrap_third_order_cond_centering_norm (normf2pywrap,& - & r) - real(kind=8) r(3) - real(kind=8) normf2pywrap - end subroutine f2pywrap_third_order_cond_centering_norm - subroutine f2pywrap_third_order_cond_centering_norma2 (norma2f2pyw& - &rap, m, f2py_m_d0, f2py_m_d1) - integer f2py_m_d0 - integer f2py_m_d1 - real(kind=8) m(f2py_m_d0,f2py_m_d1) - real(kind=8) norma2f2pywrap - end subroutine f2pywrap_third_order_cond_centering_norma2 - subroutine f2pywrap_third_order_cond_centering_norma3 (norma3f2pyw& - &rap, m, f2py_m_d0, f2py_m_d1, f2py_m_d2) - integer f2py_m_d0 - integer f2py_m_d1 - integer f2py_m_d2 - real(kind=8) m(f2py_m_d0,f2py_m_d1,f2py_m_d2) - real(kind=8) norma3f2pywrap - end subroutine f2pywrap_third_order_cond_centering_norma3 - subroutine f2pywrap_third_order_cond_centering_dot (dotf2pywrap, v& - &, m) - real(kind=8) v(3) - real(kind=8) m(3,3) - real(kind=8) dotf2pywrap(3) - end subroutine f2pywrap_third_order_cond_centering_dot - end interface - external f2pysetupfunc - call f2pysetupfunc(check_permutation_symmetry,apply_permutation_sy& - &mmetry,apply_permutation_symmetry_local,number_of_triplets,find_tr& - &iplets,distribute_fc3,apply_asr,find_unique_rvec,f2pywrap_third_or& - &der_cond_centering_norm,f2pywrap_third_order_cond_centering_norma2& - &,f2pywrap_third_order_cond_centering_norma3,f2pywrap_third_order_c& - &ond_centering_dot) - end subroutine f2pyinitthird_order_cond_centering - - subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& - & t) - use third_order_cond, only : f_bose - real(kind=8) freq - real(kind=8) t - real(kind=8) f_bosef2pywrap - f_bosef2pywrap = f_bose(freq, t) - end subroutine f2pywrap_third_order_cond_f_bose - subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& - &q, t) - use third_order_cond, only : df_bose - real(kind=8) freq - real(kind=8) t - real(kind=8) df_bosef2pywrap - df_bosef2pywrap = df_bose(freq, t) - end subroutine f2pywrap_third_order_cond_df_bose - subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& - &unctionf2pywrap, x, sigma) - use third_order_cond, only : gaussian_function - real(kind=8) x - real(kind=8) sigma - real(kind=8) gaussian_functionf2pywrap - gaussian_functionf2pywrap = gaussian_function(x, sigma) - end subroutine f2pywrap_third_order_cond_gaussian_function - subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& - &_d0, f2py_a_d1) - use third_order_cond, only : cinv - integer f2py_a_d0 - integer f2py_a_d1 - complex(kind=8) a(f2py_a_d0,f2py_a_d1) - complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) - cinvf2pywrap = cinv(a) - end subroutine f2pywrap_third_order_cond_cinv - - subroutine f2pyinitthird_order_cond(f2pysetupfunc) - use third_order_cond, only : interpol_v2 - use third_order_cond, only : interpol_v3 - use third_order_cond, only : compute_full_dynamic_bubble_single - use third_order_cond, only : compute_diag_dynamic_bubble_single - use third_order_cond, only : compute_perturb_selfnrg_single - use third_order_cond, only : compute_spectralf_diag_single - use third_order_cond, only : lambda_dynamic_single - use third_order_cond, only : lambda_dynamic_value_single - use third_order_cond, only : calculate_spectral_function - use third_order_cond, only : calculate_spectral_function_mode_mixi& - &ng - use third_order_cond, only : calculate_spectral_function_cartesian - use third_order_cond, only : bose_freq - use third_order_cond, only : eq_freq - use third_order_cond, only : eliminate_transl - interface - subroutine f2pywrap_third_order_cond_f_bose (f_bosef2pywrap, freq,& - & t) - real(kind=8) freq - real(kind=8) t - real(kind=8) f_bosef2pywrap - end subroutine f2pywrap_third_order_cond_f_bose - subroutine f2pywrap_third_order_cond_df_bose (df_bosef2pywrap, fre& - &q, t) - real(kind=8) freq - real(kind=8) t - real(kind=8) df_bosef2pywrap - end subroutine f2pywrap_third_order_cond_df_bose - subroutine f2pywrap_third_order_cond_gaussian_function (gaussian_f& - &unctionf2pywrap, x, sigma) - real(kind=8) x - real(kind=8) sigma - real(kind=8) gaussian_functionf2pywrap - end subroutine f2pywrap_third_order_cond_gaussian_function - subroutine f2pywrap_third_order_cond_cinv (cinvf2pywrap, a, f2py_a& - &_d0, f2py_a_d1) - integer f2py_a_d0 - integer f2py_a_d1 - complex(kind=8) a(f2py_a_d0,f2py_a_d1) - complex(kind=8) cinvf2pywrap(size(a, 1),size(a, 2)) - end subroutine f2pywrap_third_order_cond_cinv - end interface - external f2pysetupfunc - call f2pysetupfunc(interpol_v2,interpol_v3,compute_full_dynamic_bu& - &bble_single,compute_diag_dynamic_bubble_single,compute_perturb_sel& - &fnrg_single,compute_spectralf_diag_single,lambda_dynamic_single,la& - &mbda_dynamic_value_single,calculate_spectral_function,calculate_sp& - &ectral_function_mode_mixing,calculate_spectral_function_cartesian,& - &bose_freq,eq_freq,f2pywrap_third_order_cond_f_bose,f2pywrap_third_& - &order_cond_df_bose,f2pywrap_third_order_cond_gaussian_function,eli& - &minate_transl,f2pywrap_third_order_cond_cinv) - end subroutine f2pyinitthird_order_cond - - subroutine f2pywrap_third_order_bubble_f_bose (f_bosef2pywrap, fre& - &q, t) - use third_order_bubble, only : f_bose - real(kind=8) freq - real(kind=8) t - real(kind=8) f_bosef2pywrap - f_bosef2pywrap = f_bose(freq, t) - end subroutine f2pywrap_third_order_bubble_f_bose - subroutine f2pywrap_third_order_bubble_df_bose (df_bosef2pywrap, f& - &req, t) - use third_order_bubble, only : df_bose - real(kind=8) freq - real(kind=8) t - real(kind=8) df_bosef2pywrap - df_bosef2pywrap = df_bose(freq, t) - end subroutine f2pywrap_third_order_bubble_df_bose - - subroutine f2pyinitthird_order_bubble(f2pysetupfunc) - use third_order_bubble, only : compute_static_bubble - use third_order_bubble, only : compute_dynamic_bubble - use third_order_bubble, only : compute_diag_dynamic_bubble - use third_order_bubble, only : compute_perturb_selfnrg - use third_order_bubble, only : compute_spectralf - use third_order_bubble, only : compute_spectralf_diag - use third_order_bubble, only : lambda - use third_order_bubble, only : lambda_dynamic - use third_order_bubble, only : lambda_dynamic_value - use third_order_bubble, only : bose_freq - use third_order_bubble, only : invzmat - use third_order_bubble, only : eliminate_transl - interface - subroutine f2pywrap_third_order_bubble_f_bose (f_bosef2pywrap, fre& - &q, t) - real(kind=8) freq - real(kind=8) t - real(kind=8) f_bosef2pywrap - end subroutine f2pywrap_third_order_bubble_f_bose - subroutine f2pywrap_third_order_bubble_df_bose (df_bosef2pywrap, f& - &req, t) - real(kind=8) freq - real(kind=8) t - real(kind=8) df_bosef2pywrap - end subroutine f2pywrap_third_order_bubble_df_bose - end interface - external f2pysetupfunc - call f2pysetupfunc(compute_static_bubble,compute_dynamic_bubble,co& - &mpute_diag_dynamic_bubble,compute_perturb_selfnrg,compute_spectral& - &f,compute_spectralf_diag,lambda,lambda_dynamic,lambda_dynamic_valu& - &e,bose_freq,f2pywrap_third_order_bubble_f_bose,f2pywrap_third_orde& - &r_bubble_df_bose,invzmat,eliminate_transl) - end subroutine f2pyinitthird_order_bubble - - - subroutine f2pyinitthird_order_interpol(f2pysetupfunc) - use third_order_interpol, only : interpol - external f2pysetupfunc - call f2pysetupfunc(interpol) - end subroutine f2pyinitthird_order_interpol - - diff --git a/f2py_wrappers/thirdordermodule.c b/f2py_wrappers/thirdordermodule.c deleted file mode 100644 index 4279164d..00000000 --- a/f2py_wrappers/thirdordermodule.c +++ /dev/null @@ -1,13066 +0,0 @@ -/* File: thirdordermodule.c - * This file is auto-generated with f2py (version:1.26.4). - * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, - * written by Pearu Peterson . - * Generation date: Mon Sep 15 06:38:01 2025 - * Do not edit this file directly unless you know what you are doing!!! - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ - -/* Unconditionally included */ -#include -#include - -/*********************** See f2py2e/cfuncs.py: includes ***********************/ -#include "fortranobject.h" -#include - -/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ -static PyObject *thirdorder_error; -static PyObject *thirdorder_module; - -/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ -typedef struct {double r,i;} complex_double; - -/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ -/*need_typedefs_generated*/ - -/********************** See f2py2e/cfuncs.py: cppmacros **********************/ - -/* See fortranobject.h for definitions. The macros here are provided for BC. */ -#define rank f2py_rank -#define shape f2py_shape -#define fshape f2py_shape -#define len f2py_len -#define flen f2py_flen -#define slen f2py_slen -#define size f2py_size - - -#define CHECKSCALAR(check,tcheck,name,show,var)\ - if (!(check)) {\ - char errstring[256];\ - sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ - PyErr_SetString(thirdorder_error,errstring);\ - /*goto capi_fail;*/\ - } else - -#ifdef DEBUGCFUNCS -#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); -#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ - PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ - fprintf(stderr,"\n"); -#else -#define CFUNCSMESS(mess) -#define CFUNCSMESSPY(mess,obj) -#endif - - -#ifndef max -#define max(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) ((a < b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a,b) ((a < b) ? (a) : (b)) -#endif - - -#define CHECKARRAY(check,tcheck,name) \ - if (!(check)) {\ - PyErr_SetString(thirdorder_error,"("tcheck") failed for "name);\ - /*goto capi_fail;*/\ - } else - -#define pyobj_from_complex_double1(v) (PyComplex_FromDoubles(v.r,v.i)) - -#if defined(PREPEND_FORTRAN) -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F -#else -#define F_FUNC(f,F) _##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F##_ -#else -#define F_FUNC(f,F) _##f##_ -#endif -#endif -#else -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F -#else -#define F_FUNC(f,F) f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F##_ -#else -#define F_FUNC(f,F) f##_ -#endif -#endif -#endif -#if defined(UNDERSCORE_G77) -#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) -#else -#define F_FUNC_US(f,F) F_FUNC(f,F) -#endif - - -/************************ See f2py2e/cfuncs.py: cfuncs ************************/ - -static int -int_from_pyobj(int* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - - if (PyLong_Check(obj)) { - *v = Npy__PyLong_AsInt(obj); - return !(*v == -1 && PyErr_Occurred()); - } - - tmp = PyNumber_Long(obj); - if (tmp) { - *v = Npy__PyLong_AsInt(tmp); - Py_DECREF(tmp); - return !(*v == -1 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (int_from_pyobj(v, tmp, errmess)) { - Py_DECREF(tmp); - return 1; - } - Py_DECREF(tmp); - } - - { - PyObject* err = PyErr_Occurred(); - if (err == NULL) { - err = thirdorder_error; - } - PyErr_SetString(err, errmess); - } - return 0; -} - - -static int -double_from_pyobj(double* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - if (PyFloat_Check(obj)) { - *v = PyFloat_AsDouble(obj); - return !(*v == -1.0 && PyErr_Occurred()); - } - - tmp = PyNumber_Float(obj); - if (tmp) { - *v = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return !(*v == -1.0 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} - Py_DECREF(tmp); - } - { - PyObject* err = PyErr_Occurred(); - if (err==NULL) err = thirdorder_error; - PyErr_SetString(err,errmess); - } - return 0; -} - - -/********************* See f2py2e/cfuncs.py: userincludes *********************/ -/*need_userincludes*/ - -/********************* See f2py2e/capi_rules.py: usercode *********************/ - - -/* See f2py2e/rules.py */ -/*eof externroutines*/ - -/******************** See f2py2e/capi_rules.py: usercode1 ********************/ - - -/******************* See f2py2e/cb_rules.py: buildcallback *******************/ -/*need_callbacks*/ - -/*********************** See f2py2e/rules.py: buildapi ***********************/ - -/***************************** initialize_r2index *****************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_initialize_r2index[] = "\ -initialize_r2index(xr2,xr2list,pbc,[totnum_r2,n_blocks,sclat])\n\nWrapper for ``initialize_r2index``.\ -\n\nParameters\n----------\n" -"xr2 : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2list : input rank-2 array('i') with bounds (3,totnum_r2)\n" -"pbc : input int\n" -"\nOther Parameters\n----------------\n" -"totnum_r2 : input int, optional\n Default: shape(xr2list, 1)\n" -"n_blocks : input int, optional\n Default: shape(xr2, 1)\n" -"sclat : input rank-1 array('i') with bounds (3)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_asr_initialize_r2index(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *xr2 = NULL; - npy_intp xr2_Dims[2] = {-1, -1}; - const int xr2_Rank = 2; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr2list = NULL; - npy_intp xr2list_Dims[2] = {-1, -1}; - const int xr2list_Rank = 2; - PyArrayObject *capi_xr2list_as_array = NULL; - int capi_xr2list_intent = 0; - PyObject *xr2list_capi = Py_None; - int totnum_r2 = 0; - PyObject *totnum_r2_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - static char *capi_kwlist[] = {"xr2","xr2list","pbc","totnum_r2","n_blocks","sclat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OOO:thirdorder.third_order_asr.initialize_r2index",\ - capi_kwlist,&xr2_capi,&xr2list_capi,&pbc_capi,&totnum_r2_capi,&n_blocks_capi,&sclat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable xr2 */ - xr2_Dims[0]=3; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_r2index: failed to create array from the 1st argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - /* Processing variable xr2list */ - xr2list_Dims[0]=3; - capi_xr2list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_r2index: failed to create array from the 2nd argument `xr2list`"; - capi_xr2list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2list_Dims,xr2list_Rank, capi_xr2list_intent,xr2list_capi,capi_errmess); - if (capi_xr2list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2list = (int *)(PyArray_DATA(capi_xr2list_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN|F2PY_OPTIONAL; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_r2index: failed to create array from the 3rd keyword `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.initialize_r2index() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2, 1) == n_blocks,"shape(xr2, 1) == n_blocks","2nd keyword n_blocks","initialize_r2index:n_blocks=%d",n_blocks) { - /* Processing variable totnum_r2 */ - if (totnum_r2_capi == Py_None) totnum_r2 = shape(xr2list, 1); else - f2py_success = int_from_pyobj(&totnum_r2,totnum_r2_capi,"thirdorder.third_order_asr.initialize_r2index() 1st keyword (totnum_r2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2list, 1) == totnum_r2,"shape(xr2list, 1) == totnum_r2","1st keyword totnum_r2","initialize_r2index:totnum_r2=%d",totnum_r2) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(xr2,xr2list,&totnum_r2,&n_blocks,sclat,&pbc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(xr2list, 1) == totnum_r2)*/ - } /*if (f2py_success) of totnum_r2*/ - /* End of cleaning variable totnum_r2 */ - } /*CHECKSCALAR(shape(xr2, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_xr2list_as_array!=xr2list_capi) { - Py_XDECREF(capi_xr2list_as_array); } - } /* if (capi_xr2list_as_array == NULL) ... else of xr2list */ - /* End of cleaning variable xr2list */ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of initialize_r2index *************************/ - -/****************************** initialize_perm ******************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_initialize_perm[] = "\ -initialize_perm(r23,sclat,pbc,[n_blocks])\n\nWrapper for ``initialize_perm``.\ -\n\nParameters\n----------\n" -"r23 : input rank-2 array('i') with bounds (6,n_blocks)\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(r23, 1)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_asr_initialize_perm(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *r23 = NULL; - npy_intp r23_Dims[2] = {-1, -1}; - const int r23_Rank = 2; - PyArrayObject *capi_r23_as_array = NULL; - int capi_r23_intent = 0; - PyObject *r23_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - static char *capi_kwlist[] = {"r23","sclat","pbc","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:thirdorder.third_order_asr.initialize_perm",\ - capi_kwlist,&r23_capi,&sclat_capi,&pbc_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable r23 */ - r23_Dims[0]=6; - capi_r23_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_perm: failed to create array from the 1st argument `r23`"; - capi_r23_as_array = ndarray_from_pyobj( NPY_INT,1,r23_Dims,r23_Rank, capi_r23_intent,r23_capi,capi_errmess); - if (capi_r23_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r23 = (int *)(PyArray_DATA(capi_r23_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.initialize_perm: failed to create array from the 2nd argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(r23, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.initialize_perm() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(r23, 1) == n_blocks,"shape(r23, 1) == n_blocks","1st keyword n_blocks","initialize_perm:n_blocks=%d",n_blocks) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(r23,&n_blocks,sclat,&pbc); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(r23, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_r23_as_array!=r23_capi) { - Py_XDECREF(capi_r23_as_array); } - } /* if (capi_r23_as_array == NULL) ... else of r23 */ - /* End of cleaning variable r23 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of initialize_perm ***************************/ - -/************************************ geq ************************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_geq[] = "\ -geq = geq(v1,v2,lat,pbc)\n\nWrapper for ``geq``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('i') with bounds (f2py_v1_d0)\n" -"v2 : input rank-1 array('i') with bounds (f2py_v2_d0)\n" -"lat : input rank-1 array('i') with bounds (f2py_lat_d0)\n" -"pbc : input int\n" -"\nReturns\n-------\n" -"geq : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_asr_geq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int geqf2pywrap = 0; - int *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - int *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - int *lat = NULL; - npy_intp lat_Dims[1] = {-1}; - const int lat_Rank = 1; - PyArrayObject *capi_lat_as_array = NULL; - int capi_lat_intent = 0; - PyObject *lat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - int f2py_v1_d0 = 0; - int f2py_v2_d0 = 0; - int f2py_lat_d0 = 0; - static char *capi_kwlist[] = {"v1","v2","lat","pbc",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:thirdorder.third_order_asr.geq",\ - capi_kwlist,&v1_capi,&v2_capi,&lat_capi,&pbc_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - ; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.geq: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_INT,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (int *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - ; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.geq: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_INT,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (int *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable lat */ - ; - capi_lat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.geq: failed to create array from the 3rd argument `lat`"; - capi_lat_as_array = ndarray_from_pyobj( NPY_INT,1,lat_Dims,lat_Rank, capi_lat_intent,lat_capi,capi_errmess); - if (capi_lat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat = (int *)(PyArray_DATA(capi_lat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable geqf2pywrap */ - /* Processing variable f2py_v1_d0 */ - f2py_v1_d0 = shape(v1, 0); - /* Processing variable f2py_v2_d0 */ - f2py_v2_d0 = shape(v2, 0); - /* Processing variable f2py_lat_d0 */ - f2py_lat_d0 = shape(lat, 0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&geqf2pywrap,v1,v2,lat,&pbc,&f2py_v1_d0,&f2py_v2_d0,&f2py_lat_d0); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",geqf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_lat_d0 */ - /* End of cleaning variable f2py_v2_d0 */ - /* End of cleaning variable f2py_v1_d0 */ - /* End of cleaning variable geqf2pywrap */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_lat_as_array!=lat_capi) { - Py_XDECREF(capi_lat_as_array); } - } /* if (capi_lat_as_array == NULL) ... else of lat */ - /* End of cleaning variable lat */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of geq *********************************/ - -/************************************* f *************************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_f[] = "\ -f = f(x)\n\nWrapper for ``f``.\ -\n\nParameters\n----------\n" -"x : input rank-1 array('i') with bounds (6)\n" -"\nReturns\n-------\n" -"f : rank-2 array('i') with bounds (6,5) and ff2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_asr_f(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *ff2pywrap = NULL; - npy_intp ff2pywrap_Dims[2] = {-1, -1}; - const int ff2pywrap_Rank = 2; - PyArrayObject *capi_ff2pywrap_as_array = NULL; - int capi_ff2pywrap_intent = 0; - int *x = NULL; - npy_intp x_Dims[1] = {-1}; - const int x_Rank = 1; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - static char *capi_kwlist[] = {"x",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thirdorder.third_order_asr.f",\ - capi_kwlist,&x_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - x_Dims[0]=6; - capi_x_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.f: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_INT,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (int *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable ff2pywrap */ - ff2pywrap_Dims[0]=6,ff2pywrap_Dims[1]=5; - capi_ff2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.f: failed to create array from the hidden `ff2pywrap`"; - capi_ff2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,ff2pywrap_Dims,ff2pywrap_Rank, capi_ff2pywrap_intent,Py_None,capi_errmess); - if (capi_ff2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ff2pywrap = (int *)(PyArray_DATA(capi_ff2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ff2pywrap,x); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_ff2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_ff2pywrap_as_array == NULL) ... else of ff2pywrap */ - /* End of cleaning variable ff2pywrap */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************** end of f **********************************/ - -/****************************** impose_perm_sym ******************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_impose_perm_sym[] = "\ -fcvar,fc_sym = impose_perm_sym(fc,r23,sclat,pbc,verbose,[nat,n_blocks])\n\nWrapper for ``impose_perm_sym``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"r23 : input rank-2 array('i') with bounds (6,n_blocks)\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"verbose : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(fc, 3)\n" -"\nReturns\n-------\n" -"fcvar : float\n" -"fc_sym : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_asr_impose_perm_sym(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - int *r23 = NULL; - npy_intp r23_Dims[2] = {-1, -1}; - const int r23_Rank = 2; - PyArrayObject *capi_r23_as_array = NULL; - int capi_r23_intent = 0; - PyObject *r23_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - double fcvar = 0; - double *fc_sym = NULL; - npy_intp fc_sym_Dims[4] = {-1, -1, -1, -1}; - const int fc_sym_Rank = 4; - PyArrayObject *capi_fc_sym_as_array = NULL; - int capi_fc_sym_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"fc","r23","sclat","pbc","verbose","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:thirdorder.third_order_asr.impose_perm_sym",\ - capi_kwlist,&fc_capi,&r23_capi,&sclat_capi,&pbc_capi,&verbose_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the 3rd argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable verbose */ - verbose = (int)PyObject_IsTrue(verbose_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable fcvar */ - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_asr.impose_perm_sym() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","1st keyword nat","impose_perm_sym:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.impose_perm_sym() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","2nd keyword n_blocks","impose_perm_sym:n_blocks=%d",n_blocks) { - /* Processing variable r23 */ - r23_Dims[0]=6,r23_Dims[1]=n_blocks; - capi_r23_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the 2nd argument `r23`"; - capi_r23_as_array = ndarray_from_pyobj( NPY_INT,1,r23_Dims,r23_Rank, capi_r23_intent,r23_capi,capi_errmess); - if (capi_r23_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r23 = (int *)(PyArray_DATA(capi_r23_as_array)); - - /* Processing variable fc_sym */ - fc_sym_Dims[0]=3 * nat,fc_sym_Dims[1]=3 * nat,fc_sym_Dims[2]=3 * nat,fc_sym_Dims[3]=n_blocks; - capi_fc_sym_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_perm_sym: failed to create array from the hidden `fc_sym`"; - capi_fc_sym_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_sym_Dims,fc_sym_Rank, capi_fc_sym_intent,Py_None,capi_errmess); - if (capi_fc_sym_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_sym = (double *)(PyArray_DATA(capi_fc_sym_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r23,sclat,&pbc,&verbose,&fcvar,fc_sym,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("dN",fcvar,capi_fc_sym_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_sym_as_array == NULL) ... else of fc_sym */ - /* End of cleaning variable fc_sym */ - if((PyObject *)capi_r23_as_array!=r23_capi) { - Py_XDECREF(capi_r23_as_array); } - } /* if (capi_r23_as_array == NULL) ... else of r23 */ - /* End of cleaning variable r23 */ - } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - /* End of cleaning variable fcvar */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of impose_perm_sym ***************************/ - -/******************************* impose_asr_3rd *******************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_impose_asr_3rd[] = "\ -fcvar,sum3rd,fc_asr = impose_asr_3rd(fc,xr2,xr2list,pow,sclat,pbc,verbose,[totnum_r2,nat,n_blocks])\n\nWrapper for ``impose_asr_3rd``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"xr2 : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2list : input rank-2 array('i') with bounds (3,totnum_r2)\n" -"pow : input float\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"verbose : input int\n" -"\nOther Parameters\n----------------\n" -"totnum_r2 : input int, optional\n Default: shape(xr2list, 1)\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(fc, 3)\n" -"\nReturns\n-------\n" -"fcvar : float\n" -"sum3rd : float\n" -"fc_asr : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_asr_impose_asr_3rd(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,double*,int*,int*,int*,double*,double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[2] = {-1, -1}; - const int xr2_Rank = 2; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr2list = NULL; - npy_intp xr2list_Dims[2] = {-1, -1}; - const int xr2list_Rank = 2; - PyArrayObject *capi_xr2list_as_array = NULL; - int capi_xr2list_intent = 0; - PyObject *xr2list_capi = Py_None; - double pow = 0; - PyObject *pow_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - double fcvar = 0; - double sum3rd = 0; - double *fc_asr = NULL; - npy_intp fc_asr_Dims[4] = {-1, -1, -1, -1}; - const int fc_asr_Rank = 4; - PyArrayObject *capi_fc_asr_as_array = NULL; - int capi_fc_asr_intent = 0; - int totnum_r2 = 0; - PyObject *totnum_r2_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"fc","xr2","xr2list","pow","sclat","pbc","verbose","totnum_r2","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OOO:thirdorder.third_order_asr.impose_asr_3rd",\ - capi_kwlist,&fc_capi,&xr2_capi,&xr2list_capi,&pow_capi,&sclat_capi,&pbc_capi,&verbose_capi,&totnum_r2_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable pow */ - f2py_success = double_from_pyobj(&pow,pow_capi,"thirdorder.third_order_asr.impose_asr_3rd() 4th argument (pow) can't be converted to double"); - if (f2py_success) { - /* Processing variable xr2list */ - xr2list_Dims[0]=3; - capi_xr2list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 3rd argument `xr2list`"; - capi_xr2list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2list_Dims,xr2list_Rank, capi_xr2list_intent,xr2list_capi,capi_errmess); - if (capi_xr2list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2list = (int *)(PyArray_DATA(capi_xr2list_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 5th argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable verbose */ - verbose = (int)PyObject_IsTrue(verbose_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable fcvar */ - /* Processing variable sum3rd */ - /* Processing variable totnum_r2 */ - if (totnum_r2_capi == Py_None) totnum_r2 = shape(xr2list, 1); else - f2py_success = int_from_pyobj(&totnum_r2,totnum_r2_capi,"thirdorder.third_order_asr.impose_asr_3rd() 1st keyword (totnum_r2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2list, 1) == totnum_r2,"shape(xr2list, 1) == totnum_r2","1st keyword totnum_r2","impose_asr_3rd:totnum_r2=%d",totnum_r2) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_asr.impose_asr_3rd() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","2nd keyword nat","impose_asr_3rd:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.impose_asr_3rd() 3rd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","3rd keyword n_blocks","impose_asr_3rd:n_blocks=%d",n_blocks) { - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=n_blocks; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the 2nd argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - /* Processing variable fc_asr */ - fc_asr_Dims[0]=3 * nat,fc_asr_Dims[1]=3 * nat,fc_asr_Dims[2]=3 * nat,fc_asr_Dims[3]=n_blocks; - capi_fc_asr_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr_3rd: failed to create array from the hidden `fc_asr`"; - capi_fc_asr_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_asr_Dims,fc_asr_Rank, capi_fc_asr_intent,Py_None,capi_errmess); - if (capi_fc_asr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_asr = (double *)(PyArray_DATA(capi_fc_asr_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,xr2,xr2list,&pow,sclat,&pbc,&verbose,&fcvar,&sum3rd,fc_asr,&totnum_r2,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("ddN",fcvar,sum3rd,capi_fc_asr_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_asr_as_array == NULL) ... else of fc_asr */ - /* End of cleaning variable fc_asr */ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(xr2list, 1) == totnum_r2)*/ - } /*if (f2py_success) of totnum_r2*/ - /* End of cleaning variable totnum_r2 */ - /* End of cleaning variable sum3rd */ - /* End of cleaning variable fcvar */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_xr2list_as_array!=xr2list_capi) { - Py_XDECREF(capi_xr2list_as_array); } - } /* if (capi_xr2list_as_array == NULL) ... else of xr2list */ - /* End of cleaning variable xr2list */ - } /*if (f2py_success) of pow*/ - /* End of cleaning variable pow */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of impose_asr_3rd ***************************/ - -/********************************* impose_asr *********************************/ -static char doc_f2py_rout_thirdorder_third_order_asr_impose_asr[] = "\ -fc_out = impose_asr(fc,r23,xr2,xr2list,pow,sclat,pbc,threshold,maxite,verbose,[totnum_r2,nat,n_blocks])\n\nWrapper for ``impose_asr``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"r23 : input rank-2 array('i') with bounds (6,n_blocks)\n" -"xr2 : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2list : input rank-2 array('i') with bounds (3,totnum_r2)\n" -"pow : input float\n" -"sclat : input rank-1 array('i') with bounds (3)\n" -"pbc : input int\n" -"threshold : input float\n" -"maxite : input int\n" -"verbose : input int\n" -"\nOther Parameters\n----------------\n" -"totnum_r2 : input int, optional\n Default: shape(xr2list, 1)\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(fc, 3)\n" -"\nReturns\n-------\n" -"fc_out : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_asr_impose_asr(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,double*,int*,int*,double*,int*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - int *r23 = NULL; - npy_intp r23_Dims[2] = {-1, -1}; - const int r23_Rank = 2; - PyArrayObject *capi_r23_as_array = NULL; - int capi_r23_intent = 0; - PyObject *r23_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[2] = {-1, -1}; - const int xr2_Rank = 2; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr2list = NULL; - npy_intp xr2list_Dims[2] = {-1, -1}; - const int xr2list_Rank = 2; - PyArrayObject *capi_xr2list_as_array = NULL; - int capi_xr2list_intent = 0; - PyObject *xr2list_capi = Py_None; - double pow = 0; - PyObject *pow_capi = Py_None; - int *sclat = NULL; - npy_intp sclat_Dims[1] = {-1}; - const int sclat_Rank = 1; - PyArrayObject *capi_sclat_as_array = NULL; - int capi_sclat_intent = 0; - PyObject *sclat_capi = Py_None; - int pbc = 0; - PyObject *pbc_capi = Py_None; - double threshold = 0; - PyObject *threshold_capi = Py_None; - int maxite = 0; - PyObject *maxite_capi = Py_None; - double *fc_out = NULL; - npy_intp fc_out_Dims[4] = {-1, -1, -1, -1}; - const int fc_out_Rank = 4; - PyArrayObject *capi_fc_out_as_array = NULL; - int capi_fc_out_intent = 0; - int verbose = 0; - PyObject *verbose_capi = Py_None; - int totnum_r2 = 0; - PyObject *totnum_r2_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"fc","r23","xr2","xr2list","pow","sclat","pbc","threshold","maxite","verbose","totnum_r2","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOOO|OOO:thirdorder.third_order_asr.impose_asr",\ - capi_kwlist,&fc_capi,&r23_capi,&xr2_capi,&xr2list_capi,&pow_capi,&sclat_capi,&pbc_capi,&threshold_capi,&maxite_capi,&verbose_capi,&totnum_r2_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable pow */ - f2py_success = double_from_pyobj(&pow,pow_capi,"thirdorder.third_order_asr.impose_asr() 5th argument (pow) can't be converted to double"); - if (f2py_success) { - /* Processing variable threshold */ - f2py_success = double_from_pyobj(&threshold,threshold_capi,"thirdorder.third_order_asr.impose_asr() 8th argument (threshold) can't be converted to double"); - if (f2py_success) { - /* Processing variable maxite */ - f2py_success = int_from_pyobj(&maxite,maxite_capi,"thirdorder.third_order_asr.impose_asr() 9th argument (maxite) can't be converted to int"); - if (f2py_success) { - /* Processing variable xr2list */ - xr2list_Dims[0]=3; - capi_xr2list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 4th argument `xr2list`"; - capi_xr2list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2list_Dims,xr2list_Rank, capi_xr2list_intent,xr2list_capi,capi_errmess); - if (capi_xr2list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2list = (int *)(PyArray_DATA(capi_xr2list_as_array)); - - /* Processing variable sclat */ - sclat_Dims[0]=3; - capi_sclat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 6th argument `sclat`"; - capi_sclat_as_array = ndarray_from_pyobj( NPY_INT,1,sclat_Dims,sclat_Rank, capi_sclat_intent,sclat_capi,capi_errmess); - if (capi_sclat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sclat = (int *)(PyArray_DATA(capi_sclat_as_array)); - - /* Processing variable pbc */ - pbc = (int)PyObject_IsTrue(pbc_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable verbose */ - verbose = (int)PyObject_IsTrue(verbose_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable totnum_r2 */ - if (totnum_r2_capi == Py_None) totnum_r2 = shape(xr2list, 1); else - f2py_success = int_from_pyobj(&totnum_r2,totnum_r2_capi,"thirdorder.third_order_asr.impose_asr() 1st keyword (totnum_r2) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2list, 1) == totnum_r2,"shape(xr2list, 1) == totnum_r2","1st keyword totnum_r2","impose_asr:totnum_r2=%d",totnum_r2) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_asr.impose_asr() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","2nd keyword nat","impose_asr:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_asr.impose_asr() 3rd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","3rd keyword n_blocks","impose_asr:n_blocks=%d",n_blocks) { - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=n_blocks; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 3rd argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - /* Processing variable fc_out */ - fc_out_Dims[0]=3 * nat,fc_out_Dims[1]=3 * nat,fc_out_Dims[2]=3 * nat,fc_out_Dims[3]=n_blocks; - capi_fc_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the hidden `fc_out`"; - capi_fc_out_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_out_Dims,fc_out_Rank, capi_fc_out_intent,Py_None,capi_errmess); - if (capi_fc_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_out = (double *)(PyArray_DATA(capi_fc_out_as_array)); - - /* Processing variable r23 */ - r23_Dims[0]=6,r23_Dims[1]=n_blocks; - capi_r23_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_asr.impose_asr: failed to create array from the 2nd argument `r23`"; - capi_r23_as_array = ndarray_from_pyobj( NPY_INT,1,r23_Dims,r23_Rank, capi_r23_intent,r23_capi,capi_errmess); - if (capi_r23_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r23 = (int *)(PyArray_DATA(capi_r23_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r23,xr2,xr2list,&pow,sclat,&pbc,&threshold,&maxite,fc_out,&verbose,&totnum_r2,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_out_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r23_as_array!=r23_capi) { - Py_XDECREF(capi_r23_as_array); } - } /* if (capi_r23_as_array == NULL) ... else of r23 */ - /* End of cleaning variable r23 */ - } /* if (capi_fc_out_as_array == NULL) ... else of fc_out */ - /* End of cleaning variable fc_out */ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(xr2list, 1) == totnum_r2)*/ - } /*if (f2py_success) of totnum_r2*/ - /* End of cleaning variable totnum_r2 */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of pbc*/ - /* End of cleaning variable pbc */ - if((PyObject *)capi_sclat_as_array!=sclat_capi) { - Py_XDECREF(capi_sclat_as_array); } - } /* if (capi_sclat_as_array == NULL) ... else of sclat */ - /* End of cleaning variable sclat */ - if((PyObject *)capi_xr2list_as_array!=xr2list_capi) { - Py_XDECREF(capi_xr2list_as_array); } - } /* if (capi_xr2list_as_array == NULL) ... else of xr2list */ - /* End of cleaning variable xr2list */ - } /*if (f2py_success) of maxite*/ - /* End of cleaning variable maxite */ - } /*if (f2py_success) of threshold*/ - /* End of cleaning variable threshold */ - } /*if (f2py_success) of pow*/ - /* End of cleaning variable pow */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of impose_asr *****************************/ - -/********************************** analysis **********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_analysis[] = "\ -weight,xr2,xr3 = analysis(far,tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,[nat,n_blocks])\n\nWrapper for ``analysis``.\ -\n\nParameters\n----------\n" -"far : input int\n" -"tol : input float\n" -"dmax : input rank-1 array('d') with bounds (nat)\n" -"sc_size : input rank-1 array('i') with bounds (3)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"tau : input rank-2 array('d') with bounds (nat,3)\n" -"tensor : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(dmax, 0)\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"\nReturns\n-------\n" -"weight : rank-4 array('i') with bounds (nat,nat,nat,n_blocks)\n" -"xr2 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)\n" -"xr3 : rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_centering_analysis(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,int*,int*,int*,double*,double*,double*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int far = 0; - PyObject *far_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - double *dmax = NULL; - npy_intp dmax_Dims[1] = {-1}; - const int dmax_Rank = 1; - PyArrayObject *capi_dmax_as_array = NULL; - int capi_dmax_intent = 0; - PyObject *dmax_capi = Py_None; - int *sc_size = NULL; - npy_intp sc_size_Dims[1] = {-1}; - const int sc_size_Rank = 1; - PyArrayObject *capi_sc_size_as_array = NULL; - int capi_sc_size_intent = 0; - PyObject *sc_size_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr3_list = NULL; - npy_intp xr3_list_Dims[2] = {-1, -1}; - const int xr3_list_Rank = 2; - PyArrayObject *capi_xr3_list_as_array = NULL; - int capi_xr3_list_intent = 0; - PyObject *xr3_list_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[4] = {-1, -1, -1, -1}; - const int weight_Rank = 4; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - int *xr2 = NULL; - npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr2_Rank = 6; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - int *xr3 = NULL; - npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr3_Rank = 6; - PyArrayObject *capi_xr3_as_array = NULL; - int capi_xr3_intent = 0; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"far","tol","dmax","sc_size","xr2_list","xr3_list","alat","tau","tensor","nat","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOOO|OO:thirdorder.third_order_centering.analysis",\ - capi_kwlist,&far_capi,&tol_capi,&dmax_capi,&sc_size_capi,&xr2_list_capi,&xr3_list_capi,&alat_capi,&tau_capi,&tensor_capi,&nat_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.analysis() 1st argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable dmax */ - ; - capi_dmax_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 3rd argument `dmax`"; - capi_dmax_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dmax_Dims,dmax_Rank, capi_dmax_intent,dmax_capi,capi_errmess); - if (capi_dmax_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dmax = (double *)(PyArray_DATA(capi_dmax_as_array)); - - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 7th argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 5th argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"thirdorder.third_order_centering.analysis() 2nd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable sc_size */ - sc_size_Dims[0]=3; - capi_sc_size_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 4th argument `sc_size`"; - capi_sc_size_as_array = ndarray_from_pyobj( NPY_INT,1,sc_size_Dims,sc_size_Rank, capi_sc_size_intent,sc_size_capi,capi_errmess); - if (capi_sc_size_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sc_size = (int *)(PyArray_DATA(capi_sc_size_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(dmax, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.analysis() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(dmax, 0) == nat,"shape(dmax, 0) == nat","1st keyword nat","analysis:nat=%d",nat) { - /* Processing variable tau */ - tau_Dims[0]=nat,tau_Dims[1]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 8th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_centering.analysis() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","analysis:n_blocks=%d",n_blocks) { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks; - capi_weight_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the hidden `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,Py_None,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks; - capi_xr2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the hidden `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,Py_None,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - /* Processing variable xr3 */ - xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks; - capi_xr3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the hidden `xr3`"; - capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,Py_None,capi_errmess); - if (capi_xr3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); - - /* Processing variable xr3_list */ - xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; - capi_xr3_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 6th argument `xr3_list`"; - capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); - if (capi_xr3_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); - - /* Processing variable tensor */ - tensor_Dims[0]=3 * nat,tensor_Dims[1]=3 * nat,tensor_Dims[2]=3 * nat,tensor_Dims[3]=n_blocks; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.analysis: failed to create array from the 9th argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&far,&tol,dmax,sc_size,xr2_list,xr3_list,alat,tau,tensor,weight,xr2,xr3,&nat,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNN",capi_weight_as_array,capi_xr2_as_array,capi_xr3_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ - if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { - Py_XDECREF(capi_xr3_list_as_array); } - } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ - /* End of cleaning variable xr3_list */ - } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ - /* End of cleaning variable xr3 */ - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - } /*CHECKSCALAR(shape(dmax, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_sc_size_as_array!=sc_size_capi) { - Py_XDECREF(capi_sc_size_as_array); } - } /* if (capi_sc_size_as_array == NULL) ... else of sc_size */ - /* End of cleaning variable sc_size */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - if((PyObject *)capi_dmax_as_array!=dmax_capi) { - Py_XDECREF(capi_dmax_as_array); } - } /* if (capi_dmax_as_array == NULL) ... else of dmax */ - /* End of cleaning variable dmax */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of analysis ******************************/ - -/*********************************** center ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_center[] = "\ -centered = center(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_blocks,n_blocks_old])\n\nWrapper for ``center``.\ -\n\nParameters\n----------\n" -"original : input rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks_old)\n" -"weight : input rank-4 array('i') with bounds (nat,nat,nat,n_blocks_old)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" -"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr3 : input rank-6 array('i') with bounds (3,1 + 6 * far + 12 * far * far + 8 * far * far * far,nat,nat,nat,n_blocks_old)\n" -"far : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(original, 0) / 3\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"n_blocks_old : input int, optional\n Default: shape(original, 3)\n" -"\nReturns\n-------\n" -"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_centering_center(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,int*,int*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *original = NULL; - npy_intp original_Dims[4] = {-1, -1, -1, -1}; - const int original_Rank = 4; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[4] = {-1, -1, -1, -1}; - const int weight_Rank = 4; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - PyObject *weight_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr2_Rank = 6; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr3_list = NULL; - npy_intp xr3_list_Dims[2] = {-1, -1}; - const int xr3_list_Rank = 2; - PyArrayObject *capi_xr3_list_as_array = NULL; - int capi_xr3_list_intent = 0; - PyObject *xr3_list_capi = Py_None; - int *xr3 = NULL; - npy_intp xr3_Dims[6] = {-1, -1, -1, -1, -1, -1}; - const int xr3_Rank = 6; - PyArrayObject *capi_xr3_as_array = NULL; - int capi_xr3_intent = 0; - PyObject *xr3_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[4] = {-1, -1, -1, -1}; - const int centered_Rank = 4; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int far = 0; - PyObject *far_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int n_blocks_old = 0; - PyObject *n_blocks_old_capi = Py_None; - static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_blocks","n_blocks_old",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OOO:thirdorder.third_order_centering.center",\ - capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_blocks_capi,&n_blocks_old_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.center() 7th argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 3rd argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable original */ - ; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 1st argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(original, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.center() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_centering.center() 2nd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","2nd keyword n_blocks","center:n_blocks=%d",n_blocks) { - /* Processing variable xr3_list */ - xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; - capi_xr3_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 5th argument `xr3_list`"; - capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); - if (capi_xr3_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); - - /* Processing variable n_blocks_old */ - if (n_blocks_old_capi == Py_None) n_blocks_old = shape(original, 3); else - f2py_success = int_from_pyobj(&n_blocks_old,n_blocks_old_capi,"thirdorder.third_order_centering.center() 3rd keyword (n_blocks_old) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 3) == n_blocks_old,"shape(original, 3) == n_blocks_old","3rd keyword n_blocks_old","center:n_blocks_old=%d",n_blocks_old) { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=nat,xr2_Dims[5]=n_blocks_old; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 4th argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","4th argument xr2") { - /* Processing variable xr3 */ - xr3_Dims[0]=3,xr3_Dims[1]=1 + 6 * far + 12 * far * far + 8 * far * far * far,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=nat,xr3_Dims[5]=n_blocks_old; - capi_xr3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 6th argument `xr3`"; - capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); - if (capi_xr3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); - - CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far,"shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far","6th argument xr3") { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=nat,weight_Dims[3]=n_blocks_old; - capi_weight_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center: failed to create array from the 2nd argument `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,&nat,centered,&far,&n_blocks,&n_blocks_old); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_centered_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_weight_as_array!=weight_capi) { - Py_XDECREF(capi_weight_as_array); } - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKARRAY(shape(xr3, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ - if((PyObject *)capi_xr3_as_array!=xr3_capi) { - Py_XDECREF(capi_xr3_as_array); } - } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ - /* End of cleaning variable xr3 */ - } /*CHECKARRAY(shape(xr2, 1) == 1 + 6 * far + 12 * far * far + 8 * far * far * far)*/ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKSCALAR(shape(original, 3) == n_blocks_old)*/ - } /*if (f2py_success) of n_blocks_old*/ - /* End of cleaning variable n_blocks_old */ - if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { - Py_XDECREF(capi_xr3_list_as_array); } - } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ - /* End of cleaning variable xr3_list */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of center *******************************/ - -/******************************* center_sparse *******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_center_sparse[] = "\ -centered,n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list = center_sparse(original,weight,xr2_list,xr2,xr3_list,xr3,far,[nat,n_sup,n_blocks])\n\nWrapper for ``center_sparse``.\ -\n\nParameters\n----------\n" -"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup,n_sup)\n" -"weight : input rank-5 array('i') with bounds (nat,nat,n_sup,nat,n_sup)\n" -"xr2_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr2 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" -"xr3_list : input rank-2 array('i') with bounds (3,n_blocks)\n" -"xr3 : input rank-7 array('i') with bounds (3,n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,nat,nat,n_sup,nat,n_sup)\n" -"far : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(original, 0) / 3\n" -"n_sup : input int, optional\n Default: shape(original, 3)\n" -"n_blocks : input int, optional\n Default: shape(xr2_list, 1)\n" -"\nReturns\n-------\n" -"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"n_sparse_blocks : int\n" -"xr2_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" -"xr3_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" -"atom_sparse_list : rank-2 array('i') with bounds (3,n_blocks * nat * nat * nat)\n" -"r_blocks_sparse_list : rank-1 array('i') with bounds (n_blocks * nat * nat * nat)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_centering_center_sparse(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,int*,int*,int*,double*,int*,int*,int*,int*,int*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *original = NULL; - npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; - const int original_Rank = 5; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - int *weight = NULL; - npy_intp weight_Dims[5] = {-1, -1, -1, -1, -1}; - const int weight_Rank = 5; - PyArrayObject *capi_weight_as_array = NULL; - int capi_weight_intent = 0; - PyObject *weight_capi = Py_None; - int *xr2_list = NULL; - npy_intp xr2_list_Dims[2] = {-1, -1}; - const int xr2_list_Rank = 2; - PyArrayObject *capi_xr2_list_as_array = NULL; - int capi_xr2_list_intent = 0; - PyObject *xr2_list_capi = Py_None; - int *xr2 = NULL; - npy_intp xr2_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int xr2_Rank = 7; - PyArrayObject *capi_xr2_as_array = NULL; - int capi_xr2_intent = 0; - PyObject *xr2_capi = Py_None; - int *xr3_list = NULL; - npy_intp xr3_list_Dims[2] = {-1, -1}; - const int xr3_list_Rank = 2; - PyArrayObject *capi_xr3_list_as_array = NULL; - int capi_xr3_list_intent = 0; - PyObject *xr3_list_capi = Py_None; - int *xr3 = NULL; - npy_intp xr3_Dims[7] = {-1, -1, -1, -1, -1, -1, -1}; - const int xr3_Rank = 7; - PyArrayObject *capi_xr3_as_array = NULL; - int capi_xr3_intent = 0; - PyObject *xr3_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[4] = {-1, -1, -1, -1}; - const int centered_Rank = 4; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int n_sparse_blocks = 0; - int *xr2_sparse_list = NULL; - npy_intp xr2_sparse_list_Dims[2] = {-1, -1}; - const int xr2_sparse_list_Rank = 2; - PyArrayObject *capi_xr2_sparse_list_as_array = NULL; - int capi_xr2_sparse_list_intent = 0; - int *xr3_sparse_list = NULL; - npy_intp xr3_sparse_list_Dims[2] = {-1, -1}; - const int xr3_sparse_list_Rank = 2; - PyArrayObject *capi_xr3_sparse_list_as_array = NULL; - int capi_xr3_sparse_list_intent = 0; - int *atom_sparse_list = NULL; - npy_intp atom_sparse_list_Dims[2] = {-1, -1}; - const int atom_sparse_list_Rank = 2; - PyArrayObject *capi_atom_sparse_list_as_array = NULL; - int capi_atom_sparse_list_intent = 0; - int *r_blocks_sparse_list = NULL; - npy_intp r_blocks_sparse_list_Dims[1] = {-1}; - const int r_blocks_sparse_list_Rank = 1; - PyArrayObject *capi_r_blocks_sparse_list_as_array = NULL; - int capi_r_blocks_sparse_list_intent = 0; - int far = 0; - PyObject *far_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_sup = 0; - PyObject *n_sup_capi = Py_None; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - static char *capi_kwlist[] = {"original","weight","xr2_list","xr2","xr3_list","xr3","far","nat","n_sup","n_blocks",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OOO:thirdorder.third_order_centering.center_sparse",\ - capi_kwlist,&original_capi,&weight_capi,&xr2_list_capi,&xr2_capi,&xr3_list_capi,&xr3_capi,&far_capi,&nat_capi,&n_sup_capi,&n_blocks_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.center_sparse() 7th argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable xr2_list */ - xr2_list_Dims[0]=3; - capi_xr2_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 3rd argument `xr2_list`"; - capi_xr2_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_list_Dims,xr2_list_Rank, capi_xr2_list_intent,xr2_list_capi,capi_errmess); - if (capi_xr2_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_list = (int *)(PyArray_DATA(capi_xr2_list_as_array)); - - /* Processing variable original */ - ; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 1st argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - /* Processing variable n_sparse_blocks */ - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(original, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.center_sparse() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 0) == 3 * nat,"shape(original, 0) == 3 * nat","1st keyword nat","center_sparse:nat=%d",nat) { - /* Processing variable n_sup */ - if (n_sup_capi == Py_None) n_sup = shape(original, 3); else - f2py_success = int_from_pyobj(&n_sup,n_sup_capi,"thirdorder.third_order_centering.center_sparse() 2nd keyword (n_sup) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(original, 3) == n_sup,"shape(original, 3) == n_sup","2nd keyword n_sup","center_sparse:n_sup=%d",n_sup) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(xr2_list, 1); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_centering.center_sparse() 3rd keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(xr2_list, 1) == n_blocks,"shape(xr2_list, 1) == n_blocks","3rd keyword n_blocks","center_sparse:n_blocks=%d",n_blocks) { - /* Processing variable xr3_list */ - xr3_list_Dims[0]=3,xr3_list_Dims[1]=n_blocks; - capi_xr3_list_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 5th argument `xr3_list`"; - capi_xr3_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_list_Dims,xr3_list_Rank, capi_xr3_list_intent,xr3_list_capi,capi_errmess); - if (capi_xr3_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_list = (int *)(PyArray_DATA(capi_xr3_list_as_array)); - - /* Processing variable xr2 */ - xr2_Dims[0]=3,xr2_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr2_Dims[2]=nat,xr2_Dims[3]=nat,xr2_Dims[4]=n_sup,xr2_Dims[5]=nat,xr2_Dims[6]=n_sup; - capi_xr2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 4th argument `xr2`"; - capi_xr2_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_Dims,xr2_Rank, capi_xr2_intent,xr2_capi,capi_errmess); - if (capi_xr2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2 = (int *)(PyArray_DATA(capi_xr2_as_array)); - - CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","4th argument xr2") { - /* Processing variable xr3 */ - xr3_Dims[0]=3,xr3_Dims[1]=n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,xr3_Dims[2]=nat,xr3_Dims[3]=nat,xr3_Dims[4]=n_sup,xr3_Dims[5]=nat,xr3_Dims[6]=n_sup; - capi_xr3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 6th argument `xr3`"; - capi_xr3_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_Dims,xr3_Rank, capi_xr3_intent,xr3_capi,capi_errmess); - if (capi_xr3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3 = (int *)(PyArray_DATA(capi_xr3_as_array)); - - CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup,"shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup","6th argument xr3") { - /* Processing variable weight */ - weight_Dims[0]=nat,weight_Dims[1]=nat,weight_Dims[2]=n_sup,weight_Dims[3]=nat,weight_Dims[4]=n_sup; - capi_weight_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the 2nd argument `weight`"; - capi_weight_as_array = ndarray_from_pyobj( NPY_INT,1,weight_Dims,weight_Rank, capi_weight_intent,weight_capi,capi_errmess); - if (capi_weight_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - weight = (int *)(PyArray_DATA(capi_weight_as_array)); - - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_blocks; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable xr2_sparse_list */ - xr2_sparse_list_Dims[0]=3,xr2_sparse_list_Dims[1]=n_blocks * nat * nat * nat; - capi_xr2_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `xr2_sparse_list`"; - capi_xr2_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr2_sparse_list_Dims,xr2_sparse_list_Rank, capi_xr2_sparse_list_intent,Py_None,capi_errmess); - if (capi_xr2_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr2_sparse_list = (int *)(PyArray_DATA(capi_xr2_sparse_list_as_array)); - - /* Processing variable xr3_sparse_list */ - xr3_sparse_list_Dims[0]=3,xr3_sparse_list_Dims[1]=n_blocks * nat * nat * nat; - capi_xr3_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `xr3_sparse_list`"; - capi_xr3_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,xr3_sparse_list_Dims,xr3_sparse_list_Rank, capi_xr3_sparse_list_intent,Py_None,capi_errmess); - if (capi_xr3_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xr3_sparse_list = (int *)(PyArray_DATA(capi_xr3_sparse_list_as_array)); - - /* Processing variable atom_sparse_list */ - atom_sparse_list_Dims[0]=3,atom_sparse_list_Dims[1]=n_blocks * nat * nat * nat; - capi_atom_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `atom_sparse_list`"; - capi_atom_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,atom_sparse_list_Dims,atom_sparse_list_Rank, capi_atom_sparse_list_intent,Py_None,capi_errmess); - if (capi_atom_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - atom_sparse_list = (int *)(PyArray_DATA(capi_atom_sparse_list_as_array)); - - /* Processing variable r_blocks_sparse_list */ - r_blocks_sparse_list_Dims[0]=n_blocks * nat * nat * nat; - capi_r_blocks_sparse_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.center_sparse: failed to create array from the hidden `r_blocks_sparse_list`"; - capi_r_blocks_sparse_list_as_array = ndarray_from_pyobj( NPY_INT,1,r_blocks_sparse_list_Dims,r_blocks_sparse_list_Rank, capi_r_blocks_sparse_list_intent,Py_None,capi_errmess); - if (capi_r_blocks_sparse_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_blocks_sparse_list = (int *)(PyArray_DATA(capi_r_blocks_sparse_list_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(original,weight,xr2_list,xr2,xr3_list,xr3,centered,&n_sparse_blocks,xr2_sparse_list,xr3_sparse_list,atom_sparse_list,r_blocks_sparse_list,&far,&nat,&n_sup,&n_blocks); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NiNNNN",capi_centered_as_array,n_sparse_blocks,capi_xr2_sparse_list_as_array,capi_xr3_sparse_list_as_array,capi_atom_sparse_list_as_array,capi_r_blocks_sparse_list_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_r_blocks_sparse_list_as_array == NULL) ... else of r_blocks_sparse_list */ - /* End of cleaning variable r_blocks_sparse_list */ - } /* if (capi_atom_sparse_list_as_array == NULL) ... else of atom_sparse_list */ - /* End of cleaning variable atom_sparse_list */ - } /* if (capi_xr3_sparse_list_as_array == NULL) ... else of xr3_sparse_list */ - /* End of cleaning variable xr3_sparse_list */ - } /* if (capi_xr2_sparse_list_as_array == NULL) ... else of xr2_sparse_list */ - /* End of cleaning variable xr2_sparse_list */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - if((PyObject *)capi_weight_as_array!=weight_capi) { - Py_XDECREF(capi_weight_as_array); } - } /* if (capi_weight_as_array == NULL) ... else of weight */ - /* End of cleaning variable weight */ - } /*CHECKARRAY(shape(xr3, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ - if((PyObject *)capi_xr3_as_array!=xr3_capi) { - Py_XDECREF(capi_xr3_as_array); } - } /* if (capi_xr3_as_array == NULL) ... else of xr3 */ - /* End of cleaning variable xr3 */ - } /*CHECKARRAY(shape(xr2, 1) == n_sup + 6 * far * n_sup + 12 * far * far * n_sup + 8 * far * far * far * n_sup)*/ - if((PyObject *)capi_xr2_as_array!=xr2_capi) { - Py_XDECREF(capi_xr2_as_array); } - } /* if (capi_xr2_as_array == NULL) ... else of xr2 */ - /* End of cleaning variable xr2 */ - if((PyObject *)capi_xr3_list_as_array!=xr3_list_capi) { - Py_XDECREF(capi_xr3_list_as_array); } - } /* if (capi_xr3_list_as_array == NULL) ... else of xr3_list */ - /* End of cleaning variable xr3_list */ - } /*CHECKSCALAR(shape(xr2_list, 1) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(original, 3) == n_sup)*/ - } /*if (f2py_success) of n_sup*/ - /* End of cleaning variable n_sup */ - } /*CHECKSCALAR(shape(original, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - /* End of cleaning variable n_sparse_blocks */ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - if((PyObject *)capi_xr2_list_as_array!=xr2_list_capi) { - Py_XDECREF(capi_xr2_list_as_array); } - } /* if (capi_xr2_list_as_array == NULL) ... else of xr2_list */ - /* End of cleaning variable xr2_list */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of center_sparse ****************************/ - -/********************************* pre_center *********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_pre_center[] = "\ -centered,lat_min,lat_max = pre_center(far,nq1,nq2,nq3,tol,alat,tau,original,[nat])\n\nWrapper for ``pre_center``.\ -\n\nParameters\n----------\n" -"far : input int\n" -"nq1 : input int\n" -"nq2 : input int\n" -"nq3 : input int\n" -"tol : input float\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"tau : input rank-2 array('d') with bounds (nat,3)\n" -"original : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,nq1 * nq2 * nq3,nq1 * nq2 * nq3)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(tau, 0)\n" -"\nReturns\n-------\n" -"centered : rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3)\n" -"lat_min : rank-1 array('i') with bounds (3)\n" -"lat_max : rank-1 array('i') with bounds (3)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_centering_pre_center(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*,int*,double*,double*,double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int far = 0; - PyObject *far_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int nq1 = 0; - PyObject *nq1_capi = Py_None; - int nq2 = 0; - PyObject *nq2_capi = Py_None; - int nq3 = 0; - PyObject *nq3_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - double *tau = NULL; - npy_intp tau_Dims[2] = {-1, -1}; - const int tau_Rank = 2; - PyArrayObject *capi_tau_as_array = NULL; - int capi_tau_intent = 0; - PyObject *tau_capi = Py_None; - double *original = NULL; - npy_intp original_Dims[5] = {-1, -1, -1, -1, -1}; - const int original_Rank = 5; - PyArrayObject *capi_original_as_array = NULL; - int capi_original_intent = 0; - PyObject *original_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[5] = {-1, -1, -1, -1, -1}; - const int centered_Rank = 5; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int *lat_min = NULL; - npy_intp lat_min_Dims[1] = {-1}; - const int lat_min_Rank = 1; - PyArrayObject *capi_lat_min_as_array = NULL; - int capi_lat_min_intent = 0; - int *lat_max = NULL; - npy_intp lat_max_Dims[1] = {-1}; - const int lat_max_Rank = 1; - PyArrayObject *capi_lat_max_as_array = NULL; - int capi_lat_max_intent = 0; - static char *capi_kwlist[] = {"far","nq1","nq2","nq3","tol","alat","tau","original","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|O:thirdorder.third_order_centering.pre_center",\ - capi_kwlist,&far_capi,&nq1_capi,&nq2_capi,&nq3_capi,&tol_capi,&alat_capi,&tau_capi,&original_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable nq1 */ - f2py_success = int_from_pyobj(&nq1,nq1_capi,"thirdorder.third_order_centering.pre_center() 2nd argument (nq1) can't be converted to int"); - if (f2py_success) { - /* Processing variable nq2 */ - f2py_success = int_from_pyobj(&nq2,nq2_capi,"thirdorder.third_order_centering.pre_center() 3rd argument (nq2) can't be converted to int"); - if (f2py_success) { - /* Processing variable nq3 */ - f2py_success = int_from_pyobj(&nq3,nq3_capi,"thirdorder.third_order_centering.pre_center() 4th argument (nq3) can't be converted to int"); - if (f2py_success) { - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the 6th argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable tau */ - tau_Dims[1]=3; - capi_tau_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the 7th argument `tau`"; - capi_tau_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tau_Dims,tau_Rank, capi_tau_intent,tau_capi,capi_errmess); - if (capi_tau_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tau = (double *)(PyArray_DATA(capi_tau_as_array)); - - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_centering.pre_center() 1st argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"thirdorder.third_order_centering.pre_center() 5th argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable lat_min */ - lat_min_Dims[0]=3; - capi_lat_min_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the hidden `lat_min`"; - capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,Py_None,capi_errmess); - if (capi_lat_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); - - /* Processing variable lat_max */ - lat_max_Dims[0]=3; - capi_lat_max_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the hidden `lat_max`"; - capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,Py_None,capi_errmess); - if (capi_lat_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(tau, 0); else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.pre_center() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tau, 0) == nat,"shape(tau, 0) == nat","1st keyword nat","pre_center:nat=%d",nat) { - /* Processing variable original */ - original_Dims[0]=3 * nat,original_Dims[1]=3 * nat,original_Dims[2]=3 * nat,original_Dims[3]=nq1 * nq2 * nq3,original_Dims[4]=nq1 * nq2 * nq3; - capi_original_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the 8th argument `original`"; - capi_original_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,original_Dims,original_Rank, capi_original_intent,original_capi,capi_errmess); - if (capi_original_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - original = (double *)(PyArray_DATA(capi_original_as_array)); - - CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { - CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { - CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3,"shape(original, 3) == nq1 * nq2 * nq3","8th argument original") { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3,centered_Dims[4]=6 * far * nq1 * nq2 * nq3 + 12 * far * far * nq1 * nq2 * nq3 + 8 * far * far * far * nq1 * nq2 * nq3 + nq1 * nq2 * nq3; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.pre_center: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&far,&nat,&nq1,&nq2,&nq3,&tol,alat,tau,original,centered,lat_min,lat_max); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNN",capi_centered_as_array,capi_lat_min_as_array,capi_lat_max_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ - } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ - } /*CHECKARRAY(shape(original, 3) == nq1 * nq2 * nq3)*/ - if((PyObject *)capi_original_as_array!=original_capi) { - Py_XDECREF(capi_original_as_array); } - } /* if (capi_original_as_array == NULL) ... else of original */ - /* End of cleaning variable original */ - } /*CHECKSCALAR(shape(tau, 0) == nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ - /* End of cleaning variable lat_max */ - } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ - /* End of cleaning variable lat_min */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ - if((PyObject *)capi_tau_as_array!=tau_capi) { - Py_XDECREF(capi_tau_as_array); } - } /* if (capi_tau_as_array == NULL) ... else of tau */ - /* End of cleaning variable tau */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - } /*if (f2py_success) of nq3*/ - /* End of cleaning variable nq3 */ - } /*if (f2py_success) of nq2*/ - /* End of cleaning variable nq2 */ - } /*if (f2py_success) of nq1*/ - /* End of cleaning variable nq1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of pre_center *****************************/ - -/*********************************** assign ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_assign[] = "\ -centered,x2,x3,r2,r3 = assign(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,n_sup_ws,[nat,n_sup_ws_prev])\n\nWrapper for ``assign``.\ -\n\nParameters\n----------\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"lat_min_prev : input rank-1 array('i') with bounds (3)\n" -"lat_max_prev : input rank-1 array('i') with bounds (3)\n" -"centered_prev : input rank-5 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws_prev,n_sup_ws_prev)\n" -"lat_min : input rank-1 array('i') with bounds (3)\n" -"lat_max : input rank-1 array('i') with bounds (3)\n" -"n_sup_ws : input int\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(centered_prev, 0) / 3\n" -"n_sup_ws_prev : input int, optional\n Default: shape(centered_prev, 3)\n" -"\nReturns\n-------\n" -"centered : rank-4 array('d') with bounds (3 * nat,3 * nat,3 * nat,n_sup_ws * n_sup_ws)\n" -"x2 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" -"x3 : rank-2 array('i') with bounds (3,n_sup_ws * n_sup_ws)\n" -"r2 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)\n" -"r3 : rank-2 array('d') with bounds (3,n_sup_ws * n_sup_ws)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_centering_assign(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,int*,double*,int*,int*,int*,int*,int*,double*,int*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - int *lat_min_prev = NULL; - npy_intp lat_min_prev_Dims[1] = {-1}; - const int lat_min_prev_Rank = 1; - PyArrayObject *capi_lat_min_prev_as_array = NULL; - int capi_lat_min_prev_intent = 0; - PyObject *lat_min_prev_capi = Py_None; - int *lat_max_prev = NULL; - npy_intp lat_max_prev_Dims[1] = {-1}; - const int lat_max_prev_Rank = 1; - PyArrayObject *capi_lat_max_prev_as_array = NULL; - int capi_lat_max_prev_intent = 0; - PyObject *lat_max_prev_capi = Py_None; - double *centered_prev = NULL; - npy_intp centered_prev_Dims[5] = {-1, -1, -1, -1, -1}; - const int centered_prev_Rank = 5; - PyArrayObject *capi_centered_prev_as_array = NULL; - int capi_centered_prev_intent = 0; - PyObject *centered_prev_capi = Py_None; - int *lat_min = NULL; - npy_intp lat_min_Dims[1] = {-1}; - const int lat_min_Rank = 1; - PyArrayObject *capi_lat_min_as_array = NULL; - int capi_lat_min_intent = 0; - PyObject *lat_min_capi = Py_None; - int *lat_max = NULL; - npy_intp lat_max_Dims[1] = {-1}; - const int lat_max_Rank = 1; - PyArrayObject *capi_lat_max_as_array = NULL; - int capi_lat_max_intent = 0; - PyObject *lat_max_capi = Py_None; - int n_sup_ws = 0; - PyObject *n_sup_ws_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int n_sup_ws_prev = 0; - PyObject *n_sup_ws_prev_capi = Py_None; - double *centered = NULL; - npy_intp centered_Dims[4] = {-1, -1, -1, -1}; - const int centered_Rank = 4; - PyArrayObject *capi_centered_as_array = NULL; - int capi_centered_intent = 0; - int *x2 = NULL; - npy_intp x2_Dims[2] = {-1, -1}; - const int x2_Rank = 2; - PyArrayObject *capi_x2_as_array = NULL; - int capi_x2_intent = 0; - int *x3 = NULL; - npy_intp x3_Dims[2] = {-1, -1}; - const int x3_Rank = 2; - PyArrayObject *capi_x3_as_array = NULL; - int capi_x3_intent = 0; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - static char *capi_kwlist[] = {"alat","lat_min_prev","lat_max_prev","centered_prev","lat_min","lat_max","n_sup_ws","nat","n_sup_ws_prev",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OO:thirdorder.third_order_centering.assign",\ - capi_kwlist,&alat_capi,&lat_min_prev_capi,&lat_max_prev_capi,¢ered_prev_capi,&lat_min_capi,&lat_max_capi,&n_sup_ws_capi,&nat_capi,&n_sup_ws_prev_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable n_sup_ws */ - f2py_success = int_from_pyobj(&n_sup_ws,n_sup_ws_capi,"thirdorder.third_order_centering.assign() 7th argument (n_sup_ws) can't be converted to int"); - if (f2py_success) { - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 1st argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable lat_min_prev */ - lat_min_prev_Dims[0]=3; - capi_lat_min_prev_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 2nd argument `lat_min_prev`"; - capi_lat_min_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_prev_Dims,lat_min_prev_Rank, capi_lat_min_prev_intent,lat_min_prev_capi,capi_errmess); - if (capi_lat_min_prev_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_min_prev = (int *)(PyArray_DATA(capi_lat_min_prev_as_array)); - - /* Processing variable lat_max_prev */ - lat_max_prev_Dims[0]=3; - capi_lat_max_prev_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 3rd argument `lat_max_prev`"; - capi_lat_max_prev_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_prev_Dims,lat_max_prev_Rank, capi_lat_max_prev_intent,lat_max_prev_capi,capi_errmess); - if (capi_lat_max_prev_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_max_prev = (int *)(PyArray_DATA(capi_lat_max_prev_as_array)); - - /* Processing variable lat_min */ - lat_min_Dims[0]=3; - capi_lat_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 5th argument `lat_min`"; - capi_lat_min_as_array = ndarray_from_pyobj( NPY_INT,1,lat_min_Dims,lat_min_Rank, capi_lat_min_intent,lat_min_capi,capi_errmess); - if (capi_lat_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_min = (int *)(PyArray_DATA(capi_lat_min_as_array)); - - /* Processing variable lat_max */ - lat_max_Dims[0]=3; - capi_lat_max_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 6th argument `lat_max`"; - capi_lat_max_as_array = ndarray_from_pyobj( NPY_INT,1,lat_max_Dims,lat_max_Rank, capi_lat_max_intent,lat_max_capi,capi_errmess); - if (capi_lat_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lat_max = (int *)(PyArray_DATA(capi_lat_max_as_array)); - - /* Processing variable centered_prev */ - ; - capi_centered_prev_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the 4th argument `centered_prev`"; - capi_centered_prev_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_prev_Dims,centered_prev_Rank, capi_centered_prev_intent,centered_prev_capi,capi_errmess); - if (capi_centered_prev_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered_prev = (double *)(PyArray_DATA(capi_centered_prev_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(centered_prev, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_centering.assign() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(centered_prev, 0) == 3 * nat,"shape(centered_prev, 0) == 3 * nat","1st keyword nat","assign:nat=%d",nat) { - /* Processing variable n_sup_ws_prev */ - if (n_sup_ws_prev_capi == Py_None) n_sup_ws_prev = shape(centered_prev, 3); else - f2py_success = int_from_pyobj(&n_sup_ws_prev,n_sup_ws_prev_capi,"thirdorder.third_order_centering.assign() 2nd keyword (n_sup_ws_prev) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev,"shape(centered_prev, 3) == n_sup_ws_prev","2nd keyword n_sup_ws_prev","assign:n_sup_ws_prev=%d",n_sup_ws_prev) { - /* Processing variable centered */ - centered_Dims[0]=3 * nat,centered_Dims[1]=3 * nat,centered_Dims[2]=3 * nat,centered_Dims[3]=n_sup_ws * n_sup_ws; - capi_centered_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `centered`"; - capi_centered_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,centered_Dims,centered_Rank, capi_centered_intent,Py_None,capi_errmess); - if (capi_centered_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - centered = (double *)(PyArray_DATA(capi_centered_as_array)); - - /* Processing variable x2 */ - x2_Dims[0]=3,x2_Dims[1]=n_sup_ws * n_sup_ws; - capi_x2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `x2`"; - capi_x2_as_array = ndarray_from_pyobj( NPY_INT,1,x2_Dims,x2_Rank, capi_x2_intent,Py_None,capi_errmess); - if (capi_x2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x2 = (int *)(PyArray_DATA(capi_x2_as_array)); - - /* Processing variable x3 */ - x3_Dims[0]=3,x3_Dims[1]=n_sup_ws * n_sup_ws; - capi_x3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `x3`"; - capi_x3_as_array = ndarray_from_pyobj( NPY_INT,1,x3_Dims,x3_Rank, capi_x3_intent,Py_None,capi_errmess); - if (capi_x3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x3 = (int *)(PyArray_DATA(capi_x3_as_array)); - - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_sup_ws * n_sup_ws; - capi_r2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,Py_None,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_sup_ws * n_sup_ws; - capi_r3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.assign: failed to create array from the hidden `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,Py_None,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(alat,lat_min_prev,lat_max_prev,centered_prev,lat_min,lat_max,&n_sup_ws,&nat,&n_sup_ws_prev,centered,x2,x3,r2,r3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNNNN",capi_centered_as_array,capi_x2_as_array,capi_x3_as_array,capi_r2_as_array,capi_r3_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /* if (capi_x3_as_array == NULL) ... else of x3 */ - /* End of cleaning variable x3 */ - } /* if (capi_x2_as_array == NULL) ... else of x2 */ - /* End of cleaning variable x2 */ - } /* if (capi_centered_as_array == NULL) ... else of centered */ - /* End of cleaning variable centered */ - } /*CHECKSCALAR(shape(centered_prev, 3) == n_sup_ws_prev)*/ - } /*if (f2py_success) of n_sup_ws_prev*/ - /* End of cleaning variable n_sup_ws_prev */ - } /*CHECKSCALAR(shape(centered_prev, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_centered_prev_as_array!=centered_prev_capi) { - Py_XDECREF(capi_centered_prev_as_array); } - } /* if (capi_centered_prev_as_array == NULL) ... else of centered_prev */ - /* End of cleaning variable centered_prev */ - if((PyObject *)capi_lat_max_as_array!=lat_max_capi) { - Py_XDECREF(capi_lat_max_as_array); } - } /* if (capi_lat_max_as_array == NULL) ... else of lat_max */ - /* End of cleaning variable lat_max */ - if((PyObject *)capi_lat_min_as_array!=lat_min_capi) { - Py_XDECREF(capi_lat_min_as_array); } - } /* if (capi_lat_min_as_array == NULL) ... else of lat_min */ - /* End of cleaning variable lat_min */ - if((PyObject *)capi_lat_max_prev_as_array!=lat_max_prev_capi) { - Py_XDECREF(capi_lat_max_prev_as_array); } - } /* if (capi_lat_max_prev_as_array == NULL) ... else of lat_max_prev */ - /* End of cleaning variable lat_max_prev */ - if((PyObject *)capi_lat_min_prev_as_array!=lat_min_prev_capi) { - Py_XDECREF(capi_lat_min_prev_as_array); } - } /* if (capi_lat_min_prev_as_array == NULL) ... else of lat_min_prev */ - /* End of cleaning variable lat_min_prev */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - } /*if (f2py_success) of n_sup_ws*/ - /* End of cleaning variable n_sup_ws */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of assign *******************************/ - -/******************************** within_dmax ********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_within_dmax[] = "\ -within_dmax = within_dmax(v1,v2,v3,d1,d2,d3,tol)\n\nWrapper for ``within_dmax``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"v3 : input rank-1 array('d') with bounds (3)\n" -"d1 : input float\n" -"d2 : input float\n" -"d3 : input float\n" -"tol : input float\n" -"\nReturns\n-------\n" -"within_dmax : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_within_dmax(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int within_dmaxf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - double *v3 = NULL; - npy_intp v3_Dims[1] = {-1}; - const int v3_Rank = 1; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - double d1 = 0; - PyObject *d1_capi = Py_None; - double d2 = 0; - PyObject *d2_capi = Py_None; - double d3 = 0; - PyObject *d3_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2","v3","d1","d2","d3","tol",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|:thirdorder.third_order_centering.within_dmax",\ - capi_kwlist,&v1_capi,&v2_capi,&v3_capi,&d1_capi,&d2_capi,&d3_capi,&tol_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.within_dmax: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.within_dmax: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable v3 */ - v3_Dims[0]=3; - capi_v3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.within_dmax: failed to create array from the 3rd argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable d1 */ - f2py_success = double_from_pyobj(&d1,d1_capi,"thirdorder.third_order_centering.within_dmax() 4th argument (d1) can't be converted to double"); - if (f2py_success) { - /* Processing variable d2 */ - f2py_success = double_from_pyobj(&d2,d2_capi,"thirdorder.third_order_centering.within_dmax() 5th argument (d2) can't be converted to double"); - if (f2py_success) { - /* Processing variable d3 */ - f2py_success = double_from_pyobj(&d3,d3_capi,"thirdorder.third_order_centering.within_dmax() 6th argument (d3) can't be converted to double"); - if (f2py_success) { - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"thirdorder.third_order_centering.within_dmax() 7th argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable within_dmaxf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&within_dmaxf2pywrap,v1,v2,v3,&d1,&d2,&d3,&tol); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",within_dmaxf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable within_dmaxf2pywrap */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - } /*if (f2py_success) of d3*/ - /* End of cleaning variable d3 */ - } /*if (f2py_success) of d2*/ - /* End of cleaning variable d2 */ - } /*if (f2py_success) of d1*/ - /* End of cleaning variable d1 */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of within_dmax *****************************/ - -/***************************** compute_perimeter *****************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_compute_perimeter[] = "\ -compute_perimeter = compute_perimeter(v1,v2,v3)\n\nWrapper for ``compute_perimeter``.\ -\n\nParameters\n----------\n" -"v1 : input rank-1 array('d') with bounds (3)\n" -"v2 : input rank-1 array('d') with bounds (3)\n" -"v3 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"compute_perimeter : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_compute_perimeter(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double compute_perimeterf2pywrap = 0; - double *v1 = NULL; - npy_intp v1_Dims[1] = {-1}; - const int v1_Rank = 1; - PyArrayObject *capi_v1_as_array = NULL; - int capi_v1_intent = 0; - PyObject *v1_capi = Py_None; - double *v2 = NULL; - npy_intp v2_Dims[1] = {-1}; - const int v2_Rank = 1; - PyArrayObject *capi_v2_as_array = NULL; - int capi_v2_intent = 0; - PyObject *v2_capi = Py_None; - double *v3 = NULL; - npy_intp v3_Dims[1] = {-1}; - const int v3_Rank = 1; - PyArrayObject *capi_v3_as_array = NULL; - int capi_v3_intent = 0; - PyObject *v3_capi = Py_None; - static char *capi_kwlist[] = {"v1","v2","v3",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.compute_perimeter",\ - capi_kwlist,&v1_capi,&v2_capi,&v3_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v1 */ - v1_Dims[0]=3; - capi_v1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.compute_perimeter: failed to create array from the 1st argument `v1`"; - capi_v1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v1_Dims,v1_Rank, capi_v1_intent,v1_capi,capi_errmess); - if (capi_v1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v1 = (double *)(PyArray_DATA(capi_v1_as_array)); - - /* Processing variable v2 */ - v2_Dims[0]=3; - capi_v2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.compute_perimeter: failed to create array from the 2nd argument `v2`"; - capi_v2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v2_Dims,v2_Rank, capi_v2_intent,v2_capi,capi_errmess); - if (capi_v2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v2 = (double *)(PyArray_DATA(capi_v2_as_array)); - - /* Processing variable v3 */ - v3_Dims[0]=3; - capi_v3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.compute_perimeter: failed to create array from the 3rd argument `v3`"; - capi_v3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v3_Dims,v3_Rank, capi_v3_intent,v3_capi,capi_errmess); - if (capi_v3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v3 = (double *)(PyArray_DATA(capi_v3_as_array)); - - /* Processing variable compute_perimeterf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&compute_perimeterf2pywrap,v1,v2,v3); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",compute_perimeterf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable compute_perimeterf2pywrap */ - if((PyObject *)capi_v3_as_array!=v3_capi) { - Py_XDECREF(capi_v3_as_array); } - } /* if (capi_v3_as_array == NULL) ... else of v3 */ - /* End of cleaning variable v3 */ - if((PyObject *)capi_v2_as_array!=v2_capi) { - Py_XDECREF(capi_v2_as_array); } - } /* if (capi_v2_as_array == NULL) ... else of v2 */ - /* End of cleaning variable v2 */ - if((PyObject *)capi_v1_as_array!=v1_capi) { - Py_XDECREF(capi_v1_as_array); } - } /* if (capi_v1_as_array == NULL) ... else of v1 */ - /* End of cleaning variable v1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of compute_perimeter **************************/ - -/****************************** three_to_one_len ******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_three_to_one_len[] = "\ -three_to_one_len = three_to_one_len(v,v_min,v_len)\n\nWrapper for ``three_to_one_len``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_len : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"three_to_one_len : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_three_to_one_len(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int three_to_one_lenf2pywrap = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_len = NULL; - npy_intp v_len_Dims[1] = {-1}; - const int v_len_Rank = 1; - PyArrayObject *capi_v_len_as_array = NULL; - int capi_v_len_intent = 0; - PyObject *v_len_capi = Py_None; - static char *capi_kwlist[] = {"v","v_min","v_len",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.three_to_one_len",\ - capi_kwlist,&v_capi,&v_min_capi,&v_len_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one_len: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one_len: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_len */ - v_len_Dims[0]=3; - capi_v_len_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one_len: failed to create array from the 3rd argument `v_len`"; - capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); - if (capi_v_len_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); - - /* Processing variable three_to_one_lenf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&three_to_one_lenf2pywrap,v,v_min,v_len); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",three_to_one_lenf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable three_to_one_lenf2pywrap */ - if((PyObject *)capi_v_len_as_array!=v_len_capi) { - Py_XDECREF(capi_v_len_as_array); } - } /* if (capi_v_len_as_array == NULL) ... else of v_len */ - /* End of cleaning variable v_len */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of three_to_one_len **************************/ - -/******************************** three_to_one ********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_three_to_one[] = "\ -three_to_one = three_to_one(v,v_min,v_max)\n\nWrapper for ``three_to_one``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_max : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"three_to_one : int"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_three_to_one(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int three_to_onef2pywrap = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_max = NULL; - npy_intp v_max_Dims[1] = {-1}; - const int v_max_Rank = 1; - PyArrayObject *capi_v_max_as_array = NULL; - int capi_v_max_intent = 0; - PyObject *v_max_capi = Py_None; - static char *capi_kwlist[] = {"v","v_min","v_max",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.three_to_one",\ - capi_kwlist,&v_capi,&v_min_capi,&v_max_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_max */ - v_max_Dims[0]=3; - capi_v_max_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.three_to_one: failed to create array from the 3rd argument `v_max`"; - capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); - if (capi_v_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); - - /* Processing variable three_to_onef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&three_to_onef2pywrap,v,v_min,v_max); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",three_to_onef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable three_to_onef2pywrap */ - if((PyObject *)capi_v_max_as_array!=v_max_capi) { - Py_XDECREF(capi_v_max_as_array); } - } /* if (capi_v_max_as_array == NULL) ... else of v_max */ - /* End of cleaning variable v_max */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of three_to_one ****************************/ - -/****************************** one_to_three_len ******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_one_to_three_len[] = "\ -one_to_three_len = one_to_three_len(j,v_min,v_len)\n\nWrapper for ``one_to_three_len``.\ -\n\nParameters\n----------\n" -"j : input int\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_len : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"one_to_three_len : rank-1 array('i') with bounds (3) and one_to_three_lenf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_one_to_three_len(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *one_to_three_lenf2pywrap = NULL; - npy_intp one_to_three_lenf2pywrap_Dims[1] = {-1}; - const int one_to_three_lenf2pywrap_Rank = 1; - PyArrayObject *capi_one_to_three_lenf2pywrap_as_array = NULL; - int capi_one_to_three_lenf2pywrap_intent = 0; - int j = 0; - PyObject *j_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_len = NULL; - npy_intp v_len_Dims[1] = {-1}; - const int v_len_Rank = 1; - PyArrayObject *capi_v_len_as_array = NULL; - int capi_v_len_intent = 0; - PyObject *v_len_capi = Py_None; - static char *capi_kwlist[] = {"j","v_min","v_len",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.one_to_three_len",\ - capi_kwlist,&j_capi,&v_min_capi,&v_len_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable j */ - f2py_success = int_from_pyobj(&j,j_capi,"thirdorder.third_order_centering.one_to_three_len() 1st argument (j) can't be converted to int"); - if (f2py_success) { - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three_len: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_len */ - v_len_Dims[0]=3; - capi_v_len_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three_len: failed to create array from the 3rd argument `v_len`"; - capi_v_len_as_array = ndarray_from_pyobj( NPY_INT,1,v_len_Dims,v_len_Rank, capi_v_len_intent,v_len_capi,capi_errmess); - if (capi_v_len_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_len = (int *)(PyArray_DATA(capi_v_len_as_array)); - - /* Processing variable one_to_three_lenf2pywrap */ - one_to_three_lenf2pywrap_Dims[0]=3; - capi_one_to_three_lenf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three_len: failed to create array from the hidden `one_to_three_lenf2pywrap`"; - capi_one_to_three_lenf2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_three_lenf2pywrap_Dims,one_to_three_lenf2pywrap_Rank, capi_one_to_three_lenf2pywrap_intent,Py_None,capi_errmess); - if (capi_one_to_three_lenf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - one_to_three_lenf2pywrap = (int *)(PyArray_DATA(capi_one_to_three_lenf2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(one_to_three_lenf2pywrap,&j,v_min,v_len); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_one_to_three_lenf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_one_to_three_lenf2pywrap_as_array == NULL) ... else of one_to_three_lenf2pywrap */ - /* End of cleaning variable one_to_three_lenf2pywrap */ - if((PyObject *)capi_v_len_as_array!=v_len_capi) { - Py_XDECREF(capi_v_len_as_array); } - } /* if (capi_v_len_as_array == NULL) ... else of v_len */ - /* End of cleaning variable v_len */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - } /*if (f2py_success) of j*/ - /* End of cleaning variable j */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of one_to_three_len **************************/ - -/******************************** one_to_three ********************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_one_to_three[] = "\ -one_to_three = one_to_three(j,v_min,v_max)\n\nWrapper for ``one_to_three``.\ -\n\nParameters\n----------\n" -"j : input int\n" -"v_min : input rank-1 array('i') with bounds (3)\n" -"v_max : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"one_to_three : rank-1 array('i') with bounds (3) and one_to_threef2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_one_to_three(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *one_to_threef2pywrap = NULL; - npy_intp one_to_threef2pywrap_Dims[1] = {-1}; - const int one_to_threef2pywrap_Rank = 1; - PyArrayObject *capi_one_to_threef2pywrap_as_array = NULL; - int capi_one_to_threef2pywrap_intent = 0; - int j = 0; - PyObject *j_capi = Py_None; - int *v_min = NULL; - npy_intp v_min_Dims[1] = {-1}; - const int v_min_Rank = 1; - PyArrayObject *capi_v_min_as_array = NULL; - int capi_v_min_intent = 0; - PyObject *v_min_capi = Py_None; - int *v_max = NULL; - npy_intp v_max_Dims[1] = {-1}; - const int v_max_Rank = 1; - PyArrayObject *capi_v_max_as_array = NULL; - int capi_v_max_intent = 0; - PyObject *v_max_capi = Py_None; - static char *capi_kwlist[] = {"j","v_min","v_max",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.one_to_three",\ - capi_kwlist,&j_capi,&v_min_capi,&v_max_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable j */ - f2py_success = int_from_pyobj(&j,j_capi,"thirdorder.third_order_centering.one_to_three() 1st argument (j) can't be converted to int"); - if (f2py_success) { - /* Processing variable v_min */ - v_min_Dims[0]=3; - capi_v_min_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three: failed to create array from the 2nd argument `v_min`"; - capi_v_min_as_array = ndarray_from_pyobj( NPY_INT,1,v_min_Dims,v_min_Rank, capi_v_min_intent,v_min_capi,capi_errmess); - if (capi_v_min_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_min = (int *)(PyArray_DATA(capi_v_min_as_array)); - - /* Processing variable v_max */ - v_max_Dims[0]=3; - capi_v_max_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three: failed to create array from the 3rd argument `v_max`"; - capi_v_max_as_array = ndarray_from_pyobj( NPY_INT,1,v_max_Dims,v_max_Rank, capi_v_max_intent,v_max_capi,capi_errmess); - if (capi_v_max_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v_max = (int *)(PyArray_DATA(capi_v_max_as_array)); - - /* Processing variable one_to_threef2pywrap */ - one_to_threef2pywrap_Dims[0]=3; - capi_one_to_threef2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.one_to_three: failed to create array from the hidden `one_to_threef2pywrap`"; - capi_one_to_threef2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,one_to_threef2pywrap_Dims,one_to_threef2pywrap_Rank, capi_one_to_threef2pywrap_intent,Py_None,capi_errmess); - if (capi_one_to_threef2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - one_to_threef2pywrap = (int *)(PyArray_DATA(capi_one_to_threef2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(one_to_threef2pywrap,&j,v_min,v_max); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_one_to_threef2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_one_to_threef2pywrap_as_array == NULL) ... else of one_to_threef2pywrap */ - /* End of cleaning variable one_to_threef2pywrap */ - if((PyObject *)capi_v_max_as_array!=v_max_capi) { - Py_XDECREF(capi_v_max_as_array); } - } /* if (capi_v_max_as_array == NULL) ... else of v_max */ - /* End of cleaning variable v_max */ - if((PyObject *)capi_v_min_as_array!=v_min_capi) { - Py_XDECREF(capi_v_min_as_array); } - } /* if (capi_v_min_as_array == NULL) ... else of v_min */ - /* End of cleaning variable v_min */ - } /*if (f2py_success) of j*/ - /* End of cleaning variable j */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of one_to_three ****************************/ - -/******************************* min_el_wise_2 *******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_2[] = "\ -min_el_wise_2 = min_el_wise_2(a,b)\n\nWrapper for ``min_el_wise_2``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"min_el_wise_2 : rank-1 array('i') with bounds (3) and min_el_wise_2f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_min_el_wise_2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *min_el_wise_2f2pywrap = NULL; - npy_intp min_el_wise_2f2pywrap_Dims[1] = {-1}; - const int min_el_wise_2f2pywrap_Rank = 1; - PyArrayObject *capi_min_el_wise_2f2pywrap_as_array = NULL; - int capi_min_el_wise_2f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - static char *capi_kwlist[] = {"a","b",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_centering.min_el_wise_2",\ - capi_kwlist,&a_capi,&b_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_2: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_2: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable min_el_wise_2f2pywrap */ - min_el_wise_2f2pywrap_Dims[0]=3; - capi_min_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_2: failed to create array from the hidden `min_el_wise_2f2pywrap`"; - capi_min_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_2f2pywrap_Dims,min_el_wise_2f2pywrap_Rank, capi_min_el_wise_2f2pywrap_intent,Py_None,capi_errmess); - if (capi_min_el_wise_2f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - min_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_2f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(min_el_wise_2f2pywrap,a,b); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_2f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_min_el_wise_2f2pywrap_as_array == NULL) ... else of min_el_wise_2f2pywrap */ - /* End of cleaning variable min_el_wise_2f2pywrap */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of min_el_wise_2 ****************************/ - -/******************************* max_el_wise_2 *******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_2[] = "\ -max_el_wise_2 = max_el_wise_2(a,b)\n\nWrapper for ``max_el_wise_2``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"max_el_wise_2 : rank-1 array('i') with bounds (3) and max_el_wise_2f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_max_el_wise_2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *max_el_wise_2f2pywrap = NULL; - npy_intp max_el_wise_2f2pywrap_Dims[1] = {-1}; - const int max_el_wise_2f2pywrap_Rank = 1; - PyArrayObject *capi_max_el_wise_2f2pywrap_as_array = NULL; - int capi_max_el_wise_2f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - static char *capi_kwlist[] = {"a","b",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_centering.max_el_wise_2",\ - capi_kwlist,&a_capi,&b_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_2: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_2: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable max_el_wise_2f2pywrap */ - max_el_wise_2f2pywrap_Dims[0]=3; - capi_max_el_wise_2f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_2: failed to create array from the hidden `max_el_wise_2f2pywrap`"; - capi_max_el_wise_2f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_2f2pywrap_Dims,max_el_wise_2f2pywrap_Rank, capi_max_el_wise_2f2pywrap_intent,Py_None,capi_errmess); - if (capi_max_el_wise_2f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - max_el_wise_2f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_2f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(max_el_wise_2f2pywrap,a,b); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_2f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_max_el_wise_2f2pywrap_as_array == NULL) ... else of max_el_wise_2f2pywrap */ - /* End of cleaning variable max_el_wise_2f2pywrap */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of max_el_wise_2 ****************************/ - -/******************************* min_el_wise_3 *******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_3[] = "\ -min_el_wise_3 = min_el_wise_3(a,b,c)\n\nWrapper for ``min_el_wise_3``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"c : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"min_el_wise_3 : rank-1 array('i') with bounds (3) and min_el_wise_3f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_min_el_wise_3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *min_el_wise_3f2pywrap = NULL; - npy_intp min_el_wise_3f2pywrap_Dims[1] = {-1}; - const int min_el_wise_3f2pywrap_Rank = 1; - PyArrayObject *capi_min_el_wise_3f2pywrap_as_array = NULL; - int capi_min_el_wise_3f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - int *c = NULL; - npy_intp c_Dims[1] = {-1}; - const int c_Rank = 1; - PyArrayObject *capi_c_as_array = NULL; - int capi_c_intent = 0; - PyObject *c_capi = Py_None; - static char *capi_kwlist[] = {"a","b","c",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.min_el_wise_3",\ - capi_kwlist,&a_capi,&b_capi,&c_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable c */ - c_Dims[0]=3; - capi_c_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the 3rd argument `c`"; - capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); - if (capi_c_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - c = (int *)(PyArray_DATA(capi_c_as_array)); - - /* Processing variable min_el_wise_3f2pywrap */ - min_el_wise_3f2pywrap_Dims[0]=3; - capi_min_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.min_el_wise_3: failed to create array from the hidden `min_el_wise_3f2pywrap`"; - capi_min_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,min_el_wise_3f2pywrap_Dims,min_el_wise_3f2pywrap_Rank, capi_min_el_wise_3f2pywrap_intent,Py_None,capi_errmess); - if (capi_min_el_wise_3f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - min_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_min_el_wise_3f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(min_el_wise_3f2pywrap,a,b,c); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_min_el_wise_3f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_min_el_wise_3f2pywrap_as_array == NULL) ... else of min_el_wise_3f2pywrap */ - /* End of cleaning variable min_el_wise_3f2pywrap */ - if((PyObject *)capi_c_as_array!=c_capi) { - Py_XDECREF(capi_c_as_array); } - } /* if (capi_c_as_array == NULL) ... else of c */ - /* End of cleaning variable c */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of min_el_wise_3 ****************************/ - -/******************************* max_el_wise_3 *******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_3[] = "\ -max_el_wise_3 = max_el_wise_3(a,b,c)\n\nWrapper for ``max_el_wise_3``.\ -\n\nParameters\n----------\n" -"a : input rank-1 array('i') with bounds (3)\n" -"b : input rank-1 array('i') with bounds (3)\n" -"c : input rank-1 array('i') with bounds (3)\n" -"\nReturns\n-------\n" -"max_el_wise_3 : rank-1 array('i') with bounds (3) and max_el_wise_3f2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_max_el_wise_3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int *max_el_wise_3f2pywrap = NULL; - npy_intp max_el_wise_3f2pywrap_Dims[1] = {-1}; - const int max_el_wise_3f2pywrap_Rank = 1; - PyArrayObject *capi_max_el_wise_3f2pywrap_as_array = NULL; - int capi_max_el_wise_3f2pywrap_intent = 0; - int *a = NULL; - npy_intp a_Dims[1] = {-1}; - const int a_Rank = 1; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int *b = NULL; - npy_intp b_Dims[1] = {-1}; - const int b_Rank = 1; - PyArrayObject *capi_b_as_array = NULL; - int capi_b_intent = 0; - PyObject *b_capi = Py_None; - int *c = NULL; - npy_intp c_Dims[1] = {-1}; - const int c_Rank = 1; - PyArrayObject *capi_c_as_array = NULL; - int capi_c_intent = 0; - PyObject *c_capi = Py_None; - static char *capi_kwlist[] = {"a","b","c",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_centering.max_el_wise_3",\ - capi_kwlist,&a_capi,&b_capi,&c_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - a_Dims[0]=3; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_INT,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (int *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable b */ - b_Dims[0]=3; - capi_b_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the 2nd argument `b`"; - capi_b_as_array = ndarray_from_pyobj( NPY_INT,1,b_Dims,b_Rank, capi_b_intent,b_capi,capi_errmess); - if (capi_b_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - b = (int *)(PyArray_DATA(capi_b_as_array)); - - /* Processing variable c */ - c_Dims[0]=3; - capi_c_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the 3rd argument `c`"; - capi_c_as_array = ndarray_from_pyobj( NPY_INT,1,c_Dims,c_Rank, capi_c_intent,c_capi,capi_errmess); - if (capi_c_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - c = (int *)(PyArray_DATA(capi_c_as_array)); - - /* Processing variable max_el_wise_3f2pywrap */ - max_el_wise_3f2pywrap_Dims[0]=3; - capi_max_el_wise_3f2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.max_el_wise_3: failed to create array from the hidden `max_el_wise_3f2pywrap`"; - capi_max_el_wise_3f2pywrap_as_array = ndarray_from_pyobj( NPY_INT,1,max_el_wise_3f2pywrap_Dims,max_el_wise_3f2pywrap_Rank, capi_max_el_wise_3f2pywrap_intent,Py_None,capi_errmess); - if (capi_max_el_wise_3f2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - max_el_wise_3f2pywrap = (int *)(PyArray_DATA(capi_max_el_wise_3f2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(max_el_wise_3f2pywrap,a,b,c); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_max_el_wise_3f2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_max_el_wise_3f2pywrap_as_array == NULL) ... else of max_el_wise_3f2pywrap */ - /* End of cleaning variable max_el_wise_3f2pywrap */ - if((PyObject *)capi_c_as_array!=c_capi) { - Py_XDECREF(capi_c_as_array); } - } /* if (capi_c_as_array == NULL) ... else of c */ - /* End of cleaning variable c */ - if((PyObject *)capi_b_as_array!=b_capi) { - Py_XDECREF(capi_b_as_array); } - } /* if (capi_b_as_array == NULL) ... else of b */ - /* End of cleaning variable b */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of max_el_wise_3 ****************************/ - -/******************************* cryst_to_cart *******************************/ -static char doc_f2py_rout_thirdorder_third_order_centering_cryst_to_cart[] = "\ -cryst_to_cart = cryst_to_cart(v,alat)\n\nWrapper for ``cryst_to_cart``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('i') with bounds (3)\n" -"alat : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"cryst_to_cart : rank-1 array('d') with bounds (3) and cryst_to_cartf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_centering_cryst_to_cart(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *cryst_to_cartf2pywrap = NULL; - npy_intp cryst_to_cartf2pywrap_Dims[1] = {-1}; - const int cryst_to_cartf2pywrap_Rank = 1; - PyArrayObject *capi_cryst_to_cartf2pywrap_as_array = NULL; - int capi_cryst_to_cartf2pywrap_intent = 0; - int *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - double *alat = NULL; - npy_intp alat_Dims[2] = {-1, -1}; - const int alat_Rank = 2; - PyArrayObject *capi_alat_as_array = NULL; - int capi_alat_intent = 0; - PyObject *alat_capi = Py_None; - static char *capi_kwlist[] = {"v","alat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_centering.cryst_to_cart",\ - capi_kwlist,&v_capi,&alat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.cryst_to_cart: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_INT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (int *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable alat */ - alat_Dims[0]=3,alat_Dims[1]=3; - capi_alat_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.cryst_to_cart: failed to create array from the 2nd argument `alat`"; - capi_alat_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,alat_Dims,alat_Rank, capi_alat_intent,alat_capi,capi_errmess); - if (capi_alat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - alat = (double *)(PyArray_DATA(capi_alat_as_array)); - - /* Processing variable cryst_to_cartf2pywrap */ - cryst_to_cartf2pywrap_Dims[0]=3; - capi_cryst_to_cartf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_centering.cryst_to_cart: failed to create array from the hidden `cryst_to_cartf2pywrap`"; - capi_cryst_to_cartf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,cryst_to_cartf2pywrap_Dims,cryst_to_cartf2pywrap_Rank, capi_cryst_to_cartf2pywrap_intent,Py_None,capi_errmess); - if (capi_cryst_to_cartf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - cryst_to_cartf2pywrap = (double *)(PyArray_DATA(capi_cryst_to_cartf2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(cryst_to_cartf2pywrap,v,alat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_cryst_to_cartf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_cryst_to_cartf2pywrap_as_array == NULL) ... else of cryst_to_cartf2pywrap */ - /* End of cleaning variable cryst_to_cartf2pywrap */ - if((PyObject *)capi_alat_as_array!=alat_capi) { - Py_XDECREF(capi_alat_as_array); } - } /* if (capi_alat_as_array == NULL) ... else of alat */ - /* End of cleaning variable alat */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of cryst_to_cart ****************************/ - -/************************* check_permutation_symmetry *************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry[] = "\ -perm = check_permutation_symmetry(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``check_permutation_symmetry``.\ -\n\nParameters\n----------\n" -"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" -"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" -"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 0)\n" -"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" -"\nReturns\n-------\n" -"perm : int"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *r_vector2 = NULL; - npy_intp r_vector2_Dims[2] = {-1, -1}; - const int r_vector2_Rank = 2; - PyArrayObject *capi_r_vector2_as_array = NULL; - int capi_r_vector2_intent = 0; - PyObject *r_vector2_capi = Py_None; - double *r_vector3 = NULL; - npy_intp r_vector3_Dims[2] = {-1, -1}; - const int r_vector3_Rank = 2; - PyArrayObject *capi_r_vector3_as_array = NULL; - int capi_r_vector3_intent = 0; - PyObject *r_vector3_capi = Py_None; - int n_r = 0; - PyObject *n_r_capi = Py_None; - int natom = 0; - PyObject *natom_capi = Py_None; - int perm = 0; - static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thirdorder.third_order_cond_centering.check_permutation_symmetry",\ - capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable tensor */ - ; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.check_permutation_symmetry: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - /* Processing variable perm */ - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 0); else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.check_permutation_symmetry() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","check_permutation_symmetry:n_r=%d",n_r) { - /* Processing variable natom */ - if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.check_permutation_symmetry() 2nd keyword (natom) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","check_permutation_symmetry:natom=%d",natom) { - /* Processing variable r_vector2 */ - r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; - capi_r_vector2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.check_permutation_symmetry: failed to create array from the 2nd argument `r_vector2`"; - capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); - if (capi_r_vector2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); - - /* Processing variable r_vector3 */ - r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; - capi_r_vector3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.check_permutation_symmetry: failed to create array from the 3rd argument `r_vector3`"; - capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); - if (capi_r_vector3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,r_vector2,r_vector3,&n_r,&natom,&perm); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",perm); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { - Py_XDECREF(capi_r_vector3_as_array); } - } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ - /* End of cleaning variable r_vector3 */ - if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { - Py_XDECREF(capi_r_vector2_as_array); } - } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ - /* End of cleaning variable r_vector2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ - } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - /* End of cleaning variable perm */ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of check_permutation_symmetry *********************/ - -/************************* apply_permutation_symmetry *************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry[] = "\ -new_tensor = apply_permutation_symmetry(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``apply_permutation_symmetry``.\ -\n\nParameters\n----------\n" -"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" -"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" -"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 0)\n" -"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" -"\nReturns\n-------\n" -"new_tensor : rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *r_vector2 = NULL; - npy_intp r_vector2_Dims[2] = {-1, -1}; - const int r_vector2_Rank = 2; - PyArrayObject *capi_r_vector2_as_array = NULL; - int capi_r_vector2_intent = 0; - PyObject *r_vector2_capi = Py_None; - double *r_vector3 = NULL; - npy_intp r_vector3_Dims[2] = {-1, -1}; - const int r_vector3_Rank = 2; - PyArrayObject *capi_r_vector3_as_array = NULL; - int capi_r_vector3_intent = 0; - PyObject *r_vector3_capi = Py_None; - double *new_tensor = NULL; - npy_intp new_tensor_Dims[4] = {-1, -1, -1, -1}; - const int new_tensor_Rank = 4; - PyArrayObject *capi_new_tensor_as_array = NULL; - int capi_new_tensor_intent = 0; - int n_r = 0; - PyObject *n_r_capi = Py_None; - int natom = 0; - PyObject *natom_capi = Py_None; - static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thirdorder.third_order_cond_centering.apply_permutation_symmetry",\ - capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable tensor */ - ; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 0); else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","apply_permutation_symmetry:n_r=%d",n_r) { - /* Processing variable natom */ - if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry() 2nd keyword (natom) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","apply_permutation_symmetry:natom=%d",natom) { - /* Processing variable r_vector2 */ - r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; - capi_r_vector2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the 2nd argument `r_vector2`"; - capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); - if (capi_r_vector2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); - - /* Processing variable r_vector3 */ - r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; - capi_r_vector3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the 3rd argument `r_vector3`"; - capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); - if (capi_r_vector3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); - - /* Processing variable new_tensor */ - new_tensor_Dims[0]=n_r,new_tensor_Dims[1]=3 * natom,new_tensor_Dims[2]=3 * natom,new_tensor_Dims[3]=3 * natom; - capi_new_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry: failed to create array from the hidden `new_tensor`"; - capi_new_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_tensor_Dims,new_tensor_Rank, capi_new_tensor_intent,Py_None,capi_errmess); - if (capi_new_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - new_tensor = (double *)(PyArray_DATA(capi_new_tensor_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,r_vector2,r_vector3,new_tensor,&n_r,&natom); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_new_tensor_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_new_tensor_as_array == NULL) ... else of new_tensor */ - /* End of cleaning variable new_tensor */ - if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { - Py_XDECREF(capi_r_vector3_as_array); } - } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ - /* End of cleaning variable r_vector3 */ - if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { - Py_XDECREF(capi_r_vector2_as_array); } - } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ - /* End of cleaning variable r_vector2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ - } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of apply_permutation_symmetry *********************/ - -/********************** apply_permutation_symmetry_local **********************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local[] = "\ -apply_permutation_symmetry_local(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``apply_permutation_symmetry_local``.\ -\n\nParameters\n----------\n" -"tensor : in/output rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" -"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" -"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 0)\n" -"natom : input int, optional\n Default: shape(tensor, 1) / 3"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *r_vector2 = NULL; - npy_intp r_vector2_Dims[2] = {-1, -1}; - const int r_vector2_Rank = 2; - PyArrayObject *capi_r_vector2_as_array = NULL; - int capi_r_vector2_intent = 0; - PyObject *r_vector2_capi = Py_None; - double *r_vector3 = NULL; - npy_intp r_vector3_Dims[2] = {-1, -1}; - const int r_vector3_Rank = 2; - PyArrayObject *capi_r_vector3_as_array = NULL; - int capi_r_vector3_intent = 0; - PyObject *r_vector3_capi = Py_None; - int n_r = 0; - PyObject *n_r_capi = Py_None; - int natom = 0; - PyObject *natom_capi = Py_None; - static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thirdorder.third_order_cond_centering.apply_permutation_symmetry_local",\ - capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable tensor */ - ; - capi_tensor_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry_local: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 0); else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry_local() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","apply_permutation_symmetry_local:n_r=%d",n_r) { - /* Processing variable natom */ - if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.apply_permutation_symmetry_local() 2nd keyword (natom) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","apply_permutation_symmetry_local:natom=%d",natom) { - /* Processing variable r_vector2 */ - r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; - capi_r_vector2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry_local: failed to create array from the 2nd argument `r_vector2`"; - capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); - if (capi_r_vector2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); - - /* Processing variable r_vector3 */ - r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; - capi_r_vector3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_permutation_symmetry_local: failed to create array from the 3rd argument `r_vector3`"; - capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); - if (capi_r_vector3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,r_vector2,r_vector3,&n_r,&natom); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { - Py_XDECREF(capi_r_vector3_as_array); } - } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ - /* End of cleaning variable r_vector3 */ - if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { - Py_XDECREF(capi_r_vector2_as_array); } - } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ - /* End of cleaning variable r_vector2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ - } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************** end of apply_permutation_symmetry_local ******************/ - -/***************************** number_of_triplets *****************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets[] = "\ -itrip = number_of_triplets(tensor,rvec2,rvec3,tot_trip,natom,[n_r])\n\nWrapper for ``number_of_triplets``.\ -\n\nParameters\n----------\n" -"tensor : input rank-5 array('d') with bounds (natom * natom * natom,81 * n_r,3,3,3)\n" -"rvec2 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" -"rvec3 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" -"tot_trip : input rank-1 array('i') with bounds (natom * natom * natom)\n" -"natom : input int\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 1) / 81\n" -"\nReturns\n-------\n" -"itrip : int"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[5] = {-1, -1, -1, -1, -1}; - const int tensor_Rank = 5; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *rvec2 = NULL; - npy_intp rvec2_Dims[3] = {-1, -1, -1}; - const int rvec2_Rank = 3; - PyArrayObject *capi_rvec2_as_array = NULL; - int capi_rvec2_intent = 0; - PyObject *rvec2_capi = Py_None; - double *rvec3 = NULL; - npy_intp rvec3_Dims[3] = {-1, -1, -1}; - const int rvec3_Rank = 3; - PyArrayObject *capi_rvec3_as_array = NULL; - int capi_rvec3_intent = 0; - PyObject *rvec3_capi = Py_None; - int *tot_trip = NULL; - npy_intp tot_trip_Dims[1] = {-1}; - const int tot_trip_Rank = 1; - PyArrayObject *capi_tot_trip_as_array = NULL; - int capi_tot_trip_intent = 0; - PyObject *tot_trip_capi = Py_None; - int itrip = 0; - int natom = 0; - PyObject *natom_capi = Py_None; - int n_r = 0; - PyObject *n_r_capi = Py_None; - static char *capi_kwlist[] = {"tensor","rvec2","rvec3","tot_trip","natom","n_r",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|O:thirdorder.third_order_cond_centering.number_of_triplets",\ - capi_kwlist,&tensor_capi,&rvec2_capi,&rvec3_capi,&tot_trip_capi,&natom_capi,&n_r_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable natom */ - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.number_of_triplets() 5th argument (natom) can't be converted to int"); - if (f2py_success) { - /* Processing variable itrip */ - /* Processing variable tensor */ - tensor_Dims[0]=natom * natom * natom,tensor_Dims[2]=3,tensor_Dims[3]=3,tensor_Dims[4]=3; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - CHECKARRAY(shape(tensor, 0) == natom * natom * natom,"shape(tensor, 0) == natom * natom * natom","1st argument tensor") { - /* Processing variable tot_trip */ - tot_trip_Dims[0]=natom * natom * natom; - capi_tot_trip_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 4th argument `tot_trip`"; - capi_tot_trip_as_array = ndarray_from_pyobj( NPY_INT,1,tot_trip_Dims,tot_trip_Rank, capi_tot_trip_intent,tot_trip_capi,capi_errmess); - if (capi_tot_trip_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tot_trip = (int *)(PyArray_DATA(capi_tot_trip_as_array)); - - CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom,"shape(tot_trip, 0) == natom * natom * natom","4th argument tot_trip") { - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 1) / 81; else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.number_of_triplets() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 81 * n_r,"shape(tensor, 1) == 81 * n_r","1st keyword n_r","number_of_triplets:n_r=%d",n_r) { - /* Processing variable rvec2 */ - rvec2_Dims[0]=natom * natom * natom,rvec2_Dims[1]=81 * n_r,rvec2_Dims[2]=3; - capi_rvec2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 2nd argument `rvec2`"; - capi_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec2_Dims,rvec2_Rank, capi_rvec2_intent,rvec2_capi,capi_errmess); - if (capi_rvec2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rvec2 = (double *)(PyArray_DATA(capi_rvec2_as_array)); - - CHECKARRAY(shape(rvec2, 0) == natom * natom * natom,"shape(rvec2, 0) == natom * natom * natom","2nd argument rvec2") { - /* Processing variable rvec3 */ - rvec3_Dims[0]=natom * natom * natom,rvec3_Dims[1]=81 * n_r,rvec3_Dims[2]=3; - capi_rvec3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.number_of_triplets: failed to create array from the 3rd argument `rvec3`"; - capi_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec3_Dims,rvec3_Rank, capi_rvec3_intent,rvec3_capi,capi_errmess); - if (capi_rvec3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rvec3 = (double *)(PyArray_DATA(capi_rvec3_as_array)); - - CHECKARRAY(shape(rvec3, 0) == natom * natom * natom,"shape(rvec3, 0) == natom * natom * natom","3rd argument rvec3") { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,rvec2,rvec3,tot_trip,&itrip,&natom,&n_r); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",itrip); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKARRAY(shape(rvec3, 0) == natom * natom * natom)*/ - if((PyObject *)capi_rvec3_as_array!=rvec3_capi) { - Py_XDECREF(capi_rvec3_as_array); } - } /* if (capi_rvec3_as_array == NULL) ... else of rvec3 */ - /* End of cleaning variable rvec3 */ - } /*CHECKARRAY(shape(rvec2, 0) == natom * natom * natom)*/ - if((PyObject *)capi_rvec2_as_array!=rvec2_capi) { - Py_XDECREF(capi_rvec2_as_array); } - } /* if (capi_rvec2_as_array == NULL) ... else of rvec2 */ - /* End of cleaning variable rvec2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 81 * n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - } /*CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom)*/ - if((PyObject *)capi_tot_trip_as_array!=tot_trip_capi) { - Py_XDECREF(capi_tot_trip_as_array); } - } /* if (capi_tot_trip_as_array == NULL) ... else of tot_trip */ - /* End of cleaning variable tot_trip */ - } /*CHECKARRAY(shape(tensor, 0) == natom * natom * natom)*/ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ - /* End of cleaning variable itrip */ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of number_of_triplets *************************/ - -/******************************* find_triplets *******************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_find_triplets[] = "\ -help_tensor,help_rvec2,help_rvec3,tot_trip = find_triplets(tensor,r_vector2,r_vector3,rsup,irsup,pos,far,[n_r,natom])\n\nWrapper for ``find_triplets``.\ -\n\nParameters\n----------\n" -"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" -"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" -"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" -"rsup : input rank-2 array('d') with bounds (3,3)\n" -"irsup : input rank-2 array('d') with bounds (3,3)\n" -"pos : input rank-2 array('d') with bounds (natom,3)\n" -"far : input int\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 0)\n" -"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" -"\nReturns\n-------\n" -"help_tensor : rank-5 array('d') with bounds (natom * natom * natom,81 * n_r,3,3,3)\n" -"help_rvec2 : rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" -"help_rvec3 : rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" -"tot_trip : rank-1 array('i') with bounds (natom * natom * natom)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_find_triplets(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *r_vector2 = NULL; - npy_intp r_vector2_Dims[2] = {-1, -1}; - const int r_vector2_Rank = 2; - PyArrayObject *capi_r_vector2_as_array = NULL; - int capi_r_vector2_intent = 0; - PyObject *r_vector2_capi = Py_None; - double *r_vector3 = NULL; - npy_intp r_vector3_Dims[2] = {-1, -1}; - const int r_vector3_Rank = 2; - PyArrayObject *capi_r_vector3_as_array = NULL; - int capi_r_vector3_intent = 0; - PyObject *r_vector3_capi = Py_None; - double *rsup = NULL; - npy_intp rsup_Dims[2] = {-1, -1}; - const int rsup_Rank = 2; - PyArrayObject *capi_rsup_as_array = NULL; - int capi_rsup_intent = 0; - PyObject *rsup_capi = Py_None; - double *irsup = NULL; - npy_intp irsup_Dims[2] = {-1, -1}; - const int irsup_Rank = 2; - PyArrayObject *capi_irsup_as_array = NULL; - int capi_irsup_intent = 0; - PyObject *irsup_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *help_tensor = NULL; - npy_intp help_tensor_Dims[5] = {-1, -1, -1, -1, -1}; - const int help_tensor_Rank = 5; - PyArrayObject *capi_help_tensor_as_array = NULL; - int capi_help_tensor_intent = 0; - double *help_rvec2 = NULL; - npy_intp help_rvec2_Dims[3] = {-1, -1, -1}; - const int help_rvec2_Rank = 3; - PyArrayObject *capi_help_rvec2_as_array = NULL; - int capi_help_rvec2_intent = 0; - double *help_rvec3 = NULL; - npy_intp help_rvec3_Dims[3] = {-1, -1, -1}; - const int help_rvec3_Rank = 3; - PyArrayObject *capi_help_rvec3_as_array = NULL; - int capi_help_rvec3_intent = 0; - int *tot_trip = NULL; - npy_intp tot_trip_Dims[1] = {-1}; - const int tot_trip_Rank = 1; - PyArrayObject *capi_tot_trip_as_array = NULL; - int capi_tot_trip_intent = 0; - int far = 0; - PyObject *far_capi = Py_None; - int n_r = 0; - PyObject *n_r_capi = Py_None; - int natom = 0; - PyObject *natom_capi = Py_None; - static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","rsup","irsup","pos","far","n_r","natom",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OO:thirdorder.third_order_cond_centering.find_triplets",\ - capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&rsup_capi,&irsup_capi,&pos_capi,&far_capi,&n_r_capi,&natom_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable far */ - f2py_success = int_from_pyobj(&far,far_capi,"thirdorder.third_order_cond_centering.find_triplets() 7th argument (far) can't be converted to int"); - if (f2py_success) { - /* Processing variable tensor */ - ; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - /* Processing variable rsup */ - rsup_Dims[0]=3,rsup_Dims[1]=3; - capi_rsup_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 4th argument `rsup`"; - capi_rsup_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rsup_Dims,rsup_Rank, capi_rsup_intent,rsup_capi,capi_errmess); - if (capi_rsup_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rsup = (double *)(PyArray_DATA(capi_rsup_as_array)); - - /* Processing variable irsup */ - irsup_Dims[0]=3,irsup_Dims[1]=3; - capi_irsup_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 5th argument `irsup`"; - capi_irsup_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,irsup_Dims,irsup_Rank, capi_irsup_intent,irsup_capi,capi_errmess); - if (capi_irsup_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - irsup = (double *)(PyArray_DATA(capi_irsup_as_array)); - - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 0); else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.find_triplets() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","find_triplets:n_r=%d",n_r) { - /* Processing variable natom */ - if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.find_triplets() 2nd keyword (natom) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","find_triplets:natom=%d",natom) { - /* Processing variable r_vector2 */ - r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; - capi_r_vector2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 2nd argument `r_vector2`"; - capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); - if (capi_r_vector2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); - - /* Processing variable r_vector3 */ - r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; - capi_r_vector3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 3rd argument `r_vector3`"; - capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); - if (capi_r_vector3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=natom,pos_Dims[1]=3; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the 6th argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable help_tensor */ - help_tensor_Dims[0]=natom * natom * natom,help_tensor_Dims[1]=81 * n_r,help_tensor_Dims[2]=3,help_tensor_Dims[3]=3,help_tensor_Dims[4]=3; - capi_help_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `help_tensor`"; - capi_help_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,help_tensor_Dims,help_tensor_Rank, capi_help_tensor_intent,Py_None,capi_errmess); - if (capi_help_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - help_tensor = (double *)(PyArray_DATA(capi_help_tensor_as_array)); - - /* Processing variable help_rvec2 */ - help_rvec2_Dims[0]=natom * natom * natom,help_rvec2_Dims[1]=81 * n_r,help_rvec2_Dims[2]=3; - capi_help_rvec2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `help_rvec2`"; - capi_help_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,help_rvec2_Dims,help_rvec2_Rank, capi_help_rvec2_intent,Py_None,capi_errmess); - if (capi_help_rvec2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - help_rvec2 = (double *)(PyArray_DATA(capi_help_rvec2_as_array)); - - /* Processing variable help_rvec3 */ - help_rvec3_Dims[0]=natom * natom * natom,help_rvec3_Dims[1]=81 * n_r,help_rvec3_Dims[2]=3; - capi_help_rvec3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `help_rvec3`"; - capi_help_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,help_rvec3_Dims,help_rvec3_Rank, capi_help_rvec3_intent,Py_None,capi_errmess); - if (capi_help_rvec3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - help_rvec3 = (double *)(PyArray_DATA(capi_help_rvec3_as_array)); - - /* Processing variable tot_trip */ - tot_trip_Dims[0]=natom * natom * natom; - capi_tot_trip_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_triplets: failed to create array from the hidden `tot_trip`"; - capi_tot_trip_as_array = ndarray_from_pyobj( NPY_INT,1,tot_trip_Dims,tot_trip_Rank, capi_tot_trip_intent,Py_None,capi_errmess); - if (capi_tot_trip_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tot_trip = (int *)(PyArray_DATA(capi_tot_trip_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,r_vector2,r_vector3,rsup,irsup,pos,help_tensor,help_rvec2,help_rvec3,tot_trip,&far,&n_r,&natom); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNNN",capi_help_tensor_as_array,capi_help_rvec2_as_array,capi_help_rvec3_as_array,capi_tot_trip_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_tot_trip_as_array == NULL) ... else of tot_trip */ - /* End of cleaning variable tot_trip */ - } /* if (capi_help_rvec3_as_array == NULL) ... else of help_rvec3 */ - /* End of cleaning variable help_rvec3 */ - } /* if (capi_help_rvec2_as_array == NULL) ... else of help_rvec2 */ - /* End of cleaning variable help_rvec2 */ - } /* if (capi_help_tensor_as_array == NULL) ... else of help_tensor */ - /* End of cleaning variable help_tensor */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { - Py_XDECREF(capi_r_vector3_as_array); } - } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ - /* End of cleaning variable r_vector3 */ - if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { - Py_XDECREF(capi_r_vector2_as_array); } - } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ - /* End of cleaning variable r_vector2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ - } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - if((PyObject *)capi_irsup_as_array!=irsup_capi) { - Py_XDECREF(capi_irsup_as_array); } - } /* if (capi_irsup_as_array == NULL) ... else of irsup */ - /* End of cleaning variable irsup */ - if((PyObject *)capi_rsup_as_array!=rsup_capi) { - Py_XDECREF(capi_rsup_as_array); } - } /* if (capi_rsup_as_array == NULL) ... else of rsup */ - /* End of cleaning variable rsup */ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ - } /*if (f2py_success) of far*/ - /* End of cleaning variable far */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of find_triplets ****************************/ - -/******************************* distribute_fc3 *******************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3[] = "\ -f_tensor,f_rvec2,f_rvec3,itrip = distribute_fc3(tensor,rvec2,rvec3,tot_trip,ntrip,natom,[n_r])\n\nWrapper for ``distribute_fc3``.\ -\n\nParameters\n----------\n" -"tensor : input rank-5 array('d') with bounds (natom * natom * natom,81 * n_r,3,3,3)\n" -"rvec2 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" -"rvec3 : input rank-3 array('d') with bounds (natom * natom * natom,81 * n_r,3)\n" -"tot_trip : input rank-1 array('i') with bounds (natom * natom * natom)\n" -"ntrip : input int\n" -"natom : input int\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 1) / 81\n" -"\nReturns\n-------\n" -"f_tensor : rank-4 array('d') with bounds (ntrip,3 * natom,3 * natom,3 * natom)\n" -"f_rvec2 : rank-2 array('d') with bounds (ntrip,3)\n" -"f_rvec3 : rank-2 array('d') with bounds (ntrip,3)\n" -"itrip : int"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,double*,double*,double*,int*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[5] = {-1, -1, -1, -1, -1}; - const int tensor_Rank = 5; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *rvec2 = NULL; - npy_intp rvec2_Dims[3] = {-1, -1, -1}; - const int rvec2_Rank = 3; - PyArrayObject *capi_rvec2_as_array = NULL; - int capi_rvec2_intent = 0; - PyObject *rvec2_capi = Py_None; - double *rvec3 = NULL; - npy_intp rvec3_Dims[3] = {-1, -1, -1}; - const int rvec3_Rank = 3; - PyArrayObject *capi_rvec3_as_array = NULL; - int capi_rvec3_intent = 0; - PyObject *rvec3_capi = Py_None; - int *tot_trip = NULL; - npy_intp tot_trip_Dims[1] = {-1}; - const int tot_trip_Rank = 1; - PyArrayObject *capi_tot_trip_as_array = NULL; - int capi_tot_trip_intent = 0; - PyObject *tot_trip_capi = Py_None; - double *f_tensor = NULL; - npy_intp f_tensor_Dims[4] = {-1, -1, -1, -1}; - const int f_tensor_Rank = 4; - PyArrayObject *capi_f_tensor_as_array = NULL; - int capi_f_tensor_intent = 0; - double *f_rvec2 = NULL; - npy_intp f_rvec2_Dims[2] = {-1, -1}; - const int f_rvec2_Rank = 2; - PyArrayObject *capi_f_rvec2_as_array = NULL; - int capi_f_rvec2_intent = 0; - double *f_rvec3 = NULL; - npy_intp f_rvec3_Dims[2] = {-1, -1}; - const int f_rvec3_Rank = 2; - PyArrayObject *capi_f_rvec3_as_array = NULL; - int capi_f_rvec3_intent = 0; - int itrip = 0; - int ntrip = 0; - PyObject *ntrip_capi = Py_None; - int natom = 0; - PyObject *natom_capi = Py_None; - int n_r = 0; - PyObject *n_r_capi = Py_None; - static char *capi_kwlist[] = {"tensor","rvec2","rvec3","tot_trip","ntrip","natom","n_r",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|O:thirdorder.third_order_cond_centering.distribute_fc3",\ - capi_kwlist,&tensor_capi,&rvec2_capi,&rvec3_capi,&tot_trip_capi,&ntrip_capi,&natom_capi,&n_r_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ntrip */ - f2py_success = int_from_pyobj(&ntrip,ntrip_capi,"thirdorder.third_order_cond_centering.distribute_fc3() 5th argument (ntrip) can't be converted to int"); - if (f2py_success) { - /* Processing variable natom */ - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.distribute_fc3() 6th argument (natom) can't be converted to int"); - if (f2py_success) { - /* Processing variable itrip */ - /* Processing variable tensor */ - tensor_Dims[0]=natom * natom * natom,tensor_Dims[2]=3,tensor_Dims[3]=3,tensor_Dims[4]=3; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - CHECKARRAY(shape(tensor, 0) == natom * natom * natom,"shape(tensor, 0) == natom * natom * natom","1st argument tensor") { - /* Processing variable tot_trip */ - tot_trip_Dims[0]=natom * natom * natom; - capi_tot_trip_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 4th argument `tot_trip`"; - capi_tot_trip_as_array = ndarray_from_pyobj( NPY_INT,1,tot_trip_Dims,tot_trip_Rank, capi_tot_trip_intent,tot_trip_capi,capi_errmess); - if (capi_tot_trip_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tot_trip = (int *)(PyArray_DATA(capi_tot_trip_as_array)); - - CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom,"shape(tot_trip, 0) == natom * natom * natom","4th argument tot_trip") { - /* Processing variable f_tensor */ - f_tensor_Dims[0]=ntrip,f_tensor_Dims[1]=3 * natom,f_tensor_Dims[2]=3 * natom,f_tensor_Dims[3]=3 * natom; - capi_f_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the hidden `f_tensor`"; - capi_f_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_tensor_Dims,f_tensor_Rank, capi_f_tensor_intent,Py_None,capi_errmess); - if (capi_f_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f_tensor = (double *)(PyArray_DATA(capi_f_tensor_as_array)); - - /* Processing variable f_rvec2 */ - f_rvec2_Dims[0]=ntrip,f_rvec2_Dims[1]=3; - capi_f_rvec2_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the hidden `f_rvec2`"; - capi_f_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_rvec2_Dims,f_rvec2_Rank, capi_f_rvec2_intent,Py_None,capi_errmess); - if (capi_f_rvec2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f_rvec2 = (double *)(PyArray_DATA(capi_f_rvec2_as_array)); - - /* Processing variable f_rvec3 */ - f_rvec3_Dims[0]=ntrip,f_rvec3_Dims[1]=3; - capi_f_rvec3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the hidden `f_rvec3`"; - capi_f_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_rvec3_Dims,f_rvec3_Rank, capi_f_rvec3_intent,Py_None,capi_errmess); - if (capi_f_rvec3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f_rvec3 = (double *)(PyArray_DATA(capi_f_rvec3_as_array)); - - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 1) / 81; else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.distribute_fc3() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 81 * n_r,"shape(tensor, 1) == 81 * n_r","1st keyword n_r","distribute_fc3:n_r=%d",n_r) { - /* Processing variable rvec2 */ - rvec2_Dims[0]=natom * natom * natom,rvec2_Dims[1]=81 * n_r,rvec2_Dims[2]=3; - capi_rvec2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 2nd argument `rvec2`"; - capi_rvec2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec2_Dims,rvec2_Rank, capi_rvec2_intent,rvec2_capi,capi_errmess); - if (capi_rvec2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rvec2 = (double *)(PyArray_DATA(capi_rvec2_as_array)); - - CHECKARRAY(shape(rvec2, 0) == natom * natom * natom,"shape(rvec2, 0) == natom * natom * natom","2nd argument rvec2") { - /* Processing variable rvec3 */ - rvec3_Dims[0]=natom * natom * natom,rvec3_Dims[1]=81 * n_r,rvec3_Dims[2]=3; - capi_rvec3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.distribute_fc3: failed to create array from the 3rd argument `rvec3`"; - capi_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,rvec3_Dims,rvec3_Rank, capi_rvec3_intent,rvec3_capi,capi_errmess); - if (capi_rvec3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rvec3 = (double *)(PyArray_DATA(capi_rvec3_as_array)); - - CHECKARRAY(shape(rvec3, 0) == natom * natom * natom,"shape(rvec3, 0) == natom * natom * natom","3rd argument rvec3") { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,rvec2,rvec3,tot_trip,f_tensor,f_rvec2,f_rvec3,&itrip,&ntrip,&natom,&n_r); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNNi",capi_f_tensor_as_array,capi_f_rvec2_as_array,capi_f_rvec3_as_array,itrip); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKARRAY(shape(rvec3, 0) == natom * natom * natom)*/ - if((PyObject *)capi_rvec3_as_array!=rvec3_capi) { - Py_XDECREF(capi_rvec3_as_array); } - } /* if (capi_rvec3_as_array == NULL) ... else of rvec3 */ - /* End of cleaning variable rvec3 */ - } /*CHECKARRAY(shape(rvec2, 0) == natom * natom * natom)*/ - if((PyObject *)capi_rvec2_as_array!=rvec2_capi) { - Py_XDECREF(capi_rvec2_as_array); } - } /* if (capi_rvec2_as_array == NULL) ... else of rvec2 */ - /* End of cleaning variable rvec2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 81 * n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - } /* if (capi_f_rvec3_as_array == NULL) ... else of f_rvec3 */ - /* End of cleaning variable f_rvec3 */ - } /* if (capi_f_rvec2_as_array == NULL) ... else of f_rvec2 */ - /* End of cleaning variable f_rvec2 */ - } /* if (capi_f_tensor_as_array == NULL) ... else of f_tensor */ - /* End of cleaning variable f_tensor */ - } /*CHECKARRAY(shape(tot_trip, 0) == natom * natom * natom)*/ - if((PyObject *)capi_tot_trip_as_array!=tot_trip_capi) { - Py_XDECREF(capi_tot_trip_as_array); } - } /* if (capi_tot_trip_as_array == NULL) ... else of tot_trip */ - /* End of cleaning variable tot_trip */ - } /*CHECKARRAY(shape(tensor, 0) == natom * natom * natom)*/ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ - /* End of cleaning variable itrip */ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ - } /*if (f2py_success) of ntrip*/ - /* End of cleaning variable ntrip */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of distribute_fc3 ***************************/ - -/********************************* apply_asr *********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_apply_asr[] = "\ -new_tensor = apply_asr(tensor,r_vector2,r_vector3,[n_r,natom])\n\nWrapper for ``apply_asr``.\ -\n\nParameters\n----------\n" -"tensor : input rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)\n" -"r_vector2 : input rank-2 array('d') with bounds (n_r,3)\n" -"r_vector3 : input rank-2 array('d') with bounds (n_r,3)\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(tensor, 0)\n" -"natom : input int, optional\n Default: shape(tensor, 1) / 3\n" -"\nReturns\n-------\n" -"new_tensor : rank-4 array('d') with bounds (n_r,3 * natom,3 * natom,3 * natom)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_apply_asr(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *tensor = NULL; - npy_intp tensor_Dims[4] = {-1, -1, -1, -1}; - const int tensor_Rank = 4; - PyArrayObject *capi_tensor_as_array = NULL; - int capi_tensor_intent = 0; - PyObject *tensor_capi = Py_None; - double *r_vector2 = NULL; - npy_intp r_vector2_Dims[2] = {-1, -1}; - const int r_vector2_Rank = 2; - PyArrayObject *capi_r_vector2_as_array = NULL; - int capi_r_vector2_intent = 0; - PyObject *r_vector2_capi = Py_None; - double *r_vector3 = NULL; - npy_intp r_vector3_Dims[2] = {-1, -1}; - const int r_vector3_Rank = 2; - PyArrayObject *capi_r_vector3_as_array = NULL; - int capi_r_vector3_intent = 0; - PyObject *r_vector3_capi = Py_None; - double *new_tensor = NULL; - npy_intp new_tensor_Dims[4] = {-1, -1, -1, -1}; - const int new_tensor_Rank = 4; - PyArrayObject *capi_new_tensor_as_array = NULL; - int capi_new_tensor_intent = 0; - int n_r = 0; - PyObject *n_r_capi = Py_None; - int natom = 0; - PyObject *natom_capi = Py_None; - static char *capi_kwlist[] = {"tensor","r_vector2","r_vector3","n_r","natom",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thirdorder.third_order_cond_centering.apply_asr",\ - capi_kwlist,&tensor_capi,&r_vector2_capi,&r_vector3_capi,&n_r_capi,&natom_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable tensor */ - ; - capi_tensor_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the 1st argument `tensor`"; - capi_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,tensor_Dims,tensor_Rank, capi_tensor_intent,tensor_capi,capi_errmess); - if (capi_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tensor = (double *)(PyArray_DATA(capi_tensor_as_array)); - - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(tensor, 0); else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.apply_asr() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 0) == n_r,"shape(tensor, 0) == n_r","1st keyword n_r","apply_asr:n_r=%d",n_r) { - /* Processing variable natom */ - if (natom_capi == Py_None) natom = shape(tensor, 1) / 3; else - f2py_success = int_from_pyobj(&natom,natom_capi,"thirdorder.third_order_cond_centering.apply_asr() 2nd keyword (natom) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(tensor, 1) == 3 * natom,"shape(tensor, 1) == 3 * natom","2nd keyword natom","apply_asr:natom=%d",natom) { - /* Processing variable r_vector2 */ - r_vector2_Dims[0]=n_r,r_vector2_Dims[1]=3; - capi_r_vector2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the 2nd argument `r_vector2`"; - capi_r_vector2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector2_Dims,r_vector2_Rank, capi_r_vector2_intent,r_vector2_capi,capi_errmess); - if (capi_r_vector2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector2 = (double *)(PyArray_DATA(capi_r_vector2_as_array)); - - /* Processing variable r_vector3 */ - r_vector3_Dims[0]=n_r,r_vector3_Dims[1]=3; - capi_r_vector3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the 3rd argument `r_vector3`"; - capi_r_vector3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vector3_Dims,r_vector3_Rank, capi_r_vector3_intent,r_vector3_capi,capi_errmess); - if (capi_r_vector3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vector3 = (double *)(PyArray_DATA(capi_r_vector3_as_array)); - - /* Processing variable new_tensor */ - new_tensor_Dims[0]=n_r,new_tensor_Dims[1]=3 * natom,new_tensor_Dims[2]=3 * natom,new_tensor_Dims[3]=3 * natom; - capi_new_tensor_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.apply_asr: failed to create array from the hidden `new_tensor`"; - capi_new_tensor_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,new_tensor_Dims,new_tensor_Rank, capi_new_tensor_intent,Py_None,capi_errmess); - if (capi_new_tensor_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - new_tensor = (double *)(PyArray_DATA(capi_new_tensor_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(tensor,r_vector2,r_vector3,new_tensor,&n_r,&natom); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_new_tensor_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_new_tensor_as_array == NULL) ... else of new_tensor */ - /* End of cleaning variable new_tensor */ - if((PyObject *)capi_r_vector3_as_array!=r_vector3_capi) { - Py_XDECREF(capi_r_vector3_as_array); } - } /* if (capi_r_vector3_as_array == NULL) ... else of r_vector3 */ - /* End of cleaning variable r_vector3 */ - if((PyObject *)capi_r_vector2_as_array!=r_vector2_capi) { - Py_XDECREF(capi_r_vector2_as_array); } - } /* if (capi_r_vector2_as_array == NULL) ... else of r_vector2 */ - /* End of cleaning variable r_vector2 */ - } /*CHECKSCALAR(shape(tensor, 1) == 3 * natom)*/ - } /*if (f2py_success) of natom*/ - /* End of cleaning variable natom */ - } /*CHECKSCALAR(shape(tensor, 0) == n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - if((PyObject *)capi_tensor_as_array!=tensor_capi) { - Py_XDECREF(capi_tensor_as_array); } - } /* if (capi_tensor_as_array == NULL) ... else of tensor */ - /* End of cleaning variable tensor */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of apply_asr ******************************/ - -/****************************** find_unique_rvec ******************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec[] = "\ -u_rvec3,list,tot_r = find_unique_rvec(r_vec3,[n_r])\n\nWrapper for ``find_unique_rvec``.\ -\n\nParameters\n----------\n" -"r_vec3 : input rank-2 array('d') with bounds (n_r,3)\n" -"\nOther Parameters\n----------------\n" -"n_r : input int, optional\n Default: shape(r_vec3, 0)\n" -"\nReturns\n-------\n" -"u_rvec3 : rank-2 array('d') with bounds (n_r,3)\n" -"list : rank-2 array('i') with bounds (n_r,n_r)\n" -"tot_r : int"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *r_vec3 = NULL; - npy_intp r_vec3_Dims[2] = {-1, -1}; - const int r_vec3_Rank = 2; - PyArrayObject *capi_r_vec3_as_array = NULL; - int capi_r_vec3_intent = 0; - PyObject *r_vec3_capi = Py_None; - double *u_rvec3 = NULL; - npy_intp u_rvec3_Dims[2] = {-1, -1}; - const int u_rvec3_Rank = 2; - PyArrayObject *capi_u_rvec3_as_array = NULL; - int capi_u_rvec3_intent = 0; - int *list = NULL; - npy_intp list_Dims[2] = {-1, -1}; - const int list_Rank = 2; - PyArrayObject *capi_list_as_array = NULL; - int capi_list_intent = 0; - int n_r = 0; - PyObject *n_r_capi = Py_None; - int tot_r = 0; - static char *capi_kwlist[] = {"r_vec3","n_r",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:thirdorder.third_order_cond_centering.find_unique_rvec",\ - capi_kwlist,&r_vec3_capi,&n_r_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable r_vec3 */ - r_vec3_Dims[1]=3; - capi_r_vec3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_unique_rvec: failed to create array from the 1st argument `r_vec3`"; - capi_r_vec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_vec3_Dims,r_vec3_Rank, capi_r_vec3_intent,r_vec3_capi,capi_errmess); - if (capi_r_vec3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r_vec3 = (double *)(PyArray_DATA(capi_r_vec3_as_array)); - - /* Processing variable tot_r */ - /* Processing variable n_r */ - if (n_r_capi == Py_None) n_r = shape(r_vec3, 0); else - f2py_success = int_from_pyobj(&n_r,n_r_capi,"thirdorder.third_order_cond_centering.find_unique_rvec() 1st keyword (n_r) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(r_vec3, 0) == n_r,"shape(r_vec3, 0) == n_r","1st keyword n_r","find_unique_rvec:n_r=%d",n_r) { - /* Processing variable u_rvec3 */ - u_rvec3_Dims[0]=n_r,u_rvec3_Dims[1]=3; - capi_u_rvec3_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_unique_rvec: failed to create array from the hidden `u_rvec3`"; - capi_u_rvec3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_rvec3_Dims,u_rvec3_Rank, capi_u_rvec3_intent,Py_None,capi_errmess); - if (capi_u_rvec3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u_rvec3 = (double *)(PyArray_DATA(capi_u_rvec3_as_array)); - - /* Processing variable list */ - list_Dims[0]=n_r,list_Dims[1]=n_r; - capi_list_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.find_unique_rvec: failed to create array from the hidden `list`"; - capi_list_as_array = ndarray_from_pyobj( NPY_INT,1,list_Dims,list_Rank, capi_list_intent,Py_None,capi_errmess); - if (capi_list_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - list = (int *)(PyArray_DATA(capi_list_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(r_vec3,u_rvec3,list,&n_r,&tot_r); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("NNi",capi_u_rvec3_as_array,capi_list_as_array,tot_r); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_list_as_array == NULL) ... else of list */ - /* End of cleaning variable list */ - } /* if (capi_u_rvec3_as_array == NULL) ... else of u_rvec3 */ - /* End of cleaning variable u_rvec3 */ - } /*CHECKSCALAR(shape(r_vec3, 0) == n_r)*/ - } /*if (f2py_success) of n_r*/ - /* End of cleaning variable n_r */ - /* End of cleaning variable tot_r */ - if((PyObject *)capi_r_vec3_as_array!=r_vec3_capi) { - Py_XDECREF(capi_r_vec3_as_array); } - } /* if (capi_r_vec3_as_array == NULL) ... else of r_vec3 */ - /* End of cleaning variable r_vec3 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of find_unique_rvec **************************/ - -/************************************ norm ************************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_norm[] = "\ -d = norm(r)\n\nWrapper for ``norm``.\ -\n\nParameters\n----------\n" -"r : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"d : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_norm(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double normf2pywrap = 0; - double *r = NULL; - npy_intp r_Dims[1] = {-1}; - const int r_Rank = 1; - PyArrayObject *capi_r_as_array = NULL; - int capi_r_intent = 0; - PyObject *r_capi = Py_None; - static char *capi_kwlist[] = {"r",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thirdorder.third_order_cond_centering.norm",\ - capi_kwlist,&r_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable r */ - r_Dims[0]=3; - capi_r_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.norm: failed to create array from the 1st argument `r`"; - capi_r_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_Dims,r_Rank, capi_r_intent,r_capi,capi_errmess); - if (capi_r_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r = (double *)(PyArray_DATA(capi_r_as_array)); - - /* Processing variable normf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&normf2pywrap,r); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",normf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable normf2pywrap */ - if((PyObject *)capi_r_as_array!=r_capi) { - Py_XDECREF(capi_r_as_array); } - } /* if (capi_r_as_array == NULL) ... else of r */ - /* End of cleaning variable r */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of norm ********************************/ - -/*********************************** norma2 ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_norma2[] = "\ -d = norma2(m)\n\nWrapper for ``norma2``.\ -\n\nParameters\n----------\n" -"m : input rank-2 array('d') with bounds (f2py_m_d0,f2py_m_d1)\n" -"\nReturns\n-------\n" -"d : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_norma2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double norma2f2pywrap = 0; - double *m = NULL; - npy_intp m_Dims[2] = {-1, -1}; - const int m_Rank = 2; - PyArrayObject *capi_m_as_array = NULL; - int capi_m_intent = 0; - PyObject *m_capi = Py_None; - int f2py_m_d0 = 0; - int f2py_m_d1 = 0; - static char *capi_kwlist[] = {"m",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thirdorder.third_order_cond_centering.norma2",\ - capi_kwlist,&m_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable m */ - ; - capi_m_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.norma2: failed to create array from the 1st argument `m`"; - capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); - if (capi_m_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m = (double *)(PyArray_DATA(capi_m_as_array)); - - /* Processing variable norma2f2pywrap */ - /* Processing variable f2py_m_d0 */ - f2py_m_d0 = shape(m, 0); - /* Processing variable f2py_m_d1 */ - f2py_m_d1 = shape(m, 1); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&norma2f2pywrap,m,&f2py_m_d0,&f2py_m_d1); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",norma2f2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_m_d1 */ - /* End of cleaning variable f2py_m_d0 */ - /* End of cleaning variable norma2f2pywrap */ - if((PyObject *)capi_m_as_array!=m_capi) { - Py_XDECREF(capi_m_as_array); } - } /* if (capi_m_as_array == NULL) ... else of m */ - /* End of cleaning variable m */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of norma2 *******************************/ - -/*********************************** norma3 ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_norma3[] = "\ -d = norma3(m)\n\nWrapper for ``norma3``.\ -\n\nParameters\n----------\n" -"m : input rank-3 array('d') with bounds (f2py_m_d0,f2py_m_d1,f2py_m_d2)\n" -"\nReturns\n-------\n" -"d : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_norma3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double norma3f2pywrap = 0; - double *m = NULL; - npy_intp m_Dims[3] = {-1, -1, -1}; - const int m_Rank = 3; - PyArrayObject *capi_m_as_array = NULL; - int capi_m_intent = 0; - PyObject *m_capi = Py_None; - int f2py_m_d0 = 0; - int f2py_m_d1 = 0; - int f2py_m_d2 = 0; - static char *capi_kwlist[] = {"m",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thirdorder.third_order_cond_centering.norma3",\ - capi_kwlist,&m_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable m */ - ; - capi_m_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.norma3: failed to create array from the 1st argument `m`"; - capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); - if (capi_m_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m = (double *)(PyArray_DATA(capi_m_as_array)); - - /* Processing variable norma3f2pywrap */ - /* Processing variable f2py_m_d0 */ - f2py_m_d0 = shape(m, 0); - /* Processing variable f2py_m_d1 */ - f2py_m_d1 = shape(m, 1); - /* Processing variable f2py_m_d2 */ - f2py_m_d2 = shape(m, 2); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&norma3f2pywrap,m,&f2py_m_d0,&f2py_m_d1,&f2py_m_d2); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",norma3f2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_m_d2 */ - /* End of cleaning variable f2py_m_d1 */ - /* End of cleaning variable f2py_m_d0 */ - /* End of cleaning variable norma3f2pywrap */ - if((PyObject *)capi_m_as_array!=m_capi) { - Py_XDECREF(capi_m_as_array); } - } /* if (capi_m_as_array == NULL) ... else of m */ - /* End of cleaning variable m */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of norma3 *******************************/ - -/************************************ dot ************************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_centering_dot[] = "\ -v1 = dot(v,m)\n\nWrapper for ``dot``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('d') with bounds (3)\n" -"m : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"v1 : rank-1 array('d') with bounds (3) and dotf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_centering_dot(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *dotf2pywrap = NULL; - npy_intp dotf2pywrap_Dims[1] = {-1}; - const int dotf2pywrap_Rank = 1; - PyArrayObject *capi_dotf2pywrap_as_array = NULL; - int capi_dotf2pywrap_intent = 0; - double *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - double *m = NULL; - npy_intp m_Dims[2] = {-1, -1}; - const int m_Rank = 2; - PyArrayObject *capi_m_as_array = NULL; - int capi_m_intent = 0; - PyObject *m_capi = Py_None; - static char *capi_kwlist[] = {"v","m",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_cond_centering.dot",\ - capi_kwlist,&v_capi,&m_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - v_Dims[0]=3; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.dot: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (double *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable m */ - m_Dims[0]=3,m_Dims[1]=3; - capi_m_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.dot: failed to create array from the 2nd argument `m`"; - capi_m_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,m_Dims,m_Rank, capi_m_intent,m_capi,capi_errmess); - if (capi_m_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - m = (double *)(PyArray_DATA(capi_m_as_array)); - - /* Processing variable dotf2pywrap */ - dotf2pywrap_Dims[0]=3; - capi_dotf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond_centering.dot: failed to create array from the hidden `dotf2pywrap`"; - capi_dotf2pywrap_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dotf2pywrap_Dims,dotf2pywrap_Rank, capi_dotf2pywrap_intent,Py_None,capi_errmess); - if (capi_dotf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dotf2pywrap = (double *)(PyArray_DATA(capi_dotf2pywrap_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(dotf2pywrap,v,m); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_dotf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_dotf2pywrap_as_array == NULL) ... else of dotf2pywrap */ - /* End of cleaning variable dotf2pywrap */ - if((PyObject *)capi_m_as_array!=m_capi) { - Py_XDECREF(capi_m_as_array); } - } /* if (capi_m_as_array == NULL) ... else of m */ - /* End of cleaning variable m */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************************* end of dot *********************************/ - -/******************************** interpol_v2 ********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_interpol_v2[] = "\ -fc_interp = interpol_v2(fc,r2,r3,pos,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v2``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" -"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"q2 : input rank-1 array('d') with bounds (3)\n" -"q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(fc, 0)\n" -"nat : input int, optional\n Default: shape(fc, 1) / 3\n" -"\nReturns\n-------\n" -"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_interpol_v2(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - PyObject *r3_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *q2 = NULL; - npy_intp q2_Dims[1] = {-1}; - const int q2_Rank = 1; - PyArrayObject *capi_q2_as_array = NULL; - int capi_q2_intent = 0; - PyObject *q2_capi = Py_None; - double *q3 = NULL; - npy_intp q3_Dims[1] = {-1}; - const int q3_Rank = 1; - PyArrayObject *capi_q3_as_array = NULL; - int capi_q3_intent = 0; - PyObject *q3_capi = Py_None; - complex_double *fc_interp = NULL; - npy_intp fc_interp_Dims[3] = {-1, -1, -1}; - const int fc_interp_Rank = 3; - PyArrayObject *capi_fc_interp_as_array = NULL; - int capi_fc_interp_intent = 0; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"fc","r2","r3","pos","q2","q3","n_blocks","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thirdorder.third_order_cond.interpol_v2",\ - capi_kwlist,&fc_capi,&r2_capi,&r3_capi,&pos_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable q2 */ - q2_Dims[0]=3; - capi_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 5th argument `q2`"; - capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); - if (capi_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q2 = (double *)(PyArray_DATA(capi_q2_as_array)); - - /* Processing variable q3 */ - q3_Dims[0]=3; - capi_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 6th argument `q3`"; - capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); - if (capi_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q3 = (double *)(PyArray_DATA(capi_q3_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.interpol_v2() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v2:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_cond.interpol_v2() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v2:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 2nd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_blocks; - capi_r3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 3rd argument `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the 4th argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable fc_interp */ - fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; - capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v2: failed to create array from the hidden `fc_interp`"; - capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); - if (capi_fc_interp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r2,r3,pos,q2,q3,fc_interp,&n_blocks,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ - /* End of cleaning variable fc_interp */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r3_as_array!=r3_capi) { - Py_XDECREF(capi_r3_as_array); } - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_q3_as_array!=q3_capi) { - Py_XDECREF(capi_q3_as_array); } - } /* if (capi_q3_as_array == NULL) ... else of q3 */ - /* End of cleaning variable q3 */ - if((PyObject *)capi_q2_as_array!=q2_capi) { - Py_XDECREF(capi_q2_as_array); } - } /* if (capi_q2_as_array == NULL) ... else of q2 */ - /* End of cleaning variable q2 */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of interpol_v2 *****************************/ - -/******************************** interpol_v3 ********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_interpol_v3[] = "\ -fc_interp = interpol_v3(fc,pos,r2,r3,q1,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol_v3``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('d') with bounds (n_blocks,3 * nat,3 * nat,3 * nat)\n" -"pos : input rank-2 array('d') with bounds (3,nat)\n" -"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"q1 : input rank-1 array('d') with bounds (3)\n" -"q2 : input rank-1 array('d') with bounds (3)\n" -"q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(fc, 0)\n" -"nat : input int, optional\n Default: shape(fc, 1) / 3\n" -"\nReturns\n-------\n" -"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_interpol_v3(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - double *pos = NULL; - npy_intp pos_Dims[2] = {-1, -1}; - const int pos_Rank = 2; - PyArrayObject *capi_pos_as_array = NULL; - int capi_pos_intent = 0; - PyObject *pos_capi = Py_None; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - PyObject *r3_capi = Py_None; - double *q1 = NULL; - npy_intp q1_Dims[1] = {-1}; - const int q1_Rank = 1; - PyArrayObject *capi_q1_as_array = NULL; - int capi_q1_intent = 0; - PyObject *q1_capi = Py_None; - double *q2 = NULL; - npy_intp q2_Dims[1] = {-1}; - const int q2_Rank = 1; - PyArrayObject *capi_q2_as_array = NULL; - int capi_q2_intent = 0; - PyObject *q2_capi = Py_None; - double *q3 = NULL; - npy_intp q3_Dims[1] = {-1}; - const int q3_Rank = 1; - PyArrayObject *capi_q3_as_array = NULL; - int capi_q3_intent = 0; - PyObject *q3_capi = Py_None; - complex_double *fc_interp = NULL; - npy_intp fc_interp_Dims[3] = {-1, -1, -1}; - const int fc_interp_Rank = 3; - PyArrayObject *capi_fc_interp_as_array = NULL; - int capi_fc_interp_intent = 0; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"fc","pos","r2","r3","q1","q2","q3","n_blocks","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|OO:thirdorder.third_order_cond.interpol_v3",\ - capi_kwlist,&fc_capi,&pos_capi,&r2_capi,&r3_capi,&q1_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable q2 */ - q2_Dims[0]=3; - capi_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 6th argument `q2`"; - capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); - if (capi_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q2 = (double *)(PyArray_DATA(capi_q2_as_array)); - - /* Processing variable q3 */ - q3_Dims[0]=3; - capi_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 7th argument `q3`"; - capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); - if (capi_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q3 = (double *)(PyArray_DATA(capi_q3_as_array)); - - /* Processing variable q1 */ - q1_Dims[0]=3; - capi_q1_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 5th argument `q1`"; - capi_q1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q1_Dims,q1_Rank, capi_q1_intent,q1_capi,capi_errmess); - if (capi_q1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q1 = (double *)(PyArray_DATA(capi_q1_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 1) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.interpol_v3() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 1) == 3 * nat,"shape(fc, 1) == 3 * nat","2nd keyword nat","interpol_v3:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 0); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_cond.interpol_v3() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == n_blocks,"shape(fc, 0) == n_blocks","1st keyword n_blocks","interpol_v3:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 3rd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_blocks; - capi_r3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 4th argument `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - - /* Processing variable pos */ - pos_Dims[0]=3,pos_Dims[1]=nat; - capi_pos_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the 2nd argument `pos`"; - capi_pos_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,pos_Dims,pos_Rank, capi_pos_intent,pos_capi,capi_errmess); - if (capi_pos_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pos = (double *)(PyArray_DATA(capi_pos_as_array)); - - /* Processing variable fc_interp */ - fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; - capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.interpol_v3: failed to create array from the hidden `fc_interp`"; - capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); - if (capi_fc_interp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,pos,r2,r3,q1,q2,q3,fc_interp,&n_blocks,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ - /* End of cleaning variable fc_interp */ - if((PyObject *)capi_pos_as_array!=pos_capi) { - Py_XDECREF(capi_pos_as_array); } - } /* if (capi_pos_as_array == NULL) ... else of pos */ - /* End of cleaning variable pos */ - if((PyObject *)capi_r3_as_array!=r3_capi) { - Py_XDECREF(capi_r3_as_array); } - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 0) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 1) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_q1_as_array!=q1_capi) { - Py_XDECREF(capi_q1_as_array); } - } /* if (capi_q1_as_array == NULL) ... else of q1 */ - /* End of cleaning variable q1 */ - if((PyObject *)capi_q3_as_array!=q3_capi) { - Py_XDECREF(capi_q3_as_array); } - } /* if (capi_q3_as_array == NULL) ... else of q3 */ - /* End of cleaning variable q3 */ - if((PyObject *)capi_q2_as_array!=q2_capi) { - Py_XDECREF(capi_q2_as_array); } - } /* if (capi_q2_as_array == NULL) ... else of q2 */ - /* End of cleaning variable q2 */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of interpol_v3 *****************************/ - -/********************* compute_full_dynamic_bubble_single *********************/ -static char doc_f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single[] = "\ -bubble = compute_full_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_full_dynamic_bubble_single``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (n_mod)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"n_mod : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-3 array('D') with bounds (ne,n_mod,n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[3] = {-1, -1, -1}; - const int bubble_Rank = 3; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:thirdorder.third_order_cond.compute_full_dynamic_bubble_single",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.compute_full_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.compute_full_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_full_dynamic_bubble_single:ne=%d",ne) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.compute_full_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_full_dynamic_bubble_single:n_mod=%d",n_mod) { - /* Processing variable bubble */ - bubble_Dims[0]=ne,bubble_Dims[1]=n_mod,bubble_Dims[2]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=n_mod,freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_full_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************** end of compute_full_dynamic_bubble_single *****************/ - -/********************* compute_diag_dynamic_bubble_single *********************/ -static char doc_f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single[] = "\ -bubble = compute_diag_dynamic_bubble_single(energies,sigma,t,freq,is_gamma,d3,gaussian,classical,[ne,n_mod])\n\nWrapper for ``compute_diag_dynamic_bubble_single``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (n_mod)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"n_mod : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-2 array('D') with bounds (ne,n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[2] = {-1, -1}; - const int bubble_Rank = 2; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","gaussian","classical","ne","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OO:thirdorder.third_order_cond.compute_diag_dynamic_bubble_single",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&ne_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.compute_diag_dynamic_bubble_single() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 5th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.compute_diag_dynamic_bubble_single() 2nd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","2nd keyword n_mod","compute_diag_dynamic_bubble_single:n_mod=%d",n_mod) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.compute_diag_dynamic_bubble_single() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_diag_dynamic_bubble_single:ne=%d",ne) { - /* Processing variable bubble */ - bubble_Dims[0]=ne,bubble_Dims[1]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=n_mod,freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 4th argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_diag_dynamic_bubble_single: failed to create array from the 6th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(energies,sigma,&t,freq,is_gamma,d3,&ne,&n_mod,&gaussian,&classical,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************** end of compute_diag_dynamic_bubble_single *****************/ - -/*********************** compute_perturb_selfnrg_single ***********************/ -static char doc_f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single[] = "\ -selfnrg = compute_perturb_selfnrg_single(sigma,t,freq,is_gamma,d3,gaussian,classical,[n_mod])\n\nWrapper for ``compute_perturb_selfnrg_single``.\ -\n\nParameters\n----------\n" -"sigma : input rank-1 array('d') with bounds (n_mod)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"gaussian : input int\n" -"classical : input int\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"selfnrg : rank-1 array('D') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,int*,complex_double*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - int classical = 0; - PyObject *classical_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[1] = {-1}; - const int selfnrg_Rank = 1; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - static char *capi_kwlist[] = {"sigma","t","freq","is_gamma","d3","gaussian","classical","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:thirdorder.third_order_cond.compute_perturb_selfnrg_single",\ - capi_kwlist,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&gaussian_capi,&classical_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 1st argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.compute_perturb_selfnrg_single() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 4th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable classical */ - classical = (int)PyObject_IsTrue(classical_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(sigma, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.compute_perturb_selfnrg_single() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == n_mod,"shape(sigma, 0) == n_mod","1st keyword n_mod","compute_perturb_selfnrg_single:n_mod=%d",n_mod) { - /* Processing variable selfnrg */ - selfnrg_Dims[0]=n_mod; - capi_selfnrg_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the hidden `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,Py_None,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable freq */ - freq_Dims[0]=n_mod,freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 3rd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_perturb_selfnrg_single: failed to create array from the 5th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(sigma,&t,freq,is_gamma,d3,&n_mod,&gaussian,&classical,selfnrg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_selfnrg_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - } /*CHECKSCALAR(shape(sigma, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*if (f2py_success) of classical*/ - /* End of cleaning variable classical */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************* end of compute_perturb_selfnrg_single *******************/ - -/*********************** compute_spectralf_diag_single ***********************/ -static char doc_f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single[] = "\ -spectralf = compute_spectralf_diag_single(sigma,ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``compute_spectralf_diag_single``.\ -\n\nParameters\n----------\n" -"sigma : input rank-1 array('d') with bounds (3 * nat)\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" -"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(sigma, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,complex_double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *d2_freq = NULL; - npy_intp d2_freq_Dims[1] = {-1}; - const int d2_freq_Rank = 1; - PyArrayObject *capi_d2_freq_as_array = NULL; - int capi_d2_freq_intent = 0; - PyObject *d2_freq_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[2] = {-1, -1}; - const int selfnrg_Rank = 2; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - PyObject *selfnrg_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *spectralf = NULL; - npy_intp spectralf_Dims[2] = {-1, -1}; - const int spectralf_Rank = 2; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - static char *capi_kwlist[] = {"sigma","ener","d2_freq","selfnrg","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|OO:thirdorder.third_order_cond.compute_spectralf_diag_single",\ - capi_kwlist,&sigma_capi,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 2nd argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 1st argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.compute_spectralf_diag_single() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf_diag_single:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(sigma, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.compute_spectralf_diag_single() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == 3 * nat,"shape(sigma, 0) == 3 * nat","1st keyword nat","compute_spectralf_diag_single:nat=%d",nat) { - /* Processing variable d2_freq */ - d2_freq_Dims[0]=3 * nat; - capi_d2_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 3rd argument `d2_freq`"; - capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); - if (capi_d2_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); - - /* Processing variable selfnrg */ - selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; - capi_selfnrg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the 4th argument `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.compute_spectralf_diag_single: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(sigma,ener,d2_freq,selfnrg,&nat,&ne,spectralf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { - Py_XDECREF(capi_selfnrg_as_array); } - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { - Py_XDECREF(capi_d2_freq_as_array); } - } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ - /* End of cleaning variable d2_freq */ - } /*CHECKSCALAR(shape(sigma, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of compute_spectralf_diag_single ********************/ - -/*************************** lambda_dynamic_single ***************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single[] = "\ -lambda_out = lambda_dynamic_single(energies,sigma,t,static_limit,w_q2,w_q3,gaussian,[ne])\n\nWrapper for ``lambda_dynamic_single``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input float\n" -"t : input float\n" -"static_limit : input int\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"gaussian : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"\nReturns\n-------\n" -"lambda_out : rank-1 array('D') with bounds (ne)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,int*,double*,double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double sigma = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int static_limit = 0; - PyObject *static_limit_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - complex_double *lambda_out = NULL; - npy_intp lambda_out_Dims[1] = {-1}; - const int lambda_out_Rank = 1; - PyArrayObject *capi_lambda_out_as_array = NULL; - int capi_lambda_out_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","static_limit","w_q2","w_q3","gaussian","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|O:thirdorder.third_order_cond.lambda_dynamic_single",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&static_limit_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable static_limit */ - static_limit = (int)PyObject_IsTrue(static_limit_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - f2py_success = double_from_pyobj(&sigma,sigma_capi,"thirdorder.third_order_cond.lambda_dynamic_single() 2nd argument (sigma) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.lambda_dynamic_single() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the 5th argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the 6th argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.lambda_dynamic_single() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","lambda_dynamic_single:ne=%d",ne) { - /* Processing variable lambda_out */ - lambda_out_Dims[0]=ne; - capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_single: failed to create array from the hidden `lambda_out`"; - capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); - if (capi_lambda_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,energies,&sigma,&t,&static_limit,w_q2,w_q3,&gaussian,lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ - /* End of cleaning variable lambda_out */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of sigma*/ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of static_limit*/ - /* End of cleaning variable static_limit */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of lambda_dynamic_single ************************/ - -/************************ lambda_dynamic_value_single ************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single[] = "\ -lambda_out = lambda_dynamic_value_single(n_mod,value,sigma,t,w_q2,w_q3,gaussian)\n\nWrapper for ``lambda_dynamic_value_single``.\ -\n\nParameters\n----------\n" -"n_mod : input int\n" -"value : input float\n" -"sigma : input float\n" -"t : input float\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"gaussian : input int\n" -"\nReturns\n-------\n" -"lambda_out : complex"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,double*,double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double value = 0; - PyObject *value_capi = Py_None; - double sigma = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - int gaussian = 0; - PyObject *gaussian_capi = Py_None; - complex_double lambda_out; - PyObject *lambda_out_capi = Py_None; - static char *capi_kwlist[] = {"n_mod","value","sigma","t","w_q2","w_q3","gaussian",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOO|:thirdorder.third_order_cond.lambda_dynamic_value_single",\ - capi_kwlist,&n_mod_capi,&value_capi,&sigma_capi,&t_capi,&w_q2_capi,&w_q3_capi,&gaussian_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable lambda_out */ - /* Processing variable n_mod */ - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 1st argument (n_mod) can't be converted to int"); - if (f2py_success) { - /* Processing variable gaussian */ - gaussian = (int)PyObject_IsTrue(gaussian_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable sigma */ - f2py_success = double_from_pyobj(&sigma,sigma_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 3rd argument (sigma) can't be converted to double"); - if (f2py_success) { - /* Processing variable value */ - f2py_success = double_from_pyobj(&value,value_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 2nd argument (value) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.lambda_dynamic_value_single() 4th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_value_single: failed to create array from the 5th argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.lambda_dynamic_value_single: failed to create array from the 6th argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&n_mod,&value,&sigma,&t,w_q2,w_q3,&gaussian,&lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ - lambda_out_capi = pyobj_from_complex_double1(lambda_out); -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",lambda_out_capi); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of value*/ - /* End of cleaning variable value */ - } /*if (f2py_success) of sigma*/ - /* End of cleaning variable sigma */ - } /*if (f2py_success) of gaussian*/ - /* End of cleaning variable gaussian */ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - /* End of cleaning variable lambda_out */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of lambda_dynamic_value_single *********************/ - -/************************ calculate_spectral_function ************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function[] = "\ -spectralf = calculate_spectral_function(ener,d2_freq,selfnrg,[nat,ne])\n\nWrapper for ``calculate_spectral_function``.\ -\n\nParameters\n----------\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" -"selfnrg : input rank-2 array('D') with bounds (ne,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(d2_freq, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-2 array('d') with bounds (ne,3 * nat)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_calculate_spectral_function(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *d2_freq = NULL; - npy_intp d2_freq_Dims[1] = {-1}; - const int d2_freq_Rank = 1; - PyArrayObject *capi_d2_freq_as_array = NULL; - int capi_d2_freq_intent = 0; - PyObject *d2_freq_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[2] = {-1, -1}; - const int selfnrg_Rank = 2; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - PyObject *selfnrg_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - double *spectralf = NULL; - npy_intp spectralf_Dims[2] = {-1, -1}; - const int spectralf_Rank = 2; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - static char *capi_kwlist[] = {"ener","d2_freq","selfnrg","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:thirdorder.third_order_cond.calculate_spectral_function",\ - capi_kwlist,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the 1st argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable d2_freq */ - ; - capi_d2_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the 2nd argument `d2_freq`"; - capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); - if (capi_d2_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.calculate_spectral_function() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(d2_freq, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.calculate_spectral_function() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(d2_freq, 0) == 3 * nat,"shape(d2_freq, 0) == 3 * nat","1st keyword nat","calculate_spectral_function:nat=%d",nat) { - /* Processing variable selfnrg */ - selfnrg_Dims[0]=ne,selfnrg_Dims[1]=3 * nat; - capi_selfnrg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the 3rd argument `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ener,d2_freq,selfnrg,&nat,&ne,spectralf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { - Py_XDECREF(capi_selfnrg_as_array); } - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - } /*CHECKSCALAR(shape(d2_freq, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { - Py_XDECREF(capi_d2_freq_as_array); } - } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ - /* End of cleaning variable d2_freq */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of calculate_spectral_function *********************/ - -/****************** calculate_spectral_function_mode_mixing ******************/ -static char doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing[] = "\ -spectralf = calculate_spectral_function_mode_mixing(ener,smear,wq,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_mode_mixing``.\ -\n\nParameters\n----------\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"wq : input rank-1 array('d') with bounds (3 * nat)\n" -"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" -"notransl : input int\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(smear, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,complex_double*,int*,complex_double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - double *wq = NULL; - npy_intp wq_Dims[1] = {-1}; - const int wq_Rank = 1; - PyArrayObject *capi_wq_as_array = NULL; - int capi_wq_intent = 0; - PyObject *wq_capi = Py_None; - complex_double *pi = NULL; - npy_intp pi_Dims[3] = {-1, -1, -1}; - const int pi_Rank = 3; - PyArrayObject *capi_pi_as_array = NULL; - int capi_pi_intent = 0; - PyObject *pi_capi = Py_None; - int notransl = 0; - PyObject *notransl_capi = Py_None; - complex_double *spectralf = NULL; - npy_intp spectralf_Dims[3] = {-1, -1, -1}; - const int spectralf_Rank = 3; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - static char *capi_kwlist[] = {"ener","smear","wq","pi","notransl","mass","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thirdorder.third_order_cond.calculate_spectral_function_mode_mixing",\ - capi_kwlist,&ener_capi,&smear_capi,&wq_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 1st argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable smear */ - ; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 2nd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable notransl */ - notransl = (int)PyObject_IsTrue(notransl_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.calculate_spectral_function_mode_mixing() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_mode_mixing:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.calculate_spectral_function_mode_mixing() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_mode_mixing:nat=%d",nat) { - /* Processing variable wq */ - wq_Dims[0]=3 * nat; - capi_wq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 3rd argument `wq`"; - capi_wq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,wq_Dims,wq_Rank, capi_wq_intent,wq_capi,capi_errmess); - if (capi_wq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - wq = (double *)(PyArray_DATA(capi_wq_as_array)); - - /* Processing variable pi */ - pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; - capi_pi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 4th argument `pi`"; - capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); - if (capi_pi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); - - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_mode_mixing: failed to create array from the 6th argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ener,smear,wq,pi,¬ransl,spectralf,mass,&nat,&ne); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_pi_as_array!=pi_capi) { - Py_XDECREF(capi_pi_as_array); } - } /* if (capi_pi_as_array == NULL) ... else of pi */ - /* End of cleaning variable pi */ - if((PyObject *)capi_wq_as_array!=wq_capi) { - Py_XDECREF(capi_wq_as_array); } - } /* if (capi_wq_as_array == NULL) ... else of wq */ - /* End of cleaning variable wq */ - } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of notransl*/ - /* End of cleaning variable notransl */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************** end of calculate_spectral_function_mode_mixing ***************/ - -/******************* calculate_spectral_function_cartesian *******************/ -static char doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian[] = "\ -spectralf = calculate_spectral_function_cartesian(ener,smear,d2,pi,notransl,mass,[nat,ne])\n\nWrapper for ``calculate_spectral_function_cartesian``.\ -\n\nParameters\n----------\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"smear : input rank-1 array('d') with bounds (3 * nat)\n" -"d2 : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"pi : input rank-3 array('D') with bounds (ne,3 * nat,3 * nat)\n" -"notransl : input int\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(smear, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-3 array('D') with bounds (3 * nat,3 * nat,ne)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,complex_double*,int*,complex_double*,double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *smear = NULL; - npy_intp smear_Dims[1] = {-1}; - const int smear_Rank = 1; - PyArrayObject *capi_smear_as_array = NULL; - int capi_smear_intent = 0; - PyObject *smear_capi = Py_None; - complex_double *d2 = NULL; - npy_intp d2_Dims[2] = {-1, -1}; - const int d2_Rank = 2; - PyArrayObject *capi_d2_as_array = NULL; - int capi_d2_intent = 0; - PyObject *d2_capi = Py_None; - complex_double *pi = NULL; - npy_intp pi_Dims[3] = {-1, -1, -1}; - const int pi_Rank = 3; - PyArrayObject *capi_pi_as_array = NULL; - int capi_pi_intent = 0; - PyObject *pi_capi = Py_None; - int notransl = 0; - PyObject *notransl_capi = Py_None; - complex_double *spectralf = NULL; - npy_intp spectralf_Dims[3] = {-1, -1, -1}; - const int spectralf_Rank = 3; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - static char *capi_kwlist[] = {"ener","smear","d2","pi","notransl","mass","nat","ne",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thirdorder.third_order_cond.calculate_spectral_function_cartesian",\ - capi_kwlist,&ener_capi,&smear_capi,&d2_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 1st argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable smear */ - ; - capi_smear_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 2nd argument `smear`"; - capi_smear_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_Dims,smear_Rank, capi_smear_intent,smear_capi,capi_errmess); - if (capi_smear_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear = (double *)(PyArray_DATA(capi_smear_as_array)); - - /* Processing variable notransl */ - notransl = (int)PyObject_IsTrue(notransl_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_cond.calculate_spectral_function_cartesian() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","calculate_spectral_function_cartesian:ne=%d",ne) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(smear, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.calculate_spectral_function_cartesian() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(smear, 0) == 3 * nat,"shape(smear, 0) == 3 * nat","1st keyword nat","calculate_spectral_function_cartesian:nat=%d",nat) { - /* Processing variable d2 */ - d2_Dims[0]=3 * nat,d2_Dims[1]=3 * nat; - capi_d2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 3rd argument `d2`"; - capi_d2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d2_Dims,d2_Rank, capi_d2_intent,d2_capi,capi_errmess); - if (capi_d2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2 = (complex_double *)(PyArray_DATA(capi_d2_as_array)); - - /* Processing variable pi */ - pi_Dims[0]=ne,pi_Dims[1]=3 * nat,pi_Dims[2]=3 * nat; - capi_pi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 4th argument `pi`"; - capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); - if (capi_pi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=3 * nat,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=ne; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (complex_double *)(PyArray_DATA(capi_spectralf_as_array)); - - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.calculate_spectral_function_cartesian: failed to create array from the 6th argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ener,smear,d2,pi,¬ransl,spectralf,mass,&nat,&ne); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_pi_as_array!=pi_capi) { - Py_XDECREF(capi_pi_as_array); } - } /* if (capi_pi_as_array == NULL) ... else of pi */ - /* End of cleaning variable pi */ - if((PyObject *)capi_d2_as_array!=d2_capi) { - Py_XDECREF(capi_d2_as_array); } - } /* if (capi_d2_as_array == NULL) ... else of d2 */ - /* End of cleaning variable d2 */ - } /*CHECKSCALAR(shape(smear, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of notransl*/ - /* End of cleaning variable notransl */ - if((PyObject *)capi_smear_as_array!=smear_capi) { - Py_XDECREF(capi_smear_as_array); } - } /* if (capi_smear_as_array == NULL) ... else of smear */ - /* End of cleaning variable smear */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************** end of calculate_spectral_function_cartesian ****************/ - -/********************************* bose_freq *********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_bose_freq[] = "\ -bose = bose_freq(t,freq,[n_mod])\n\nWrapper for ``bose_freq``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"freq : input rank-1 array('d') with bounds (n_mod)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bose : rank-1 array('d') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_bose_freq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - double *bose = NULL; - npy_intp bose_Dims[1] = {-1}; - const int bose_Rank = 1; - PyArrayObject *capi_bose_as_array = NULL; - int capi_bose_intent = 0; - static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thirdorder.third_order_cond.bose_freq",\ - capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.bose_freq() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - ; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.bose_freq: failed to create array from the 2nd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.bose_freq() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","bose_freq:n_mod=%d",n_mod) { - /* Processing variable bose */ - bose_Dims[0]=n_mod; - capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.bose_freq: failed to create array from the hidden `bose`"; - capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); - if (capi_bose_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bose = (double *)(PyArray_DATA(capi_bose_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,&n_mod,freq,bose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_bose_as_array == NULL) ... else of bose */ - /* End of cleaning variable bose */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of bose_freq ******************************/ - -/********************************** eq_freq **********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_eq_freq[] = "\ -bose = eq_freq(t,freq,[n_mod])\n\nWrapper for ``eq_freq``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"freq : input rank-1 array('d') with bounds (n_mod)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bose : rank-1 array('d') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_eq_freq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - double *bose = NULL; - npy_intp bose_Dims[1] = {-1}; - const int bose_Rank = 1; - PyArrayObject *capi_bose_as_array = NULL; - int capi_bose_intent = 0; - static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thirdorder.third_order_cond.eq_freq",\ - capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.eq_freq() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - ; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eq_freq: failed to create array from the 2nd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_cond.eq_freq() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","eq_freq:n_mod=%d",n_mod) { - /* Processing variable bose */ - bose_Dims[0]=n_mod; - capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eq_freq: failed to create array from the hidden `bose`"; - capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); - if (capi_bose_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bose = (double *)(PyArray_DATA(capi_bose_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,&n_mod,freq,bose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_bose_as_array == NULL) ... else of bose */ - /* End of cleaning variable bose */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of eq_freq *******************************/ - -/*********************************** f_bose ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_f_bose[] = "\ -f_bose = f_bose(freq,t)\n\nWrapper for ``f_bose``.\ -\n\nParameters\n----------\n" -"freq : input float\n" -"t : input float\n" -"\nReturns\n-------\n" -"f_bose : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_f_bose(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double f_bosef2pywrap = 0; - double freq = 0; - PyObject *freq_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - static char *capi_kwlist[] = {"freq","t",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_cond.f_bose",\ - capi_kwlist,&freq_capi,&t_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable freq */ - f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_cond.f_bose() 1st argument (freq) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.f_bose() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable f_bosef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&f_bosef2pywrap,&freq,&t); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",f_bosef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f_bosef2pywrap */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of freq*/ - /* End of cleaning variable freq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of f_bose *******************************/ - -/********************************** df_bose **********************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_df_bose[] = "\ -df_bose = df_bose(freq,t)\n\nWrapper for ``df_bose``.\ -\n\nParameters\n----------\n" -"freq : input float\n" -"t : input float\n" -"\nReturns\n-------\n" -"df_bose : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_df_bose(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double df_bosef2pywrap = 0; - double freq = 0; - PyObject *freq_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - static char *capi_kwlist[] = {"freq","t",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_cond.df_bose",\ - capi_kwlist,&freq_capi,&t_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable freq */ - f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_cond.df_bose() 1st argument (freq) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_cond.df_bose() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable df_bosef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&df_bosef2pywrap,&freq,&t); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",df_bosef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable df_bosef2pywrap */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of freq*/ - /* End of cleaning variable freq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of df_bose *******************************/ - -/***************************** gaussian_function *****************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_gaussian_function[] = "\ -gaussian_function = gaussian_function(x,sigma)\n\nWrapper for ``gaussian_function``.\ -\n\nParameters\n----------\n" -"x : input float\n" -"sigma : input float\n" -"\nReturns\n-------\n" -"gaussian_function : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_gaussian_function(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double gaussian_functionf2pywrap = 0; - double x = 0; - PyObject *x_capi = Py_None; - double sigma = 0; - PyObject *sigma_capi = Py_None; - static char *capi_kwlist[] = {"x","sigma",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_cond.gaussian_function",\ - capi_kwlist,&x_capi,&sigma_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - f2py_success = double_from_pyobj(&x,x_capi,"thirdorder.third_order_cond.gaussian_function() 1st argument (x) can't be converted to double"); - if (f2py_success) { - /* Processing variable sigma */ - f2py_success = double_from_pyobj(&sigma,sigma_capi,"thirdorder.third_order_cond.gaussian_function() 2nd argument (sigma) can't be converted to double"); - if (f2py_success) { - /* Processing variable gaussian_functionf2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&gaussian_functionf2pywrap,&x,&sigma); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",gaussian_functionf2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable gaussian_functionf2pywrap */ - } /*if (f2py_success) of sigma*/ - /* End of cleaning variable sigma */ - } /*if (f2py_success) of x*/ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of gaussian_function **************************/ - -/****************************** eliminate_transl ******************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_eliminate_transl[] = "\ -eliminate_transl(a,mass,[nat])\n\nWrapper for ``eliminate_transl``.\ -\n\nParameters\n----------\n" -"a : in/output rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(a, 0) / 3"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_cond_eliminate_transl(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"a","mass","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thirdorder.third_order_cond.eliminate_transl",\ - capi_kwlist,&a_capi,&mass_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eliminate_transl: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (complex_double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(a, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_cond.eliminate_transl() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(a, 0) == 3 * nat,"shape(a, 0) == 3 * nat","1st keyword nat","eliminate_transl:nat=%d",nat) { - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.eliminate_transl: failed to create array from the 2nd argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(a,mass,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /*CHECKSCALAR(shape(a, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of eliminate_transl **************************/ - -/************************************ cinv ************************************/ -static char doc_f2py_rout_thirdorder_third_order_cond_cinv[] = "\ -ainv = cinv(a)\n\nWrapper for ``cinv``.\ -\n\nParameters\n----------\n" -"a : input rank-2 array('D') with bounds (f2py_a_d0,f2py_a_d1)\n" -"\nReturns\n-------\n" -"ainv : rank-2 array('D') with bounds (size(a, 1),size(a, 2)) and cinvf2pywrap storage"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_cond_cinv(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *cinvf2pywrap = NULL; - npy_intp cinvf2pywrap_Dims[2] = {-1, -1}; - const int cinvf2pywrap_Rank = 2; - PyArrayObject *capi_cinvf2pywrap_as_array = NULL; - int capi_cinvf2pywrap_intent = 0; - complex_double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - int f2py_a_d0 = 0; - int f2py_a_d1 = 0; - static char *capi_kwlist[] = {"a",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:thirdorder.third_order_cond.cinv",\ - capi_kwlist,&a_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.cinv: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (complex_double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable cinvf2pywrap */ - cinvf2pywrap_Dims[0]=size(a, 1),cinvf2pywrap_Dims[1]=size(a, 2); - capi_cinvf2pywrap_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_cond.cinv: failed to create array from the hidden `cinvf2pywrap`"; - capi_cinvf2pywrap_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,cinvf2pywrap_Dims,cinvf2pywrap_Rank, capi_cinvf2pywrap_intent,Py_None,capi_errmess); - if (capi_cinvf2pywrap_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - cinvf2pywrap = (complex_double *)(PyArray_DATA(capi_cinvf2pywrap_as_array)); - - /* Processing variable f2py_a_d0 */ - f2py_a_d0 = shape(a, 0); - /* Processing variable f2py_a_d1 */ - f2py_a_d1 = shape(a, 1); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(cinvf2pywrap,a,&f2py_a_d0,&f2py_a_d1); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_cinvf2pywrap_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f2py_a_d1 */ - /* End of cleaning variable f2py_a_d0 */ - } /* if (capi_cinvf2pywrap_as_array == NULL) ... else of cinvf2pywrap */ - /* End of cleaning variable cinvf2pywrap */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of cinv ********************************/ - -/*************************** compute_static_bubble ***************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_compute_static_bubble[] = "\ -bubble = compute_static_bubble(t,freq,is_gamma,d3,[n_mod])\n\nWrapper for ``compute_static_bubble``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-2 array('D') with bounds (n_mod,n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_static_bubble(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,complex_double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[2] = {-1, -1}; - const int bubble_Rank = 2; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"t","freq","is_gamma","d3","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|O:thirdorder.third_order_bubble.compute_static_bubble",\ - capi_kwlist,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_static_bubble() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the 2nd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the 3rd argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_static_bubble() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","compute_static_bubble:n_mod=%d",n_mod) { - /* Processing variable bubble */ - bubble_Dims[0]=n_mod,bubble_Dims[1]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_static_bubble: failed to create array from the 4th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,freq,is_gamma,d3,&n_mod,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of compute_static_bubble ************************/ - -/*************************** compute_dynamic_bubble ***************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble[] = "\ -bubble = compute_dynamic_bubble(energies,sigma,static_limit,t,freq,is_gamma,d3,diag_approx,[ne,nsig,n_mod])\n\nWrapper for ``compute_dynamic_bubble``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (nsig)\n" -"static_limit : input int\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"diag_approx : input int\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nsig : input int, optional\n Default: shape(sigma, 0)\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-4 array('D') with bounds (ne,nsig,n_mod,n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,double*,double*,int*,complex_double*,int*,int*,int*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - int static_limit = 0; - PyObject *static_limit_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int diag_approx = 0; - PyObject *diag_approx_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nsig = 0; - PyObject *nsig_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[4] = {-1, -1, -1, -1}; - const int bubble_Rank = 4; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","static_limit","t","freq","is_gamma","d3","diag_approx","ne","nsig","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|OOO:thirdorder.third_order_bubble.compute_dynamic_bubble",\ - capi_kwlist,&energies_capi,&sigma_capi,&static_limit_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&diag_approx_capi,&ne_capi,&nsig_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 4th argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 5th argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable static_limit */ - static_limit = (int)PyObject_IsTrue(static_limit_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 6th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable diag_approx */ - diag_approx = (int)PyObject_IsTrue(diag_approx_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_dynamic_bubble:ne=%d",ne) { - /* Processing variable nsig */ - if (nsig_capi == Py_None) nsig = shape(sigma, 0); else - f2py_success = int_from_pyobj(&nsig,nsig_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 2nd keyword (nsig) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == nsig,"shape(sigma, 0) == nsig","2nd keyword nsig","compute_dynamic_bubble:nsig=%d",nsig) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_dynamic_bubble() 3rd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","3rd keyword n_mod","compute_dynamic_bubble:n_mod=%d",n_mod) { - /* Processing variable bubble */ - bubble_Dims[0]=ne,bubble_Dims[1]=nsig,bubble_Dims[2]=n_mod,bubble_Dims[3]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_dynamic_bubble: failed to create array from the 7th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(energies,sigma,&static_limit,&t,freq,is_gamma,d3,&diag_approx,&ne,&nsig,&n_mod,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*CHECKSCALAR(shape(sigma, 0) == nsig)*/ - } /*if (f2py_success) of nsig*/ - /* End of cleaning variable nsig */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of diag_approx*/ - /* End of cleaning variable diag_approx */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - } /*if (f2py_success) of static_limit*/ - /* End of cleaning variable static_limit */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of compute_dynamic_bubble ***********************/ - -/************************ compute_diag_dynamic_bubble ************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble[] = "\ -bubble = compute_diag_dynamic_bubble(energies,sigma,t,freq,is_gamma,d3,[ne,nsig,n_mod])\n\nWrapper for ``compute_diag_dynamic_bubble``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (nsig)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nsig : input int, optional\n Default: shape(sigma, 0)\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bubble : rank-3 array('D') with bounds (ne,nsig,n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,double*,double*,double*,int*,complex_double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int nsig = 0; - PyObject *nsig_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - complex_double *bubble = NULL; - npy_intp bubble_Dims[3] = {-1, -1, -1}; - const int bubble_Rank = 3; - PyArrayObject *capi_bubble_as_array = NULL; - int capi_bubble_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","freq","is_gamma","d3","ne","nsig","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OOO:thirdorder.third_order_bubble.compute_diag_dynamic_bubble",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&ne_capi,&nsig_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 4th argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 5th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","compute_diag_dynamic_bubble:ne=%d",ne) { - /* Processing variable nsig */ - if (nsig_capi == Py_None) nsig = shape(sigma, 0); else - f2py_success = int_from_pyobj(&nsig,nsig_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 2nd keyword (nsig) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == nsig,"shape(sigma, 0) == nsig","2nd keyword nsig","compute_diag_dynamic_bubble:nsig=%d",nsig) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_diag_dynamic_bubble() 3rd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","3rd keyword n_mod","compute_diag_dynamic_bubble:n_mod=%d",n_mod) { - /* Processing variable bubble */ - bubble_Dims[0]=ne,bubble_Dims[1]=nsig,bubble_Dims[2]=n_mod; - capi_bubble_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the hidden `bubble`"; - capi_bubble_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,bubble_Dims,bubble_Rank, capi_bubble_intent,Py_None,capi_errmess); - if (capi_bubble_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bubble = (complex_double *)(PyArray_DATA(capi_bubble_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_diag_dynamic_bubble: failed to create array from the 6th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,energies,&nsig,sigma,&t,freq,is_gamma,d3,&n_mod,bubble); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bubble_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - } /* if (capi_bubble_as_array == NULL) ... else of bubble */ - /* End of cleaning variable bubble */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*CHECKSCALAR(shape(sigma, 0) == nsig)*/ - } /*if (f2py_success) of nsig*/ - /* End of cleaning variable nsig */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/********************* end of compute_diag_dynamic_bubble *********************/ - -/************************** compute_perturb_selfnrg **************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg[] = "\ -selfnrg = compute_perturb_selfnrg(sigma,t,freq,is_gamma,d3,[nsig,n_mod])\n\nWrapper for ``compute_perturb_selfnrg``.\ -\n\nParameters\n----------\n" -"sigma : input rank-1 array('d') with bounds (nsig)\n" -"t : input float\n" -"freq : input rank-2 array('d') with bounds (n_mod,3)\n" -"is_gamma : input rank-1 array('i') with bounds (3)\n" -"d3 : input rank-3 array('D') with bounds (n_mod,n_mod,n_mod)\n" -"\nOther Parameters\n----------------\n" -"nsig : input int, optional\n Default: shape(sigma, 0)\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"selfnrg : rank-2 array('D') with bounds (n_mod,nsig)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,double*,double*,int*,complex_double*,int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int nsig = 0; - PyObject *nsig_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[2] = {-1, -1}; - const int freq_Rank = 2; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - int *is_gamma = NULL; - npy_intp is_gamma_Dims[1] = {-1}; - const int is_gamma_Rank = 1; - PyArrayObject *capi_is_gamma_as_array = NULL; - int capi_is_gamma_intent = 0; - PyObject *is_gamma_capi = Py_None; - complex_double *d3 = NULL; - npy_intp d3_Dims[3] = {-1, -1, -1}; - const int d3_Rank = 3; - PyArrayObject *capi_d3_as_array = NULL; - int capi_d3_intent = 0; - PyObject *d3_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[2] = {-1, -1}; - const int selfnrg_Rank = 2; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - static char *capi_kwlist[] = {"sigma","t","freq","is_gamma","d3","nsig","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:thirdorder.third_order_bubble.compute_perturb_selfnrg",\ - capi_kwlist,&sigma_capi,&t_capi,&freq_capi,&is_gamma_capi,&d3_capi,&nsig_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 1st argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.compute_perturb_selfnrg() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - freq_Dims[1]=3; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 3rd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable is_gamma */ - is_gamma_Dims[0]=3; - capi_is_gamma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 4th argument `is_gamma`"; - capi_is_gamma_as_array = ndarray_from_pyobj( NPY_INT,1,is_gamma_Dims,is_gamma_Rank, capi_is_gamma_intent,is_gamma_capi,capi_errmess); - if (capi_is_gamma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - is_gamma = (int *)(PyArray_DATA(capi_is_gamma_as_array)); - - /* Processing variable nsig */ - if (nsig_capi == Py_None) nsig = shape(sigma, 0); else - f2py_success = int_from_pyobj(&nsig,nsig_capi,"thirdorder.third_order_bubble.compute_perturb_selfnrg() 1st keyword (nsig) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == nsig,"shape(sigma, 0) == nsig","1st keyword nsig","compute_perturb_selfnrg:nsig=%d",nsig) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.compute_perturb_selfnrg() 2nd keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","2nd keyword n_mod","compute_perturb_selfnrg:n_mod=%d",n_mod) { - /* Processing variable selfnrg */ - selfnrg_Dims[0]=n_mod,selfnrg_Dims[1]=nsig; - capi_selfnrg_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the hidden `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,Py_None,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable d3 */ - d3_Dims[0]=n_mod,d3_Dims[1]=n_mod,d3_Dims[2]=n_mod; - capi_d3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_perturb_selfnrg: failed to create array from the 5th argument `d3`"; - capi_d3_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d3_Dims,d3_Rank, capi_d3_intent,d3_capi,capi_errmess); - if (capi_d3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d3 = (complex_double *)(PyArray_DATA(capi_d3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&nsig,sigma,&t,freq,is_gamma,d3,&n_mod,selfnrg); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_selfnrg_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_d3_as_array!=d3_capi) { - Py_XDECREF(capi_d3_as_array); } - } /* if (capi_d3_as_array == NULL) ... else of d3 */ - /* End of cleaning variable d3 */ - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*CHECKSCALAR(shape(sigma, 0) == nsig)*/ - } /*if (f2py_success) of nsig*/ - /* End of cleaning variable nsig */ - if((PyObject *)capi_is_gamma_as_array!=is_gamma_capi) { - Py_XDECREF(capi_is_gamma_as_array); } - } /* if (capi_is_gamma_as_array == NULL) ... else of is_gamma */ - /* End of cleaning variable is_gamma */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of compute_perturb_selfnrg ***********************/ - -/***************************** compute_spectralf *****************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf[] = "\ -spectralf = compute_spectralf(smear_id,ener,d2,pi,notransl,mass,[nat,ne,nsmear])\n\nWrapper for ``compute_spectralf``.\ -\n\nParameters\n----------\n" -"smear_id : input rank-1 array('d') with bounds (nsmear)\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"d2 : input rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"pi : input rank-4 array('D') with bounds (ne,nsmear,3 * nat,3 * nat)\n" -"notransl : input int\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(d2, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"nsmear : input int, optional\n Default: shape(smear_id, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-2 array('d') with bounds (ne,nsmear)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_spectralf(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,complex_double*,complex_double*,int*,double*,double*,int*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *smear_id = NULL; - npy_intp smear_id_Dims[1] = {-1}; - const int smear_id_Rank = 1; - PyArrayObject *capi_smear_id_as_array = NULL; - int capi_smear_id_intent = 0; - PyObject *smear_id_capi = Py_None; - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - complex_double *d2 = NULL; - npy_intp d2_Dims[2] = {-1, -1}; - const int d2_Rank = 2; - PyArrayObject *capi_d2_as_array = NULL; - int capi_d2_intent = 0; - PyObject *d2_capi = Py_None; - complex_double *pi = NULL; - npy_intp pi_Dims[4] = {-1, -1, -1, -1}; - const int pi_Rank = 4; - PyArrayObject *capi_pi_as_array = NULL; - int capi_pi_intent = 0; - PyObject *pi_capi = Py_None; - int notransl = 0; - PyObject *notransl_capi = Py_None; - double *spectralf = NULL; - npy_intp spectralf_Dims[2] = {-1, -1}; - const int spectralf_Rank = 2; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nsmear = 0; - PyObject *nsmear_capi = Py_None; - static char *capi_kwlist[] = {"smear_id","ener","d2","pi","notransl","mass","nat","ne","nsmear",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OOO:thirdorder.third_order_bubble.compute_spectralf",\ - capi_kwlist,&smear_id_capi,&ener_capi,&d2_capi,&pi_capi,¬ransl_capi,&mass_capi,&nat_capi,&ne_capi,&nsmear_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 2nd argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable smear_id */ - ; - capi_smear_id_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 1st argument `smear_id`"; - capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); - if (capi_smear_id_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); - - /* Processing variable d2 */ - ; - capi_d2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 3rd argument `d2`"; - capi_d2_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,d2_Dims,d2_Rank, capi_d2_intent,d2_capi,capi_errmess); - if (capi_d2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2 = (complex_double *)(PyArray_DATA(capi_d2_as_array)); - - /* Processing variable notransl */ - notransl = (int)PyObject_IsTrue(notransl_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_spectralf() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf:ne=%d",ne) { - /* Processing variable nsmear */ - if (nsmear_capi == Py_None) nsmear = shape(smear_id, 0); else - f2py_success = int_from_pyobj(&nsmear,nsmear_capi,"thirdorder.third_order_bubble.compute_spectralf() 3rd keyword (nsmear) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(smear_id, 0) == nsmear,"shape(smear_id, 0) == nsmear","3rd keyword nsmear","compute_spectralf:nsmear=%d",nsmear) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(d2, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_bubble.compute_spectralf() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(d2, 0) == 3 * nat,"shape(d2, 0) == 3 * nat","1st keyword nat","compute_spectralf:nat=%d",nat) { - /* Processing variable pi */ - pi_Dims[0]=ne,pi_Dims[1]=nsmear,pi_Dims[2]=3 * nat,pi_Dims[3]=3 * nat; - capi_pi_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 4th argument `pi`"; - capi_pi_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); - if (capi_pi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pi = (complex_double *)(PyArray_DATA(capi_pi_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=ne,spectralf_Dims[1]=nsmear; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); - - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf: failed to create array from the 6th argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(smear_id,ener,d2,pi,¬ransl,spectralf,mass,&nat,&ne,&nsmear); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_pi_as_array!=pi_capi) { - Py_XDECREF(capi_pi_as_array); } - } /* if (capi_pi_as_array == NULL) ... else of pi */ - /* End of cleaning variable pi */ - } /*CHECKSCALAR(shape(d2, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(smear_id, 0) == nsmear)*/ - } /*if (f2py_success) of nsmear*/ - /* End of cleaning variable nsmear */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - } /*if (f2py_success) of notransl*/ - /* End of cleaning variable notransl */ - if((PyObject *)capi_d2_as_array!=d2_capi) { - Py_XDECREF(capi_d2_as_array); } - } /* if (capi_d2_as_array == NULL) ... else of d2 */ - /* End of cleaning variable d2 */ - if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { - Py_XDECREF(capi_smear_id_as_array); } - } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ - /* End of cleaning variable smear_id */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of compute_spectralf **************************/ - -/*************************** compute_spectralf_diag ***************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag[] = "\ -spectralf = compute_spectralf_diag(smear_id,ener,d2_freq,selfnrg,[nat,ne,nsmear])\n\nWrapper for ``compute_spectralf_diag``.\ -\n\nParameters\n----------\n" -"smear_id : input rank-1 array('d') with bounds (nsmear)\n" -"ener : input rank-1 array('d') with bounds (ne)\n" -"d2_freq : input rank-1 array('d') with bounds (3 * nat)\n" -"selfnrg : input rank-3 array('D') with bounds (ne,nsmear,3 * nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(d2_freq, 0) / 3\n" -"ne : input int, optional\n Default: shape(ener, 0)\n" -"nsmear : input int, optional\n Default: shape(smear_id, 0)\n" -"\nReturns\n-------\n" -"spectralf : rank-3 array('d') with bounds (ne,3 * nat,nsmear)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,complex_double*,int*,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *smear_id = NULL; - npy_intp smear_id_Dims[1] = {-1}; - const int smear_id_Rank = 1; - PyArrayObject *capi_smear_id_as_array = NULL; - int capi_smear_id_intent = 0; - PyObject *smear_id_capi = Py_None; - double *ener = NULL; - npy_intp ener_Dims[1] = {-1}; - const int ener_Rank = 1; - PyArrayObject *capi_ener_as_array = NULL; - int capi_ener_intent = 0; - PyObject *ener_capi = Py_None; - double *d2_freq = NULL; - npy_intp d2_freq_Dims[1] = {-1}; - const int d2_freq_Rank = 1; - PyArrayObject *capi_d2_freq_as_array = NULL; - int capi_d2_freq_intent = 0; - PyObject *d2_freq_capi = Py_None; - complex_double *selfnrg = NULL; - npy_intp selfnrg_Dims[3] = {-1, -1, -1}; - const int selfnrg_Rank = 3; - PyArrayObject *capi_selfnrg_as_array = NULL; - int capi_selfnrg_intent = 0; - PyObject *selfnrg_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - int ne = 0; - PyObject *ne_capi = Py_None; - int nsmear = 0; - PyObject *nsmear_capi = Py_None; - double *spectralf = NULL; - npy_intp spectralf_Dims[3] = {-1, -1, -1}; - const int spectralf_Rank = 3; - PyArrayObject *capi_spectralf_as_array = NULL; - int capi_spectralf_intent = 0; - static char *capi_kwlist[] = {"smear_id","ener","d2_freq","selfnrg","nat","ne","nsmear",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|OOO:thirdorder.third_order_bubble.compute_spectralf_diag",\ - capi_kwlist,&smear_id_capi,&ener_capi,&d2_freq_capi,&selfnrg_capi,&nat_capi,&ne_capi,&nsmear_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ener */ - ; - capi_ener_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 2nd argument `ener`"; - capi_ener_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ener_Dims,ener_Rank, capi_ener_intent,ener_capi,capi_errmess); - if (capi_ener_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ener = (double *)(PyArray_DATA(capi_ener_as_array)); - - /* Processing variable smear_id */ - ; - capi_smear_id_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 1st argument `smear_id`"; - capi_smear_id_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,smear_id_Dims,smear_id_Rank, capi_smear_id_intent,smear_id_capi,capi_errmess); - if (capi_smear_id_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - smear_id = (double *)(PyArray_DATA(capi_smear_id_as_array)); - - /* Processing variable d2_freq */ - ; - capi_d2_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 3rd argument `d2_freq`"; - capi_d2_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,d2_freq_Dims,d2_freq_Rank, capi_d2_freq_intent,d2_freq_capi,capi_errmess); - if (capi_d2_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - d2_freq = (double *)(PyArray_DATA(capi_d2_freq_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(ener, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.compute_spectralf_diag() 2nd keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(ener, 0) == ne,"shape(ener, 0) == ne","2nd keyword ne","compute_spectralf_diag:ne=%d",ne) { - /* Processing variable nsmear */ - if (nsmear_capi == Py_None) nsmear = shape(smear_id, 0); else - f2py_success = int_from_pyobj(&nsmear,nsmear_capi,"thirdorder.third_order_bubble.compute_spectralf_diag() 3rd keyword (nsmear) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(smear_id, 0) == nsmear,"shape(smear_id, 0) == nsmear","3rd keyword nsmear","compute_spectralf_diag:nsmear=%d",nsmear) { - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(d2_freq, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_bubble.compute_spectralf_diag() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(d2_freq, 0) == 3 * nat,"shape(d2_freq, 0) == 3 * nat","1st keyword nat","compute_spectralf_diag:nat=%d",nat) { - /* Processing variable selfnrg */ - selfnrg_Dims[0]=ne,selfnrg_Dims[1]=nsmear,selfnrg_Dims[2]=3 * nat; - capi_selfnrg_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the 4th argument `selfnrg`"; - capi_selfnrg_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,selfnrg_Dims,selfnrg_Rank, capi_selfnrg_intent,selfnrg_capi,capi_errmess); - if (capi_selfnrg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - selfnrg = (complex_double *)(PyArray_DATA(capi_selfnrg_as_array)); - - /* Processing variable spectralf */ - spectralf_Dims[0]=ne,spectralf_Dims[1]=3 * nat,spectralf_Dims[2]=nsmear; - capi_spectralf_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.compute_spectralf_diag: failed to create array from the hidden `spectralf`"; - capi_spectralf_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,spectralf_Dims,spectralf_Rank, capi_spectralf_intent,Py_None,capi_errmess); - if (capi_spectralf_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - spectralf = (double *)(PyArray_DATA(capi_spectralf_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(smear_id,ener,d2_freq,selfnrg,&nat,&ne,&nsmear,spectralf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_spectralf_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_spectralf_as_array == NULL) ... else of spectralf */ - /* End of cleaning variable spectralf */ - if((PyObject *)capi_selfnrg_as_array!=selfnrg_capi) { - Py_XDECREF(capi_selfnrg_as_array); } - } /* if (capi_selfnrg_as_array == NULL) ... else of selfnrg */ - /* End of cleaning variable selfnrg */ - } /*CHECKSCALAR(shape(d2_freq, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - } /*CHECKSCALAR(shape(smear_id, 0) == nsmear)*/ - } /*if (f2py_success) of nsmear*/ - /* End of cleaning variable nsmear */ - } /*CHECKSCALAR(shape(ener, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_d2_freq_as_array!=d2_freq_capi) { - Py_XDECREF(capi_d2_freq_as_array); } - } /* if (capi_d2_freq_as_array == NULL) ... else of d2_freq */ - /* End of cleaning variable d2_freq */ - if((PyObject *)capi_smear_id_as_array!=smear_id_capi) { - Py_XDECREF(capi_smear_id_as_array); } - } /* if (capi_smear_id_as_array == NULL) ... else of smear_id */ - /* End of cleaning variable smear_id */ - if((PyObject *)capi_ener_as_array!=ener_capi) { - Py_XDECREF(capi_ener_as_array); } - } /* if (capi_ener_as_array == NULL) ... else of ener */ - /* End of cleaning variable ener */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of compute_spectralf_diag ***********************/ - -/*********************************** lambda ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_lambda[] = "\ -lambda_out = lambda(t,w_q2,w_q3)\n\nWrapper for ``lambda``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"\nReturns\n-------\n" -"lambda_out : float"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_lambda(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - double lambda_out = 0; - static char *capi_kwlist[] = {"t","w_q2","w_q3",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:thirdorder.third_order_bubble.lambda",\ - capi_kwlist,&t_capi,&w_q2_capi,&w_q3_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable lambda_out */ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.lambda() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda: failed to create array from the 2nd argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda: failed to create array from the 3rd argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,w_q2,w_q3,&lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",lambda_out); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - /* End of cleaning variable lambda_out */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of lambda *******************************/ - -/******************************* lambda_dynamic *******************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic[] = "\ -lambda_out = lambda_dynamic(energies,sigma,t,static_limit,w_q2,w_q3,[ne,nsigma])\n\nWrapper for ``lambda_dynamic``.\ -\n\nParameters\n----------\n" -"energies : input rank-1 array('d') with bounds (ne)\n" -"sigma : input rank-1 array('d') with bounds (nsigma)\n" -"t : input float\n" -"static_limit : input int\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"ne : input int, optional\n Default: shape(energies, 0)\n" -"nsigma : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"lambda_out : rank-2 array('D') with bounds (ne,nsigma)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_lambda_dynamic(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,double*,double*,int*,double*,double*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int ne = 0; - PyObject *ne_capi = Py_None; - double *energies = NULL; - npy_intp energies_Dims[1] = {-1}; - const int energies_Rank = 1; - PyArrayObject *capi_energies_as_array = NULL; - int capi_energies_intent = 0; - PyObject *energies_capi = Py_None; - int nsigma = 0; - PyObject *nsigma_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - int static_limit = 0; - PyObject *static_limit_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - complex_double *lambda_out = NULL; - npy_intp lambda_out_Dims[2] = {-1, -1}; - const int lambda_out_Rank = 2; - PyArrayObject *capi_lambda_out_as_array = NULL; - int capi_lambda_out_intent = 0; - static char *capi_kwlist[] = {"energies","sigma","t","static_limit","w_q2","w_q3","ne","nsigma",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|OO:thirdorder.third_order_bubble.lambda_dynamic",\ - capi_kwlist,&energies_capi,&sigma_capi,&t_capi,&static_limit_capi,&w_q2_capi,&w_q3_capi,&ne_capi,&nsigma_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable static_limit */ - static_limit = (int)PyObject_IsTrue(static_limit_capi); - f2py_success = 1; - if (f2py_success) { - /* Processing variable energies */ - ; - capi_energies_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 1st argument `energies`"; - capi_energies_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,energies_Dims,energies_Rank, capi_energies_intent,energies_capi,capi_errmess); - if (capi_energies_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - energies = (double *)(PyArray_DATA(capi_energies_as_array)); - - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.lambda_dynamic() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 5th argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the 6th argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - - /* Processing variable ne */ - if (ne_capi == Py_None) ne = shape(energies, 0); else - f2py_success = int_from_pyobj(&ne,ne_capi,"thirdorder.third_order_bubble.lambda_dynamic() 1st keyword (ne) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(energies, 0) == ne,"shape(energies, 0) == ne","1st keyword ne","lambda_dynamic:ne=%d",ne) { - /* Processing variable nsigma */ - if (nsigma_capi == Py_None) nsigma = shape(sigma, 0); else - f2py_success = int_from_pyobj(&nsigma,nsigma_capi,"thirdorder.third_order_bubble.lambda_dynamic() 2nd keyword (nsigma) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == nsigma,"shape(sigma, 0) == nsigma","2nd keyword nsigma","lambda_dynamic:nsigma=%d",nsigma) { - /* Processing variable lambda_out */ - lambda_out_Dims[0]=ne,lambda_out_Dims[1]=nsigma; - capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic: failed to create array from the hidden `lambda_out`"; - capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); - if (capi_lambda_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&ne,energies,&nsigma,sigma,&t,&static_limit,w_q2,w_q3,lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ - /* End of cleaning variable lambda_out */ - } /*CHECKSCALAR(shape(sigma, 0) == nsigma)*/ - } /*if (f2py_success) of nsigma*/ - /* End of cleaning variable nsigma */ - } /*CHECKSCALAR(shape(energies, 0) == ne)*/ - } /*if (f2py_success) of ne*/ - /* End of cleaning variable ne */ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ - if((PyObject *)capi_energies_as_array!=energies_capi) { - Py_XDECREF(capi_energies_as_array); } - } /* if (capi_energies_as_array == NULL) ... else of energies */ - /* End of cleaning variable energies */ - } /*if (f2py_success) of static_limit*/ - /* End of cleaning variable static_limit */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of lambda_dynamic ***************************/ - -/**************************** lambda_dynamic_value ****************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value[] = "\ -lambda_out = lambda_dynamic_value(value,sigma,t,w_q2,w_q3,[n_mod,nsigma])\n\nWrapper for ``lambda_dynamic_value``.\ -\n\nParameters\n----------\n" -"value : input rank-1 array('d') with bounds (n_mod)\n" -"sigma : input rank-1 array('d') with bounds (nsigma)\n" -"t : input float\n" -"w_q2 : input rank-1 array('d') with bounds (3)\n" -"w_q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(value, 0)\n" -"nsigma : input int, optional\n Default: shape(sigma, 0)\n" -"\nReturns\n-------\n" -"lambda_out : rank-2 array('D') with bounds (n_mod,nsigma)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,double*,int*,double*,double*,double*,double*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double *value = NULL; - npy_intp value_Dims[1] = {-1}; - const int value_Rank = 1; - PyArrayObject *capi_value_as_array = NULL; - int capi_value_intent = 0; - PyObject *value_capi = Py_None; - int nsigma = 0; - PyObject *nsigma_capi = Py_None; - double *sigma = NULL; - npy_intp sigma_Dims[1] = {-1}; - const int sigma_Rank = 1; - PyArrayObject *capi_sigma_as_array = NULL; - int capi_sigma_intent = 0; - PyObject *sigma_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - double *w_q2 = NULL; - npy_intp w_q2_Dims[1] = {-1}; - const int w_q2_Rank = 1; - PyArrayObject *capi_w_q2_as_array = NULL; - int capi_w_q2_intent = 0; - PyObject *w_q2_capi = Py_None; - double *w_q3 = NULL; - npy_intp w_q3_Dims[1] = {-1}; - const int w_q3_Rank = 1; - PyArrayObject *capi_w_q3_as_array = NULL; - int capi_w_q3_intent = 0; - PyObject *w_q3_capi = Py_None; - complex_double *lambda_out = NULL; - npy_intp lambda_out_Dims[2] = {-1, -1}; - const int lambda_out_Rank = 2; - PyArrayObject *capi_lambda_out_as_array = NULL; - int capi_lambda_out_intent = 0; - static char *capi_kwlist[] = {"value","sigma","t","w_q2","w_q3","n_mod","nsigma",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:thirdorder.third_order_bubble.lambda_dynamic_value",\ - capi_kwlist,&value_capi,&sigma_capi,&t_capi,&w_q2_capi,&w_q3_capi,&n_mod_capi,&nsigma_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable sigma */ - ; - capi_sigma_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 2nd argument `sigma`"; - capi_sigma_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,sigma_Dims,sigma_Rank, capi_sigma_intent,sigma_capi,capi_errmess); - if (capi_sigma_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - sigma = (double *)(PyArray_DATA(capi_sigma_as_array)); - - /* Processing variable value */ - ; - capi_value_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 1st argument `value`"; - capi_value_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,value_Dims,value_Rank, capi_value_intent,value_capi,capi_errmess); - if (capi_value_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - value = (double *)(PyArray_DATA(capi_value_as_array)); - - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.lambda_dynamic_value() 3rd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable w_q2 */ - w_q2_Dims[0]=3; - capi_w_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 4th argument `w_q2`"; - capi_w_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q2_Dims,w_q2_Rank, capi_w_q2_intent,w_q2_capi,capi_errmess); - if (capi_w_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q2 = (double *)(PyArray_DATA(capi_w_q2_as_array)); - - /* Processing variable w_q3 */ - w_q3_Dims[0]=3; - capi_w_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the 5th argument `w_q3`"; - capi_w_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,w_q3_Dims,w_q3_Rank, capi_w_q3_intent,w_q3_capi,capi_errmess); - if (capi_w_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w_q3 = (double *)(PyArray_DATA(capi_w_q3_as_array)); - - /* Processing variable nsigma */ - if (nsigma_capi == Py_None) nsigma = shape(sigma, 0); else - f2py_success = int_from_pyobj(&nsigma,nsigma_capi,"thirdorder.third_order_bubble.lambda_dynamic_value() 2nd keyword (nsigma) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(sigma, 0) == nsigma,"shape(sigma, 0) == nsigma","2nd keyword nsigma","lambda_dynamic_value:nsigma=%d",nsigma) { - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(value, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.lambda_dynamic_value() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(value, 0) == n_mod,"shape(value, 0) == n_mod","1st keyword n_mod","lambda_dynamic_value:n_mod=%d",n_mod) { - /* Processing variable lambda_out */ - lambda_out_Dims[0]=n_mod,lambda_out_Dims[1]=nsigma; - capi_lambda_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.lambda_dynamic_value: failed to create array from the hidden `lambda_out`"; - capi_lambda_out_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,lambda_out_Dims,lambda_out_Rank, capi_lambda_out_intent,Py_None,capi_errmess); - if (capi_lambda_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lambda_out = (complex_double *)(PyArray_DATA(capi_lambda_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&n_mod,value,&nsigma,sigma,&t,w_q2,w_q3,lambda_out); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_lambda_out_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_lambda_out_as_array == NULL) ... else of lambda_out */ - /* End of cleaning variable lambda_out */ - } /*CHECKSCALAR(shape(value, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - } /*CHECKSCALAR(shape(sigma, 0) == nsigma)*/ - } /*if (f2py_success) of nsigma*/ - /* End of cleaning variable nsigma */ - if((PyObject *)capi_w_q3_as_array!=w_q3_capi) { - Py_XDECREF(capi_w_q3_as_array); } - } /* if (capi_w_q3_as_array == NULL) ... else of w_q3 */ - /* End of cleaning variable w_q3 */ - if((PyObject *)capi_w_q2_as_array!=w_q2_capi) { - Py_XDECREF(capi_w_q2_as_array); } - } /* if (capi_w_q2_as_array == NULL) ... else of w_q2 */ - /* End of cleaning variable w_q2 */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - if((PyObject *)capi_value_as_array!=value_capi) { - Py_XDECREF(capi_value_as_array); } - } /* if (capi_value_as_array == NULL) ... else of value */ - /* End of cleaning variable value */ - if((PyObject *)capi_sigma_as_array!=sigma_capi) { - Py_XDECREF(capi_sigma_as_array); } - } /* if (capi_sigma_as_array == NULL) ... else of sigma */ - /* End of cleaning variable sigma */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of lambda_dynamic_value ************************/ - -/********************************* bose_freq *********************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_bose_freq[] = "\ -bose = bose_freq(t,freq,[n_mod])\n\nWrapper for ``bose_freq``.\ -\n\nParameters\n----------\n" -"t : input float\n" -"freq : input rank-1 array('d') with bounds (n_mod)\n" -"\nOther Parameters\n----------------\n" -"n_mod : input int, optional\n Default: shape(freq, 0)\n" -"\nReturns\n-------\n" -"bose : rank-1 array('d') with bounds (n_mod)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_bose_freq(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double t = 0; - PyObject *t_capi = Py_None; - int n_mod = 0; - PyObject *n_mod_capi = Py_None; - double *freq = NULL; - npy_intp freq_Dims[1] = {-1}; - const int freq_Rank = 1; - PyArrayObject *capi_freq_as_array = NULL; - int capi_freq_intent = 0; - PyObject *freq_capi = Py_None; - double *bose = NULL; - npy_intp bose_Dims[1] = {-1}; - const int bose_Rank = 1; - PyArrayObject *capi_bose_as_array = NULL; - int capi_bose_intent = 0; - static char *capi_kwlist[] = {"t","freq","n_mod",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thirdorder.third_order_bubble.bose_freq",\ - capi_kwlist,&t_capi,&freq_capi,&n_mod_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.bose_freq() 1st argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable freq */ - ; - capi_freq_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.bose_freq: failed to create array from the 2nd argument `freq`"; - capi_freq_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,freq_Dims,freq_Rank, capi_freq_intent,freq_capi,capi_errmess); - if (capi_freq_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - freq = (double *)(PyArray_DATA(capi_freq_as_array)); - - /* Processing variable n_mod */ - if (n_mod_capi == Py_None) n_mod = shape(freq, 0); else - f2py_success = int_from_pyobj(&n_mod,n_mod_capi,"thirdorder.third_order_bubble.bose_freq() 1st keyword (n_mod) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(freq, 0) == n_mod,"shape(freq, 0) == n_mod","1st keyword n_mod","bose_freq:n_mod=%d",n_mod) { - /* Processing variable bose */ - bose_Dims[0]=n_mod; - capi_bose_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.bose_freq: failed to create array from the hidden `bose`"; - capi_bose_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bose_Dims,bose_Rank, capi_bose_intent,Py_None,capi_errmess); - if (capi_bose_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bose = (double *)(PyArray_DATA(capi_bose_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&t,&n_mod,freq,bose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_bose_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_bose_as_array == NULL) ... else of bose */ - /* End of cleaning variable bose */ - } /*CHECKSCALAR(shape(freq, 0) == n_mod)*/ - } /*if (f2py_success) of n_mod*/ - /* End of cleaning variable n_mod */ - if((PyObject *)capi_freq_as_array!=freq_capi) { - Py_XDECREF(capi_freq_as_array); } - } /* if (capi_freq_as_array == NULL) ... else of freq */ - /* End of cleaning variable freq */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of bose_freq ******************************/ - -/*********************************** f_bose ***********************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_f_bose[] = "\ -f_bose = f_bose(freq,t)\n\nWrapper for ``f_bose``.\ -\n\nParameters\n----------\n" -"freq : input float\n" -"t : input float\n" -"\nReturns\n-------\n" -"f_bose : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_f_bose(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double f_bosef2pywrap = 0; - double freq = 0; - PyObject *freq_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - static char *capi_kwlist[] = {"freq","t",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_bubble.f_bose",\ - capi_kwlist,&freq_capi,&t_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable freq */ - f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_bubble.f_bose() 1st argument (freq) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.f_bose() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable f_bosef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&f_bosef2pywrap,&freq,&t); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",f_bosef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable f_bosef2pywrap */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of freq*/ - /* End of cleaning variable freq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of f_bose *******************************/ - -/********************************** df_bose **********************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_df_bose[] = "\ -df_bose = df_bose(freq,t)\n\nWrapper for ``df_bose``.\ -\n\nParameters\n----------\n" -"freq : input float\n" -"t : input float\n" -"\nReturns\n-------\n" -"df_bose : float"; -/* #declfortranroutine# */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_df_bose(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double df_bosef2pywrap = 0; - double freq = 0; - PyObject *freq_capi = Py_None; - double t = 0; - PyObject *t_capi = Py_None; - static char *capi_kwlist[] = {"freq","t",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:thirdorder.third_order_bubble.df_bose",\ - capi_kwlist,&freq_capi,&t_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable freq */ - f2py_success = double_from_pyobj(&freq,freq_capi,"thirdorder.third_order_bubble.df_bose() 1st argument (freq) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - f2py_success = double_from_pyobj(&t,t_capi,"thirdorder.third_order_bubble.df_bose() 2nd argument (t) can't be converted to double"); - if (f2py_success) { - /* Processing variable df_bosef2pywrap */ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&df_bosef2pywrap,&freq,&t); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",df_bosef2pywrap); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable df_bosef2pywrap */ - } /*if (f2py_success) of t*/ - /* End of cleaning variable t */ - } /*if (f2py_success) of freq*/ - /* End of cleaning variable freq */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of df_bose *******************************/ - -/********************************** invzmat **********************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_invzmat[] = "\ -invzmat(a,[n])\n\nWrapper for ``invzmat``.\ -\n\nParameters\n----------\n" -"a : in/output rank-2 array('D') with bounds (n,n)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(a, 0)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_invzmat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int*,complex_double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int n = 0; - PyObject *n_capi = Py_None; - complex_double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - static char *capi_kwlist[] = {"a","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|O:thirdorder.third_order_bubble.invzmat",\ - capi_kwlist,&a_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.invzmat: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (complex_double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(a, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"thirdorder.third_order_bubble.invzmat() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(a, 0) == n,"shape(a, 0) == n","1st keyword n","invzmat:n=%d",n) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(&n,a); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(a, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of invzmat *******************************/ - -/****************************** eliminate_transl ******************************/ -static char doc_f2py_rout_thirdorder_third_order_bubble_eliminate_transl[] = "\ -eliminate_transl(a,mass,[nat])\n\nWrapper for ``eliminate_transl``.\ -\n\nParameters\n----------\n" -"a : in/output rank-2 array('D') with bounds (3 * nat,3 * nat)\n" -"mass : input rank-1 array('d') with bounds (nat)\n" -"\nOther Parameters\n----------------\n" -"nat : input int, optional\n Default: shape(a, 0) / 3"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_bubble_eliminate_transl(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *a = NULL; - npy_intp a_Dims[2] = {-1, -1}; - const int a_Rank = 2; - PyArrayObject *capi_a_as_array = NULL; - int capi_a_intent = 0; - PyObject *a_capi = Py_None; - double *mass = NULL; - npy_intp mass_Dims[1] = {-1}; - const int mass_Rank = 1; - PyArrayObject *capi_mass_as_array = NULL; - int capi_mass_intent = 0; - PyObject *mass_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"a","mass","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:thirdorder.third_order_bubble.eliminate_transl",\ - capi_kwlist,&a_capi,&mass_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable a */ - ; - capi_a_intent |= F2PY_INTENT_INOUT; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.eliminate_transl: failed to create array from the 1st argument `a`"; - capi_a_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,a_Dims,a_Rank, capi_a_intent,a_capi,capi_errmess); - if (capi_a_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - a = (complex_double *)(PyArray_DATA(capi_a_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(a, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_bubble.eliminate_transl() 1st keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(a, 0) == 3 * nat,"shape(a, 0) == 3 * nat","1st keyword nat","eliminate_transl:nat=%d",nat) { - /* Processing variable mass */ - mass_Dims[0]=nat; - capi_mass_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_bubble.eliminate_transl: failed to create array from the 2nd argument `mass`"; - capi_mass_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,mass_Dims,mass_Rank, capi_mass_intent,mass_capi,capi_errmess); - if (capi_mass_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mass = (double *)(PyArray_DATA(capi_mass_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(a,mass,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_mass_as_array!=mass_capi) { - Py_XDECREF(capi_mass_as_array); } - } /* if (capi_mass_as_array == NULL) ... else of mass */ - /* End of cleaning variable mass */ - } /*CHECKSCALAR(shape(a, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_a_as_array!=a_capi) { - Py_XDECREF(capi_a_as_array); } - } /* if (capi_a_as_array == NULL) ... else of a */ - /* End of cleaning variable a */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of eliminate_transl **************************/ - -/********************************** interpol **********************************/ -static char doc_f2py_rout_thirdorder_third_order_interpol_interpol[] = "\ -fc_interp = interpol(fc,r2,r3,q2,q3,[n_blocks,nat])\n\nWrapper for ``interpol``.\ -\n\nParameters\n----------\n" -"fc : input rank-4 array('D') with bounds (3 * nat,3 * nat,3 * nat,n_blocks)\n" -"r2 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"r3 : input rank-2 array('d') with bounds (3,n_blocks)\n" -"q2 : input rank-1 array('d') with bounds (3)\n" -"q3 : input rank-1 array('d') with bounds (3)\n" -"\nOther Parameters\n----------------\n" -"n_blocks : input int, optional\n Default: shape(fc, 3)\n" -"nat : input int, optional\n Default: shape(fc, 0) / 3\n" -"\nReturns\n-------\n" -"fc_interp : rank-3 array('D') with bounds (3 * nat,3 * nat,3 * nat)"; -/* */ -static PyObject *f2py_rout_thirdorder_third_order_interpol_interpol(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(complex_double*,double*,double*,double*,double*,complex_double*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - complex_double *fc = NULL; - npy_intp fc_Dims[4] = {-1, -1, -1, -1}; - const int fc_Rank = 4; - PyArrayObject *capi_fc_as_array = NULL; - int capi_fc_intent = 0; - PyObject *fc_capi = Py_None; - double *r2 = NULL; - npy_intp r2_Dims[2] = {-1, -1}; - const int r2_Rank = 2; - PyArrayObject *capi_r2_as_array = NULL; - int capi_r2_intent = 0; - PyObject *r2_capi = Py_None; - double *r3 = NULL; - npy_intp r3_Dims[2] = {-1, -1}; - const int r3_Rank = 2; - PyArrayObject *capi_r3_as_array = NULL; - int capi_r3_intent = 0; - PyObject *r3_capi = Py_None; - double *q2 = NULL; - npy_intp q2_Dims[1] = {-1}; - const int q2_Rank = 1; - PyArrayObject *capi_q2_as_array = NULL; - int capi_q2_intent = 0; - PyObject *q2_capi = Py_None; - double *q3 = NULL; - npy_intp q3_Dims[1] = {-1}; - const int q3_Rank = 1; - PyArrayObject *capi_q3_as_array = NULL; - int capi_q3_intent = 0; - PyObject *q3_capi = Py_None; - complex_double *fc_interp = NULL; - npy_intp fc_interp_Dims[3] = {-1, -1, -1}; - const int fc_interp_Rank = 3; - PyArrayObject *capi_fc_interp_as_array = NULL; - int capi_fc_interp_intent = 0; - int n_blocks = 0; - PyObject *n_blocks_capi = Py_None; - int nat = 0; - PyObject *nat_capi = Py_None; - static char *capi_kwlist[] = {"fc","r2","r3","q2","q3","n_blocks","nat",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|OO:thirdorder.third_order_interpol.interpol",\ - capi_kwlist,&fc_capi,&r2_capi,&r3_capi,&q2_capi,&q3_capi,&n_blocks_capi,&nat_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable fc */ - ; - capi_fc_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 1st argument `fc`"; - capi_fc_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_Dims,fc_Rank, capi_fc_intent,fc_capi,capi_errmess); - if (capi_fc_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc = (complex_double *)(PyArray_DATA(capi_fc_as_array)); - - /* Processing variable q2 */ - q2_Dims[0]=3; - capi_q2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 4th argument `q2`"; - capi_q2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q2_Dims,q2_Rank, capi_q2_intent,q2_capi,capi_errmess); - if (capi_q2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q2 = (double *)(PyArray_DATA(capi_q2_as_array)); - - /* Processing variable q3 */ - q3_Dims[0]=3; - capi_q3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 5th argument `q3`"; - capi_q3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,q3_Dims,q3_Rank, capi_q3_intent,q3_capi,capi_errmess); - if (capi_q3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - q3 = (double *)(PyArray_DATA(capi_q3_as_array)); - - /* Processing variable nat */ - if (nat_capi == Py_None) nat = shape(fc, 0) / 3; else - f2py_success = int_from_pyobj(&nat,nat_capi,"thirdorder.third_order_interpol.interpol() 2nd keyword (nat) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 0) == 3 * nat,"shape(fc, 0) == 3 * nat","2nd keyword nat","interpol:nat=%d",nat) { - /* Processing variable n_blocks */ - if (n_blocks_capi == Py_None) n_blocks = shape(fc, 3); else - f2py_success = int_from_pyobj(&n_blocks,n_blocks_capi,"thirdorder.third_order_interpol.interpol() 1st keyword (n_blocks) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(fc, 3) == n_blocks,"shape(fc, 3) == n_blocks","1st keyword n_blocks","interpol:n_blocks=%d",n_blocks) { - /* Processing variable r2 */ - r2_Dims[0]=3,r2_Dims[1]=n_blocks; - capi_r2_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 2nd argument `r2`"; - capi_r2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r2_Dims,r2_Rank, capi_r2_intent,r2_capi,capi_errmess); - if (capi_r2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r2 = (double *)(PyArray_DATA(capi_r2_as_array)); - - /* Processing variable r3 */ - r3_Dims[0]=3,r3_Dims[1]=n_blocks; - capi_r3_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the 3rd argument `r3`"; - capi_r3_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r3_Dims,r3_Rank, capi_r3_intent,r3_capi,capi_errmess); - if (capi_r3_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r3 = (double *)(PyArray_DATA(capi_r3_as_array)); - - /* Processing variable fc_interp */ - fc_interp_Dims[0]=3 * nat,fc_interp_Dims[1]=3 * nat,fc_interp_Dims[2]=3 * nat; - capi_fc_interp_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE; - const char * capi_errmess = "thirdorder.thirdorder.third_order_interpol.interpol: failed to create array from the hidden `fc_interp`"; - capi_fc_interp_as_array = ndarray_from_pyobj( NPY_CDOUBLE,1,fc_interp_Dims,fc_interp_Rank, capi_fc_interp_intent,Py_None,capi_errmess); - if (capi_fc_interp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = thirdorder_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - fc_interp = (complex_double *)(PyArray_DATA(capi_fc_interp_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(fc,r2,r3,q2,q3,fc_interp,&n_blocks,&nat); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_fc_interp_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /* if (capi_fc_interp_as_array == NULL) ... else of fc_interp */ - /* End of cleaning variable fc_interp */ - if((PyObject *)capi_r3_as_array!=r3_capi) { - Py_XDECREF(capi_r3_as_array); } - } /* if (capi_r3_as_array == NULL) ... else of r3 */ - /* End of cleaning variable r3 */ - if((PyObject *)capi_r2_as_array!=r2_capi) { - Py_XDECREF(capi_r2_as_array); } - } /* if (capi_r2_as_array == NULL) ... else of r2 */ - /* End of cleaning variable r2 */ - } /*CHECKSCALAR(shape(fc, 3) == n_blocks)*/ - } /*if (f2py_success) of n_blocks*/ - /* End of cleaning variable n_blocks */ - } /*CHECKSCALAR(shape(fc, 0) == 3 * nat)*/ - } /*if (f2py_success) of nat*/ - /* End of cleaning variable nat */ - if((PyObject *)capi_q3_as_array!=q3_capi) { - Py_XDECREF(capi_q3_as_array); } - } /* if (capi_q3_as_array == NULL) ... else of q3 */ - /* End of cleaning variable q3 */ - if((PyObject *)capi_q2_as_array!=q2_capi) { - Py_XDECREF(capi_q2_as_array); } - } /* if (capi_q2_as_array == NULL) ... else of q2 */ - /* End of cleaning variable q2 */ - if((PyObject *)capi_fc_as_array!=fc_capi) { - Py_XDECREF(capi_fc_as_array); } - } /* if (capi_fc_as_array == NULL) ... else of fc */ - /* End of cleaning variable fc */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of interpol ******************************/ -/*eof body*/ - -/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ - -static FortranDataDef f2py_third_order_asr_def[] = { - {"perm_initialized",0,{{-1}},NPY_INT, 1}, - {"p",2,{{-1,-1}},NPY_INT, 1}, - {"r2index_initialized",0,{{-1}},NPY_INT, 1}, - {"index_blocks_r2",2,{{-1,-1}},NPY_INT, 1}, - {"num_blocks_r2",1,{{-1}},NPY_INT, 1}, - {"initialize_r2index",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_initialize_r2index,doc_f2py_rout_thirdorder_third_order_asr_initialize_r2index}, - {"initialize_perm",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_initialize_perm,doc_f2py_rout_thirdorder_third_order_asr_initialize_perm}, - {"geq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_geq,doc_f2py_rout_thirdorder_third_order_asr_geq}, - {"f",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_f,doc_f2py_rout_thirdorder_third_order_asr_f}, - {"impose_perm_sym",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_impose_perm_sym,doc_f2py_rout_thirdorder_third_order_asr_impose_perm_sym}, - {"impose_asr_3rd",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_impose_asr_3rd,doc_f2py_rout_thirdorder_third_order_asr_impose_asr_3rd}, - {"impose_asr",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_asr_impose_asr,doc_f2py_rout_thirdorder_third_order_asr_impose_asr}, - {NULL} -}; - -static void f2py_setup_third_order_asr(char *perm_initialized,void (*p)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *r2index_initialized,void (*index_blocks_r2)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),void (*num_blocks_r2)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *initialize_r2index,char *initialize_perm,char *geq,char *f,char *impose_perm_sym,char *impose_asr_3rd,char *impose_asr) { - int i_f2py=0; - f2py_third_order_asr_def[i_f2py++].data = perm_initialized; - f2py_third_order_asr_def[i_f2py++].func = p; - f2py_third_order_asr_def[i_f2py++].data = r2index_initialized; - f2py_third_order_asr_def[i_f2py++].func = index_blocks_r2; - f2py_third_order_asr_def[i_f2py++].func = num_blocks_r2; - f2py_third_order_asr_def[i_f2py++].data = initialize_r2index; - f2py_third_order_asr_def[i_f2py++].data = initialize_perm; - f2py_third_order_asr_def[i_f2py++].data = geq; - f2py_third_order_asr_def[i_f2py++].data = f; - f2py_third_order_asr_def[i_f2py++].data = impose_perm_sym; - f2py_third_order_asr_def[i_f2py++].data = impose_asr_3rd; - f2py_third_order_asr_def[i_f2py++].data = impose_asr; -} -extern void F_FUNC_US(f2pyinitthird_order_asr,F2PYINITTHIRD_ORDER_ASR)(void (*)(char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char*,void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*),char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_asr(void) { - F_FUNC_US(f2pyinitthird_order_asr,F2PYINITTHIRD_ORDER_ASR)(f2py_setup_third_order_asr); -} - - -static FortranDataDef f2py_third_order_centering_def[] = { - {"analysis",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_analysis,doc_f2py_rout_thirdorder_third_order_centering_analysis}, - {"center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_center,doc_f2py_rout_thirdorder_third_order_centering_center}, - {"center_sparse",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_center_sparse,doc_f2py_rout_thirdorder_third_order_centering_center_sparse}, - {"pre_center",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_pre_center,doc_f2py_rout_thirdorder_third_order_centering_pre_center}, - {"assign",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_assign,doc_f2py_rout_thirdorder_third_order_centering_assign}, - {"within_dmax",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_within_dmax,doc_f2py_rout_thirdorder_third_order_centering_within_dmax}, - {"compute_perimeter",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_compute_perimeter,doc_f2py_rout_thirdorder_third_order_centering_compute_perimeter}, - {"three_to_one_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_three_to_one_len,doc_f2py_rout_thirdorder_third_order_centering_three_to_one_len}, - {"three_to_one",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_three_to_one,doc_f2py_rout_thirdorder_third_order_centering_three_to_one}, - {"one_to_three_len",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_one_to_three_len,doc_f2py_rout_thirdorder_third_order_centering_one_to_three_len}, - {"one_to_three",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_one_to_three,doc_f2py_rout_thirdorder_third_order_centering_one_to_three}, - {"min_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_min_el_wise_2,doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_2}, - {"max_el_wise_2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_max_el_wise_2,doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_2}, - {"min_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_min_el_wise_3,doc_f2py_rout_thirdorder_third_order_centering_min_el_wise_3}, - {"max_el_wise_3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_max_el_wise_3,doc_f2py_rout_thirdorder_third_order_centering_max_el_wise_3}, - {"cryst_to_cart",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_centering_cryst_to_cart,doc_f2py_rout_thirdorder_third_order_centering_cryst_to_cart}, - {NULL} -}; - -static void f2py_setup_third_order_centering(char *analysis,char *center,char *center_sparse,char *pre_center,char *assign,char *within_dmax,char *compute_perimeter,char *three_to_one_len,char *three_to_one,char *one_to_three_len,char *one_to_three,char *min_el_wise_2,char *max_el_wise_2,char *min_el_wise_3,char *max_el_wise_3,char *cryst_to_cart) { - int i_f2py=0; - f2py_third_order_centering_def[i_f2py++].data = analysis; - f2py_third_order_centering_def[i_f2py++].data = center; - f2py_third_order_centering_def[i_f2py++].data = center_sparse; - f2py_third_order_centering_def[i_f2py++].data = pre_center; - f2py_third_order_centering_def[i_f2py++].data = assign; - f2py_third_order_centering_def[i_f2py++].data = within_dmax; - f2py_third_order_centering_def[i_f2py++].data = compute_perimeter; - f2py_third_order_centering_def[i_f2py++].data = three_to_one_len; - f2py_third_order_centering_def[i_f2py++].data = three_to_one; - f2py_third_order_centering_def[i_f2py++].data = one_to_three_len; - f2py_third_order_centering_def[i_f2py++].data = one_to_three; - f2py_third_order_centering_def[i_f2py++].data = min_el_wise_2; - f2py_third_order_centering_def[i_f2py++].data = max_el_wise_2; - f2py_third_order_centering_def[i_f2py++].data = min_el_wise_3; - f2py_third_order_centering_def[i_f2py++].data = max_el_wise_3; - f2py_third_order_centering_def[i_f2py++].data = cryst_to_cart; -} -extern void F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_centering(void) { - F_FUNC_US(f2pyinitthird_order_centering,F2PYINITTHIRD_ORDER_CENTERING)(f2py_setup_third_order_centering); -} - - -static FortranDataDef f2py_third_order_cond_centering_def[] = { - {"check_permutation_symmetry",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry,doc_f2py_rout_thirdorder_third_order_cond_centering_check_permutation_symmetry}, - {"apply_permutation_symmetry",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry,doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry}, - {"apply_permutation_symmetry_local",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local,doc_f2py_rout_thirdorder_third_order_cond_centering_apply_permutation_symmetry_local}, - {"number_of_triplets",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets,doc_f2py_rout_thirdorder_third_order_cond_centering_number_of_triplets}, - {"find_triplets",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_find_triplets,doc_f2py_rout_thirdorder_third_order_cond_centering_find_triplets}, - {"distribute_fc3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3,doc_f2py_rout_thirdorder_third_order_cond_centering_distribute_fc3}, - {"apply_asr",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_apply_asr,doc_f2py_rout_thirdorder_third_order_cond_centering_apply_asr}, - {"find_unique_rvec",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec,doc_f2py_rout_thirdorder_third_order_cond_centering_find_unique_rvec}, - {"norm",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_norm,doc_f2py_rout_thirdorder_third_order_cond_centering_norm}, - {"norma2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_norma2,doc_f2py_rout_thirdorder_third_order_cond_centering_norma2}, - {"norma3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_norma3,doc_f2py_rout_thirdorder_third_order_cond_centering_norma3}, - {"dot",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_centering_dot,doc_f2py_rout_thirdorder_third_order_cond_centering_dot}, - {NULL} -}; - -static void f2py_setup_third_order_cond_centering(char *check_permutation_symmetry,char *apply_permutation_symmetry,char *apply_permutation_symmetry_local,char *number_of_triplets,char *find_triplets,char *distribute_fc3,char *apply_asr,char *find_unique_rvec,char *norm,char *norma2,char *norma3,char *dot) { - int i_f2py=0; - f2py_third_order_cond_centering_def[i_f2py++].data = check_permutation_symmetry; - f2py_third_order_cond_centering_def[i_f2py++].data = apply_permutation_symmetry; - f2py_third_order_cond_centering_def[i_f2py++].data = apply_permutation_symmetry_local; - f2py_third_order_cond_centering_def[i_f2py++].data = number_of_triplets; - f2py_third_order_cond_centering_def[i_f2py++].data = find_triplets; - f2py_third_order_cond_centering_def[i_f2py++].data = distribute_fc3; - f2py_third_order_cond_centering_def[i_f2py++].data = apply_asr; - f2py_third_order_cond_centering_def[i_f2py++].data = find_unique_rvec; - f2py_third_order_cond_centering_def[i_f2py++].data = norm; - f2py_third_order_cond_centering_def[i_f2py++].data = norma2; - f2py_third_order_cond_centering_def[i_f2py++].data = norma3; - f2py_third_order_cond_centering_def[i_f2py++].data = dot; -} -extern void F_FUNC_US(f2pyinitthird_order_cond_centering,F2PYINITTHIRD_ORDER_COND_CENTERING)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_cond_centering(void) { - F_FUNC_US(f2pyinitthird_order_cond_centering,F2PYINITTHIRD_ORDER_COND_CENTERING)(f2py_setup_third_order_cond_centering); -} - - -static FortranDataDef f2py_third_order_cond_def[] = { - {"interpol_v2",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_interpol_v2,doc_f2py_rout_thirdorder_third_order_cond_interpol_v2}, - {"interpol_v3",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_interpol_v3,doc_f2py_rout_thirdorder_third_order_cond_interpol_v3}, - {"compute_full_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single,doc_f2py_rout_thirdorder_third_order_cond_compute_full_dynamic_bubble_single}, - {"compute_diag_dynamic_bubble_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single,doc_f2py_rout_thirdorder_third_order_cond_compute_diag_dynamic_bubble_single}, - {"compute_perturb_selfnrg_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single,doc_f2py_rout_thirdorder_third_order_cond_compute_perturb_selfnrg_single}, - {"compute_spectralf_diag_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single,doc_f2py_rout_thirdorder_third_order_cond_compute_spectralf_diag_single}, - {"lambda_dynamic_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single,doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_single}, - {"lambda_dynamic_value_single",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single,doc_f2py_rout_thirdorder_third_order_cond_lambda_dynamic_value_single}, - {"calculate_spectral_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_calculate_spectral_function,doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function}, - {"calculate_spectral_function_mode_mixing",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing,doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_mode_mixing}, - {"calculate_spectral_function_cartesian",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian,doc_f2py_rout_thirdorder_third_order_cond_calculate_spectral_function_cartesian}, - {"bose_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_bose_freq,doc_f2py_rout_thirdorder_third_order_cond_bose_freq}, - {"eq_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_eq_freq,doc_f2py_rout_thirdorder_third_order_cond_eq_freq}, - {"f_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_f_bose,doc_f2py_rout_thirdorder_third_order_cond_f_bose}, - {"df_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_df_bose,doc_f2py_rout_thirdorder_third_order_cond_df_bose}, - {"gaussian_function",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_gaussian_function,doc_f2py_rout_thirdorder_third_order_cond_gaussian_function}, - {"eliminate_transl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_eliminate_transl,doc_f2py_rout_thirdorder_third_order_cond_eliminate_transl}, - {"cinv",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_cond_cinv,doc_f2py_rout_thirdorder_third_order_cond_cinv}, - {NULL} -}; - -static void f2py_setup_third_order_cond(char *interpol_v2,char *interpol_v3,char *compute_full_dynamic_bubble_single,char *compute_diag_dynamic_bubble_single,char *compute_perturb_selfnrg_single,char *compute_spectralf_diag_single,char *lambda_dynamic_single,char *lambda_dynamic_value_single,char *calculate_spectral_function,char *calculate_spectral_function_mode_mixing,char *calculate_spectral_function_cartesian,char *bose_freq,char *eq_freq,char *f_bose,char *df_bose,char *gaussian_function,char *eliminate_transl,char *cinv) { - int i_f2py=0; - f2py_third_order_cond_def[i_f2py++].data = interpol_v2; - f2py_third_order_cond_def[i_f2py++].data = interpol_v3; - f2py_third_order_cond_def[i_f2py++].data = compute_full_dynamic_bubble_single; - f2py_third_order_cond_def[i_f2py++].data = compute_diag_dynamic_bubble_single; - f2py_third_order_cond_def[i_f2py++].data = compute_perturb_selfnrg_single; - f2py_third_order_cond_def[i_f2py++].data = compute_spectralf_diag_single; - f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_single; - f2py_third_order_cond_def[i_f2py++].data = lambda_dynamic_value_single; - f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function; - f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_mode_mixing; - f2py_third_order_cond_def[i_f2py++].data = calculate_spectral_function_cartesian; - f2py_third_order_cond_def[i_f2py++].data = bose_freq; - f2py_third_order_cond_def[i_f2py++].data = eq_freq; - f2py_third_order_cond_def[i_f2py++].data = f_bose; - f2py_third_order_cond_def[i_f2py++].data = df_bose; - f2py_third_order_cond_def[i_f2py++].data = gaussian_function; - f2py_third_order_cond_def[i_f2py++].data = eliminate_transl; - f2py_third_order_cond_def[i_f2py++].data = cinv; -} -extern void F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_cond(void) { - F_FUNC_US(f2pyinitthird_order_cond,F2PYINITTHIRD_ORDER_COND)(f2py_setup_third_order_cond); -} - - -static FortranDataDef f2py_third_order_bubble_def[] = { - {"compute_static_bubble",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_static_bubble,doc_f2py_rout_thirdorder_third_order_bubble_compute_static_bubble}, - {"compute_dynamic_bubble",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble,doc_f2py_rout_thirdorder_third_order_bubble_compute_dynamic_bubble}, - {"compute_diag_dynamic_bubble",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble,doc_f2py_rout_thirdorder_third_order_bubble_compute_diag_dynamic_bubble}, - {"compute_perturb_selfnrg",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg,doc_f2py_rout_thirdorder_third_order_bubble_compute_perturb_selfnrg}, - {"compute_spectralf",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_spectralf,doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf}, - {"compute_spectralf_diag",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag,doc_f2py_rout_thirdorder_third_order_bubble_compute_spectralf_diag}, - {"lambda",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_lambda,doc_f2py_rout_thirdorder_third_order_bubble_lambda}, - {"lambda_dynamic",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_lambda_dynamic,doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic}, - {"lambda_dynamic_value",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value,doc_f2py_rout_thirdorder_third_order_bubble_lambda_dynamic_value}, - {"bose_freq",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_bose_freq,doc_f2py_rout_thirdorder_third_order_bubble_bose_freq}, - {"f_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_f_bose,doc_f2py_rout_thirdorder_third_order_bubble_f_bose}, - {"df_bose",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_df_bose,doc_f2py_rout_thirdorder_third_order_bubble_df_bose}, - {"invzmat",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_invzmat,doc_f2py_rout_thirdorder_third_order_bubble_invzmat}, - {"eliminate_transl",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_bubble_eliminate_transl,doc_f2py_rout_thirdorder_third_order_bubble_eliminate_transl}, - {NULL} -}; - -static void f2py_setup_third_order_bubble(char *compute_static_bubble,char *compute_dynamic_bubble,char *compute_diag_dynamic_bubble,char *compute_perturb_selfnrg,char *compute_spectralf,char *compute_spectralf_diag,char *lambda,char *lambda_dynamic,char *lambda_dynamic_value,char *bose_freq,char *f_bose,char *df_bose,char *invzmat,char *eliminate_transl) { - int i_f2py=0; - f2py_third_order_bubble_def[i_f2py++].data = compute_static_bubble; - f2py_third_order_bubble_def[i_f2py++].data = compute_dynamic_bubble; - f2py_third_order_bubble_def[i_f2py++].data = compute_diag_dynamic_bubble; - f2py_third_order_bubble_def[i_f2py++].data = compute_perturb_selfnrg; - f2py_third_order_bubble_def[i_f2py++].data = compute_spectralf; - f2py_third_order_bubble_def[i_f2py++].data = compute_spectralf_diag; - f2py_third_order_bubble_def[i_f2py++].data = lambda; - f2py_third_order_bubble_def[i_f2py++].data = lambda_dynamic; - f2py_third_order_bubble_def[i_f2py++].data = lambda_dynamic_value; - f2py_third_order_bubble_def[i_f2py++].data = bose_freq; - f2py_third_order_bubble_def[i_f2py++].data = f_bose; - f2py_third_order_bubble_def[i_f2py++].data = df_bose; - f2py_third_order_bubble_def[i_f2py++].data = invzmat; - f2py_third_order_bubble_def[i_f2py++].data = eliminate_transl; -} -extern void F_FUNC_US(f2pyinitthird_order_bubble,F2PYINITTHIRD_ORDER_BUBBLE)(void (*)(char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *,char *)); -static void f2py_init_third_order_bubble(void) { - F_FUNC_US(f2pyinitthird_order_bubble,F2PYINITTHIRD_ORDER_BUBBLE)(f2py_setup_third_order_bubble); -} - - -static FortranDataDef f2py_third_order_interpol_def[] = { - {"interpol",-1,{{-1}},0,0,NULL,(void *)f2py_rout_thirdorder_third_order_interpol_interpol,doc_f2py_rout_thirdorder_third_order_interpol_interpol}, - {NULL} -}; - -static void f2py_setup_third_order_interpol(char *interpol) { - int i_f2py=0; - f2py_third_order_interpol_def[i_f2py++].data = interpol; -} -extern void F_FUNC_US(f2pyinitthird_order_interpol,F2PYINITTHIRD_ORDER_INTERPOL)(void (*)(char *)); -static void f2py_init_third_order_interpol(void) { - F_FUNC_US(f2pyinitthird_order_interpol,F2PYINITTHIRD_ORDER_INTERPOL)(f2py_setup_third_order_interpol); -} - -/*need_f90modhooks*/ - -/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ - -/******************* See f2py2e/common_rules.py: buildhooks *******************/ - -/*need_commonhooks*/ - -/**************************** See f2py2e/rules.py ****************************/ - -static FortranDataDef f2py_routine_defs[] = { - -/*eof routine_defs*/ - {NULL} -}; - -static PyMethodDef f2py_module_methods[] = { - - {NULL,NULL} -}; - -static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "thirdorder", - NULL, - -1, - f2py_module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit_thirdorder(void) { - int i; - PyObject *m,*d, *s, *tmp; - m = thirdorder_module = PyModule_Create(&moduledef); - Py_SET_TYPE(&PyFortran_Type, &PyType_Type); - import_array(); - if (PyErr_Occurred()) - {PyErr_SetString(PyExc_ImportError, "can't initialize module thirdorder (failed to import numpy)"); return m;} - d = PyModule_GetDict(m); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__version__", s); - Py_DECREF(s); - s = PyUnicode_FromString( - "This module 'thirdorder' is auto-generated with f2py (version:1.26.4).\nFunctions:\n" -"Fortran 90/95 modules:\n"" third_order_asr --- perm_initialized,p,r2index_initialized,index_blocks_r2,num_blocks_r2,initialize_r2index(),initialize_perm(),geq(),f(),impose_perm_sym(),impose_asr_3rd(),impose_asr()"" third_order_centering --- analysis(),center(),center_sparse(),pre_center(),assign(),within_dmax(),compute_perimeter(),three_to_one_len(),three_to_one(),one_to_three_len(),one_to_three(),min_el_wise_2(),max_el_wise_2(),min_el_wise_3(),max_el_wise_3(),cryst_to_cart()"" third_order_cond_centering --- check_permutation_symmetry(),apply_permutation_symmetry(),apply_permutation_symmetry_local(),number_of_triplets(),find_triplets(),distribute_fc3(),apply_asr(),find_unique_rvec(),norm(),norma2(),norma3(),dot()"" third_order_cond --- interpol_v2(),interpol_v3(),compute_full_dynamic_bubble_single(),compute_diag_dynamic_bubble_single(),compute_perturb_selfnrg_single(),compute_spectralf_diag_single(),lambda_dynamic_single(),lambda_dynamic_value_single(),calculate_spectral_function(),calculate_spectral_function_mode_mixing(),calculate_spectral_function_cartesian(),bose_freq(),eq_freq(),f_bose(),df_bose(),gaussian_function(),eliminate_transl(),cinv()"" third_order_bubble --- compute_static_bubble(),compute_dynamic_bubble(),compute_diag_dynamic_bubble(),compute_perturb_selfnrg(),compute_spectralf(),compute_spectralf_diag(),lambda(),lambda_dynamic(),lambda_dynamic_value(),bose_freq(),f_bose(),df_bose(),invzmat(),eliminate_transl()"" third_order_interpol --- interpol()""."); - PyDict_SetItemString(d, "__doc__", s); - Py_DECREF(s); - s = PyUnicode_FromString("1.26.4"); - PyDict_SetItemString(d, "__f2py_numpy_version__", s); - Py_DECREF(s); - thirdorder_error = PyErr_NewException ("thirdorder.error", NULL, NULL); - /* - * Store the error object inside the dict, so that it could get deallocated. - * (in practice, this is a module, so it likely will not and cannot.) - */ - PyDict_SetItemString(d, "_thirdorder_error", thirdorder_error); - Py_DECREF(thirdorder_error); - for(i=0;f2py_routine_defs[i].name!=NULL;i++) { - tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); - PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); - Py_DECREF(tmp); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/*eof initf2pywraphooks*/ - PyDict_SetItemString(d, "third_order_interpol", PyFortranObject_New(f2py_third_order_interpol_def,f2py_init_third_order_interpol)); - PyDict_SetItemString(d, "third_order_bubble", PyFortranObject_New(f2py_third_order_bubble_def,f2py_init_third_order_bubble)); - PyDict_SetItemString(d, "third_order_cond", PyFortranObject_New(f2py_third_order_cond_def,f2py_init_third_order_cond)); - PyDict_SetItemString(d, "third_order_cond_centering", PyFortranObject_New(f2py_third_order_cond_centering_def,f2py_init_third_order_cond_centering)); - PyDict_SetItemString(d, "third_order_centering", PyFortranObject_New(f2py_third_order_centering_def,f2py_init_third_order_centering)); - PyDict_SetItemString(d, "third_order_asr", PyFortranObject_New(f2py_third_order_asr_def,f2py_init_third_order_asr)); -/*eof initf90modhooks*/ - -/*eof initcommonhooks*/ - - -#ifdef F2PY_REPORT_ATEXIT - if (! PyErr_Occurred()) - on_exit(f2py_report_on_exit,(void*)"thirdorder"); -#endif - return m; -} -#ifdef __cplusplus -} -#endif diff --git a/meson.build.old_100 b/meson.build.old_100 deleted file mode 100644 index 282ab935..00000000 --- a/meson.build.old_100 +++ /dev/null @@ -1,230 +0,0 @@ -project('CellConstructor', - ['c','fortran'], - version: '1.5.0', - license: 'GPL', - default_options : [ - 'warning_level=1', - 'buildtype=release', - 'fortran_args=-O2', - 'fortran_args=-cpp' - ] - ) - -# --- System and Python Dependencies --- -# Encuentra las instalaciones necesarias -py = import('python').find_installation(pure: false) -py_dep = py.dependency() -fc = meson.get_compiler('fortran') - -# Dependencias adicionales -#mpi_dep = dependency('mpi') -# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. -lapack_dep = dependency('lapack') -blas_dep = dependency('blas') - -# --- MPI Detection --- -# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). -# Meson has a built-in MPI module. -mpi_args = [] -mpi_link_args = [] -mpi_compile_args = [] -has_mpi = false - -# Attempts to find the MPI dependency. -# You can specify a specific MPI compiler with the 'mpi_compiler' parameter -# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. -# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. -#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) -mpi_dep = dependency('mpi', required: false) - -if mpi_dep.found() - message('MPI environment detected correctly.') - has_mpi = true - # Meson handles adding appropriate flags. We just add the define. - # If you need specific MPI flags beyond what Meson adds automatically, - # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() - # and add them to extra_compile_args/extra_link_args. - mpi_compile_args += ['-D_MPI'] -else - # Here you can add warning logic if MPI is not found. - # Meson prints a warning if required: true and it is not found. - # For required: false, you can print your own warning. - warning('No MPI compiler found, please ensure MPI is installed and configured.') - warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') -endif -# Busca la librería quadmath, si está disponible -quadmath_dep = fc.find_library('quadmath', required: false) - -# --- CONFIGURACIÓN DE NUMPY --- -# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python -incdir_numpy = run_command(py, - ['-c', 'import numpy; print(numpy.get_include())'], - check : true -).stdout().strip() - -# f2py también requiere la cabecera fortranobject.h -incdir_f2py = run_command(py, - ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], - check : true -).stdout().strip() - -inc_np = include_directories(incdir_numpy, incdir_f2py) -# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' - -# Compilación del módulo Fortran: symph -fortran_sources_symph = [ - 'FModules/constants.f90', - 'FModules/error_handler.f90', - 'FModules/get_latvec.f90', - 'FModules/io_global.f90', - 'FModules/rotate_and_add_dyn.f90', - 'FModules/smallgq.f90', - 'FModules/symm_matrix.f90', - 'FModules/contract_two_phonon_propagator.f90', - 'FModules/fc_supercell_from_dyn.f90', - 'FModules/get_q_grid_fast.f90', - 'FModules/kind.f90', - 'FModules/star_q.f90', - 'FModules/symvector.f90', - 'FModules/cryst_to_car.f90', - 'FModules/flush_unit.f90', - 'FModules/get_translations.f90', - 'FModules/q2qstar_out.f90', - 'FModules/set_asr.f90', - 'FModules/symdynph_gq_new.f90', - 'FModules/trntnsc.f90', - 'FModules/eff_charge_interp.f90', - 'FModules/from_matdyn.f90', - 'FModules/interp.f90', - 'FModules/q_gen.f90', - 'FModules/set_tau.f90', - 'FModules/symm_base.f90', - 'FModules/unwrap_tensors.f90', - 'FModules/eqvect.f90', - 'FModules/get_equivalent_atoms.f90', - 'FModules/invmat.f90', - 'FModules/recips.f90', - 'FModules/sgam_ph.f90', - 'FModules/symmetry_high_rank.f90' -] - -py.extension_module('symph', - fortran_sources_symph, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# Extensión 'secondorder' - -# Compilación del módulo Fortran: secondorder -fortran_sources_secondorder = [ - 'FModules/second_order_centering.f90', - 'FModules/second_order_ASR.f90' -] - -py.extension_module('secondorder', - fortran_sources_secondorder, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# Extensión 'thirdorder' - -# Compilación del módulo Fortran: thirdorder - -fortran_sources_thirdorder = [ - 'FModules/third_order_ASR.f90', - 'FModules/third_order_centering.f90', - 'FModules/third_order_cond_centering.f90', - 'FModules/third_order_cond.f90', - 'FModules/third_order_dynbubble.f90', - 'FModules/third_order_interpol.f90' -] - -py.extension_module('thirdorder', - fortran_sources_thirdorder, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# Extensión 'thermal_conductivity' - -thermal_conductivity_fortran_src = files( -'FModules/get_scattering_q_grid.f90', -'FModules/third_order_cond.f90', -'FModules/third_order_cond_centering.f90', -'FModules/get_lf.f90' -) - -py.extension_module('thermal_conductivity', - thermal_conductivity_fortran_src, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if py.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -# Compilación del módulo C: cc_linalg -c_linalg_sources = [ - 'CModules/LinAlg.c', - wrapper_file -] - -py.extension_module('cc_linalg', - c_linalg_sources, - include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C - dependencies: py_dep, - install: true -) - - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: py.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -py.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old_101 b/meson.build.old_101 deleted file mode 100644 index e9b696a5..00000000 --- a/meson.build.old_101 +++ /dev/null @@ -1,231 +0,0 @@ -project('CellConstructor', - ['c','fortran'], - version: '1.5.0', - license: 'GPL', - default_options : [ - 'warning_level=1', - 'buildtype=release', - 'fortran_args=-O2', - 'fortran_args=-cpp' - ] - ) - -# --- System and Python Dependencies --- -# Encuentra las instalaciones necesarias -py = import('python').find_installation(pure: false) -py_dep = py.dependency() -fc = meson.get_compiler('fortran') - -# Dependencias adicionales -#mpi_dep = dependency('mpi') -# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. -lapack_dep = dependency('lapack') -blas_dep = dependency('blas') -openblas_dep = dependency('openblas') - -# --- MPI Detection --- -# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). -# Meson has a built-in MPI module. -mpi_args = [] -mpi_link_args = [] -mpi_compile_args = [] -has_mpi = false - -# Attempts to find the MPI dependency. -# You can specify a specific MPI compiler with the 'mpi_compiler' parameter -# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. -# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. -#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) -mpi_dep = dependency('mpi', required: false) - -if mpi_dep.found() - message('MPI environment detected correctly.') - has_mpi = true - # Meson handles adding appropriate flags. We just add the define. - # If you need specific MPI flags beyond what Meson adds automatically, - # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() - # and add them to extra_compile_args/extra_link_args. - mpi_compile_args += ['-D_MPI'] -else - # Here you can add warning logic if MPI is not found. - # Meson prints a warning if required: true and it is not found. - # For required: false, you can print your own warning. - warning('No MPI compiler found, please ensure MPI is installed and configured.') - warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') -endif -# Busca la librería quadmath, si está disponible -quadmath_dep = fc.find_library('quadmath', required: false) - -# --- CONFIGURACIÓN DE NUMPY --- -# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python -incdir_numpy = run_command(py, - ['-c', 'import numpy; print(numpy.get_include())'], - check : true -).stdout().strip() - -# f2py también requiere la cabecera fortranobject.h -incdir_f2py = run_command(py, - ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], - check : true -).stdout().strip() - -inc_np = include_directories(incdir_numpy, incdir_f2py) -# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' - -# Compilación del módulo Fortran: symph -fortran_sources_symph = [ - 'FModules/constants.f90', - 'FModules/error_handler.f90', - 'FModules/get_latvec.f90', - 'FModules/io_global.f90', - 'FModules/rotate_and_add_dyn.f90', - 'FModules/smallgq.f90', - 'FModules/symm_matrix.f90', - 'FModules/contract_two_phonon_propagator.f90', - 'FModules/fc_supercell_from_dyn.f90', - 'FModules/get_q_grid_fast.f90', - 'FModules/kind.f90', - 'FModules/star_q.f90', - 'FModules/symvector.f90', - 'FModules/cryst_to_car.f90', - 'FModules/flush_unit.f90', - 'FModules/get_translations.f90', - 'FModules/q2qstar_out.f90', - 'FModules/set_asr.f90', - 'FModules/symdynph_gq_new.f90', - 'FModules/trntnsc.f90', - 'FModules/eff_charge_interp.f90', - 'FModules/from_matdyn.f90', - 'FModules/interp.f90', - 'FModules/q_gen.f90', - 'FModules/set_tau.f90', - 'FModules/symm_base.f90', - 'FModules/unwrap_tensors.f90', - 'FModules/eqvect.f90', - 'FModules/get_equivalent_atoms.f90', - 'FModules/invmat.f90', - 'FModules/recips.f90', - 'FModules/sgam_ph.f90', - 'FModules/symmetry_high_rank.f90' -] - -py.extension_module('symph', - fortran_sources_symph, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# Extensión 'secondorder' - -# Compilación del módulo Fortran: secondorder -fortran_sources_secondorder = [ - 'FModules/second_order_centering.f90', - 'FModules/second_order_ASR.f90' -] - -py.extension_module('secondorder', - fortran_sources_secondorder, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# Extensión 'thirdorder' - -# Compilación del módulo Fortran: thirdorder - -fortran_sources_thirdorder = [ - 'FModules/third_order_ASR.f90', - 'FModules/third_order_centering.f90', - 'FModules/third_order_cond_centering.f90', - 'FModules/third_order_cond.f90', - 'FModules/third_order_dynbubble.f90', - 'FModules/third_order_interpol.f90' -] - -py.extension_module('thirdorder', - fortran_sources_thirdorder, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# Extensión 'thermal_conductivity' - -thermal_conductivity_fortran_src = files( -'FModules/get_scattering_q_grid.f90', -'FModules/third_order_cond.f90', -'FModules/third_order_cond_centering.f90', -'FModules/get_lf.f90' -) - -py.extension_module('thermal_conductivity', - thermal_conductivity_fortran_src, - include_directories: inc_np, - dependencies: [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep], - install: true -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if py.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -# Compilación del módulo C: cc_linalg -c_linalg_sources = [ - 'CModules/LinAlg.c', - wrapper_file -] - -py.extension_module('cc_linalg', - c_linalg_sources, - include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C - dependencies: py_dep, - install: true -) - - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: py.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -py.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif From 6119921a5bb40f921ae8f315ce0b2417486e3fa3 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 09:25:34 +0200 Subject: [PATCH 119/151] Removing fpm toml files --- fpm.toml | 46 -------------------------------------------- fpm.toml.old2 | 53 --------------------------------------------------- 2 files changed, 99 deletions(-) delete mode 100644 fpm.toml delete mode 100644 fpm.toml.old2 diff --git a/fpm.toml b/fpm.toml deleted file mode 100644 index 49719e3d..00000000 --- a/fpm.toml +++ /dev/null @@ -1,46 +0,0 @@ -[project] -name = "cellconstructor" -version = "1.5.0" -fpm_version = ">=0.8.0" - -[[library]] -name = "libsymph" -source-dir = "FModules" -source-list = [ - "symdynph_gq_new.f90", "symm_base.f90", "sgam_ph.f90", "invmat.f90", - "set_asr.f90", "error_handler.f90", "io_global.f90", "flush_unit.f90", - "symvector.f90", "fc_supercell_from_dyn.f90", "set_tau.f90", "cryst_to_car.f90", - "recips.f90", "q2qstar_out.f90", "rotate_and_add_dyn.f90", "trntnsc.f90", - "star_q.f90", "eqvect.f90", "symm_matrix.f90", "from_matdyn.f90", "interp.f90", - "q_gen.f90", "smallgq.f90", "symmetry_high_rank.f90", "unwrap_tensors.f90", - "get_latvec.f90", "contract_two_phonon_propagator.f90", "get_q_grid_fast.f90", - "kind.f90", "constants.f90", "eff_charge_interp.f90", "get_translations.f90", - "get_equivalent_atoms.f90" -] -build-type = "static" - -[[library]] -name = "libsecondorder" -source-dir = "FModules" -source-list = [ - "second_order_centering.f90", "second_order_ASR.f90" -] -build-type = "static" - -[[library]] -name = "libthirdorder" -source-dir = "FModules" -source-list = [ - "third_order_centering.f90", "third_order_ASR.f90", - "third_order_interpol.f90", "third_order_dynbubble.f90" -] -build-type = "static" - -[[library]] -name = "libthermal_conductivity" -source-dir = "FModules" -source-list = [ - "get_scattering_q_grid.f90", "third_order_cond.f90", - "third_order_cond_centering.f90", "get_lf.f90" -] -build-type = "static" diff --git a/fpm.toml.old2 b/fpm.toml.old2 deleted file mode 100644 index 6f71b40e..00000000 --- a/fpm.toml.old2 +++ /dev/null @@ -1,53 +0,0 @@ -[project] -name = "cellconstructor" -version = "1.5.0" -fpm_version = ">=0.8.0" - -[[library]] -source-dir = "FModules" -# This tells fpm to compile all Fortran files in the FModules directory. -# If you only want to compile specific files, you can use: - source-list = [ - "FModules/symdynph_gq_new.f90", "FModules/symm_base.f90", - "FModules/sgam_ph.f90", "FModules/invmat.f90", "FModules/set_asr.f90", - "FModules/error_handler.f90", "FModules/io_global.f90", - "FModules/flush_unit.f90", "FModules/symvector.f90", - "FModules/fc_supercell_from_dyn.f90", "FModules/set_tau.f90", - "FModules/cryst_to_car.f90", "FModules/recips.f90", - "FModules/q2qstar_out.f90", "FModules/rotate_and_add_dyn.f90", - "FModules/trntnsc.f90", "FModules/star_q.f90", "FModules/eqvect.f90", - "FModules/symm_matrix.f90", "FModules/from_matdyn.f90", - "FModules/interp.f90", "FModules/q_gen.f90", "FModules/smallgq.f90", - "FModules/symmetry_high_rank.f90", "FModules/unwrap_tensors.f90", - "FModules/get_latvec.f90", "FModules/contract_two_phonon_propagator.f90", - "FModules/get_q_grid_fast.f90", "FModules/kind.f90", - "FModules/constants.f90", "FModules/eff_charge_interp.f90", - "FModules/get_translations.f90", "FModules/get_equivalent_atoms.f90" - ] -[[library]] -name = "secondorder" -source-dir = "FModules" -source-list = [ - "FModules/second_order_centering.f90", - "FModules/second_order_ASR.f90" -] - -[[library]] -name = "thirdorder" -source-dir = "FModules" -source-list = [ - "FModules/third_order_centering.f90", - "FModules/third_order_ASR.f90", - "FModules/third_order_interpol.f90", - "FModules/third_order_dynbubble.f90" -] - -[[library]] -name = "thermal_conductivity" -source-dir = "FModules" -source-list = [ - "FModules/get_scattering_q_grid.f90", - "FModules/third_order_cond.f90", - "FModules/third_order_cond_centering.f90", - "FModules/get_lf.f90" -] From 8908dc4dcb98e859c130c091f6f9c1ca080564f0 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 09:40:59 +0200 Subject: [PATCH 120/151] Removing file meson.build.test_fpm_toml --- meson.build.test_fpm_toml | 154 -------------------------------------- 1 file changed, 154 deletions(-) delete mode 100644 meson.build.test_fpm_toml diff --git a/meson.build.test_fpm_toml b/meson.build.test_fpm_toml deleted file mode 100644 index e4806083..00000000 --- a/meson.build.test_fpm_toml +++ /dev/null @@ -1,154 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -fpm_exe = find_program('fpm', required: true) -f2py_exe = find_program('f2py', required: true) - -# Searches the system for the BLAS and LAPACK libraries. -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# Use fpm to build and install your Fortran sources. -# Meson assumes a fpm.toml file exists in the source directory. -# fpm.toml tells fpm which files to compile and what to name the library. -run_command( - fpm_exe, - 'install', - '--prefix', meson.current_build_dir() / 'fpm_build', - '--flag', ['-g', '-fPIC', '-O2', '-fopenmp'], - check : true -) - -# --- Definition of Fortran Extensions --- - -# Extensión 'symph' -# symph_sources is now defined by the fpm.toml file. -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', - 'FModules/sgam_ph.f90', 'FModules/invmat.f90', 'FModules/set_asr.f90', - 'FModules/error_handler.f90', 'FModules/io_global.f90', - 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', - 'FModules/q2qstar_out.f90', 'FModules/rotate_and_add_dyn.f90', - 'FModules/trntnsc.f90', 'FModules/star_q.f90', 'FModules/eqvect.f90', - 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', - 'FModules/constants.f90', 'FModules/eff_charge_interp.f90', - 'FModules/get_translations.f90', 'FModules/get_equivalent_atoms.f90' -) - -# Use f2py to create the C wrapper -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symph-f2pywrappers.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower', - ], - build_by_default: true, -) - -# Create the Python extension module -py_symph_ext = python_installation.extension_module( - 'symph', - symph_wrapper, - meson.current_build_dir() / 'fpm_build' / 'lib' / 'libsymph.a', - install: true, - include_directories: [ - include_directories(numpy_incdir), - meson.current_build_dir() / 'fpm_build' / 'include' - ], - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - install_rpath: '$ORIGIN/..', -) - -# ... [The other extension definitions] ... - -# --- Definition of the C Extension 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir), - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Installing the Python package 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', - 'cellconstructor/AnharmonicForceFields.py', - 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', - 'cellconstructor/Phonons.py', - 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', - 'cellconstructor/Units.py', - 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', - 'cellconstructor/Manipulate.py', - 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', - 'cellconstructor/Structure.py', - 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', - 'cellconstructor/SymData/36_red.dat', - 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', - 'cellconstructor/SymData/64.bcs', - 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Installing the executable scripts --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. (Needs pytest installed) -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif From cd70730f3b0c0dfd00497b8e5dd86fa7c29e97d4 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 10:51:55 +0200 Subject: [PATCH 121/151] Added openmp dependency for thermal_transport module --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ce4aab45..7fa616b2 100644 --- a/meson.build +++ b/meson.build @@ -17,12 +17,15 @@ py_dep = py.dependency() fc = meson.get_compiler('fortran') # Dependencias adicionales -#mpi_dep = dependency('mpi') + # Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. lapack_dep = dependency('lapack') blas_dep = dependency('blas') openblas_dep = dependency('openblas', required: false) +# La dependencia openmp es necesaria para thermal_transport +openmp_dep = dependency('openmp', required: true) + # --- MPI Detection --- # This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). # Meson has a built-in MPI module. From db8568f4b5c150f3153aaf69b51d6d53772b5f1a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 11:00:25 +0200 Subject: [PATCH 122/151] Set an option to use Intel Math Kernel Library (MKL) in meson. Using "setup builddir -Duse_mkl=true" --- meson.build | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 7fa616b2..3c6e512f 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,9 @@ project('CellConstructor', ] ) +# --- Opciones de compilación --- +use_mkl = get_option('use_mkl') + # --- System and Python Dependencies --- # Encuentra las instalaciones necesarias py = import('python').find_installation(pure: false) @@ -19,9 +22,17 @@ fc = meson.get_compiler('fortran') # Dependencias adicionales # Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. -lapack_dep = dependency('lapack') -blas_dep = dependency('blas') +#lapack_dep = dependency('lapack') +#blas_dep = dependency('blas') openblas_dep = dependency('openblas', required: false) +if use_mkl + mkl_dep = dependency('mkl', required: true) + blas_dep = mkl_dep + lapack_dep = mkl_dep +else + lapack_dep = dependency('lapack', required: true) + blas_dep = dependency('blas', required: true) +endif # La dependencia openmp es necesaria para thermal_transport openmp_dep = dependency('openmp', required: true) From 204a061d651fa4c6bc2c4499e498123cad9aa2ce Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 11:21:59 +0200 Subject: [PATCH 123/151] Update README.md and setting the file meson.options for the mkl option --- README.md | 5 + meson.build.test_f2pywrappers | 268 ---------------------------------- meson.options | 3 + 3 files changed, 8 insertions(+), 268 deletions(-) delete mode 100644 meson.build.test_f2pywrappers create mode 100644 meson.options diff --git a/README.md b/README.md index 53f0c50e..ca259da2 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,11 @@ or if you are in a conda env (the best option for a local installation): meson setup builddir --prefix=$CONDA_PREFIX ``` +if you want to use Intel MKL: +```bash +setup builddir -Duse_mkl=true +``` + This command sets up a separate build directory (`builddir`) where all compiled files and build artifacts will be placed, keeping the source directory clean. After this, change into the build directory: ```bash diff --git a/meson.build.test_f2pywrappers b/meson.build.test_f2pywrappers deleted file mode 100644 index 2f3a469c..00000000 --- a/meson.build.test_f2pywrappers +++ /dev/null @@ -1,268 +0,0 @@ -project('CellConstructor', - ['c','fortran'], - version: '1.5.0', - license: 'GPL', - default_options : [ - 'warning_level=1', - 'buildtype=release', - 'fortran_args=-O2', - 'fortran_args=-cpp' - ] - ) - -# --- System and Python Dependencies --- -# Encuentra las instalaciones necesarias -py = import('python').find_installation(pure: false) -py_dep = py.dependency() -fc = meson.get_compiler('fortran') - -# Dependencias adicionales -#mpi_dep = dependency('mpi') -# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. -lapack_dep = dependency('lapack') -blas_dep = dependency('blas') -openblas_dep = dependency('openblas', required: false) - -# --- MPI Detection --- -# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). -# Meson has a built-in MPI module. -mpi_args = [] -mpi_link_args = [] -mpi_compile_args = [] -has_mpi = false - -# Attempts to find the MPI dependency. -# You can specify a specific MPI compiler with the 'mpi_compiler' parameter -# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. -# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. -#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) -mpi_dep = dependency('mpi', required: false) - -if mpi_dep.found() - message('MPI environment detected correctly.') - has_mpi = true - # Meson handles adding appropriate flags. We just add the define. - # If you need specific MPI flags beyond what Meson adds automatically, - # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() - # and add them to extra_compile_args/extra_link_args. - mpi_compile_args += ['-D_MPI'] -else - # Here you can add warning logic if MPI is not found. - # Meson prints a warning if required: true and it is not found. - # For required: false, you can print your own warning. - warning('No MPI compiler found, please ensure MPI is installed and configured.') - warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') -endif -# Busca la librería quadmath, si está disponible -quadmath_dep = fc.find_library('quadmath', required: false) - -# --- CONFIGURACIÓN DE NUMPY --- -# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python -incdir_numpy = run_command(py, - ['-c', 'import numpy; print(numpy.get_include())'], - check : true -).stdout().strip() - -# f2py también requiere la cabecera fortranobject.h -incdir_f2py = run_command(py, - ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], - check : true -).stdout().strip() - -inc_np = include_directories(incdir_numpy, incdir_f2py) -# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- -#if openblas_dep.found() -# message('openblas environment detected correctly.') -# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] -#else -# warning('No openblas found.') - list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] -#endif -# --- Definición de cada extensión de Python (Fortran) --- - -fortranobject_c = incdir_f2py / 'fortranobject.c' - -# Extensión 'symph' - -# Compilación del módulo Fortran: symph -fortran_sources_symph = [ - 'FModules/constants.f90', - 'FModules/error_handler.f90', - 'FModules/get_latvec.f90', - 'FModules/io_global.f90', - 'FModules/rotate_and_add_dyn.f90', - 'FModules/smallgq.f90', - 'FModules/symm_matrix.f90', - 'FModules/contract_two_phonon_propagator.f90', - 'FModules/fc_supercell_from_dyn.f90', - 'FModules/get_q_grid_fast.f90', - 'FModules/kind.f90', - 'FModules/star_q.f90', - 'FModules/symvector.f90', - 'FModules/cryst_to_car.f90', - 'FModules/flush_unit.f90', - 'FModules/get_translations.f90', - 'FModules/q2qstar_out.f90', - 'FModules/set_asr.f90', - 'FModules/symdynph_gq_new.f90', - 'FModules/trntnsc.f90', - 'FModules/eff_charge_interp.f90', - 'FModules/from_matdyn.f90', - 'FModules/interp.f90', - 'FModules/q_gen.f90', - 'FModules/set_tau.f90', - 'FModules/symm_base.f90', - 'FModules/unwrap_tensors.f90', - 'FModules/eqvect.f90', - 'FModules/get_equivalent_atoms.f90', - 'FModules/invmat.f90', - 'FModules/recips.f90', - 'FModules/sgam_ph.f90', - 'FModules/symmetry_high_rank.f90' -] - -fortran_wrappers_symph = [ - 'f2py_wrappers/symph-f2pywrappers.f', - 'f2py_wrappers/symph-f2pywrappers2.f90', - 'f2py_wrappers/thirdordermodule.c' -] - -fortran_src_symph = fortran_sources_symph + fortran_wrappers_symph - -py.extension_module('symph', - fortran_src_symph, - include_directories: inc_np, - dependencies: list_dep, - install: true -) - -# Extensión 'secondorder' - -# Compilación del módulo Fortran: secondorder -fortran_sources_secondorder = [ - 'FModules/second_order_centering.f90', - 'FModules/second_order_ASR.f90' -] - -fortran_wrappers_secondorder = [ - 'f2py_wrappers/secondorder-f2pywrappers2.f90', - 'f2py_wrappers/secondordermodule.c' -] - -fortran_src_secondorder = fortran_sources_secondorder + fortran_wrappers_secondorder - -py.extension_module('secondorder', - fortran_src_secondorder, - include_directories: inc_np, - dependencies: list_dep, - install: true -) - -# Extensión 'thirdorder' - -# Compilación del módulo Fortran: thirdorder - -fortran_sources_thirdorder = [ - 'FModules/third_order_ASR.f90', - 'FModules/third_order_centering.f90', - 'FModules/third_order_cond_centering.f90', - 'FModules/third_order_cond.f90', - 'FModules/third_order_dynbubble.f90', - 'FModules/third_order_interpol.f90' -] - -fortran_wrappers_thirdorder = [ - 'f2py_wrappers/thirdordermodule.c', - 'f2py_wrappers/thirdorder-f2pywrappers2.f90' -] - -fortran_src_thirdorder = fortran_sources_thirdorder + fortran_wrappers_thirdorder - -py.extension_module('thirdorder', - fortran_src_thirdorder, - include_directories: inc_np, - dependencies: list_dep, - install: true -) - -# Extensión 'thermal_conductivity' - -fortran_sources_thermal_conductivity = [ -'FModules/get_lf.f90', -'FModules/get_scattering_q_grid.f90', -'FModules/third_order_centering.f90', -'FModules/third_order_cond.f90' -] - -fortran_wrappers_thermal_conductivity = [ - 'f2py_wrappers/thermal_conductivity-f2pywrappers2.f90', - 'f2py_wrappers/thermal_conductivitymodule.c' -] - -fortran_src_thermal_conductivity = fortran_sources_thermal_conductivity + fortran_wrappers_thermal_conductivity - -py.extension_module('thermal_conductivity', - fortran_src_thermal_conductivity, - include_directories: inc_np, - dependencies: list_dep, - install: true -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if py.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -# Compilación del módulo C: cc_linalg -c_linalg_sources = [ - 'CModules/LinAlg.c', - wrapper_file -] - -py.extension_module('cc_linalg', - c_linalg_sources, - include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C - dependencies: py_dep, - install: true -) - - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: py.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -py.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.options b/meson.options new file mode 100644 index 00000000..d6853da8 --- /dev/null +++ b/meson.options @@ -0,0 +1,3 @@ +# meson.options +option('use_mkl', type: 'boolean', value: false, + description: 'Use Intel Math Kernel Library (MKL) for BLAS/LAPACK') From d436ac83cb87c99ebe0b00fee88886692e24485c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Wed, 17 Sep 2025 13:57:51 +0200 Subject: [PATCH 124/151] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ca259da2..f48cfc86 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,13 @@ This step helps verify that the build works correctly. To install the compiled binaries, libraries, and other files system-wide (or to a custom location), run: + +```bash +meson install +``` + +or + ```bash sudo meson install ``` From 9f0ee709220250b7724c53848c08afdb9403f9df Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 09:38:36 +0200 Subject: [PATCH 125/151] The custom f2py wrapper may be necessary until meson is updated to a new version that includes full f2py integration. --- meson.build | 74 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 3c6e512f..a475c96c 100644 --- a/meson.build +++ b/meson.build @@ -143,9 +143,24 @@ fortran_sources_symph = [ 'FModules/sgam_ph.f90', 'FModules/symmetry_high_rank.f90' ] - +## Generate the C wrapper with f2py using a custom target +#f2py_symph_target = custom_target('symph-f2py-wrapper', +# input: fortran_sources_symph, +# output: 'symph-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'symph' +# ], +# install: false +#) py.extension_module('symph', fortran_sources_symph, + # f2py_symph_target, # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -160,9 +175,24 @@ fortran_sources_secondorder = [ 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' ] - +## Generate the C wrapper with f2py using a custom target +#f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', +# input: fortran_sources_secondorder, +# output: 'secondorder-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'secondorder' +# ], +# install: false +#) py.extension_module('secondorder', fortran_sources_secondorder, + # f2py_secondorder_target, # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -182,9 +212,24 @@ fortran_sources_thirdorder = [ 'FModules/third_order_dynbubble.f90', 'FModules/third_order_interpol.f90' ] - +## Generate the C wrapper with f2py using a custom target +#f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', +# input: fortran_sources_thirdorder, +# output: 'thirdorder-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'thirdorder' +# ], +# install: false +#) py.extension_module('thirdorder', fortran_sources_thirdorder, + # f2py_thirdorder_target # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -194,15 +239,30 @@ py.extension_module('thirdorder', # Extensión 'thermal_conductivity' -thermal_conductivity_fortran_src = files( +fortran_sources_thermal_conductivity = [ 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - +] +## Generate the C wrapper with f2py using a custom target +#f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', +# input: fortran_sources_thermal_conductivity, +# output: 'thermal_conductivity-f2py.c', +# command: [ +# py.full_path(), '-m', 'numpy.f2py', +# '--backend', 'meson', +# '--dep', 'mpi', +# '--quiet', +# '-c', +# '@INPUT0@', +# '-m', 'thermal_conductivity' +# ], +# install: false +#) py.extension_module('thermal_conductivity', - thermal_conductivity_fortran_src, + fortran_sources_thermal_conductivity, + # f2py_thermal_conductivity_target, # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, From 9eff8dba3f48b982d71160a3f3a5f30f05573acb Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 10:07:51 +0200 Subject: [PATCH 126/151] Set the meson minimun version --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a475c96c..d4df3986 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,7 @@ project('CellConstructor', ['c','fortran'], version: '1.5.0', license: 'GPL', + meson_version: '>= 1.1.0', default_options : [ 'warning_level=1', 'buildtype=release', @@ -229,7 +230,7 @@ fortran_sources_thirdorder = [ #) py.extension_module('thirdorder', fortran_sources_thirdorder, - # f2py_thirdorder_target + # f2py_thirdorder_target, # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, From 5c2ee4134c2e5745c5cb920c6df5f05a378b1d86 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 10:47:19 +0200 Subject: [PATCH 127/151] Group things up --- meson.build | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index d4df3986..8999cad5 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project('CellConstructor', ['c','fortran'], version: '1.5.0', license: 'GPL', - meson_version: '>= 1.1.0', + meson_version: '>= 1.1.0', # <- set min version of meson. default_options : [ 'warning_level=1', 'buildtype=release', @@ -147,7 +147,7 @@ fortran_sources_symph = [ ## Generate the C wrapper with f2py using a custom target #f2py_symph_target = custom_target('symph-f2py-wrapper', # input: fortran_sources_symph, -# output: 'symph-f2py.c', +# output: ['symph-f2py.c','symph-f2py-wrapper.f'], # command: [ # py.full_path(), '-m', 'numpy.f2py', # '--backend', 'meson', @@ -160,8 +160,9 @@ fortran_sources_symph = [ # install: false #) py.extension_module('symph', + # [ fortran_sources_symph, - # f2py_symph_target, + # f2py_symph_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -179,7 +180,7 @@ fortran_sources_secondorder = [ ## Generate the C wrapper with f2py using a custom target #f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', # input: fortran_sources_secondorder, -# output: 'secondorder-f2py.c', +# output: ['secondorder-f2py.c','secondorder-f2py-wrapper.f'], # command: [ # py.full_path(), '-m', 'numpy.f2py', # '--backend', 'meson', @@ -192,8 +193,9 @@ fortran_sources_secondorder = [ # install: false #) py.extension_module('secondorder', + # [ fortran_sources_secondorder, - # f2py_secondorder_target, + # f2py_secondorder_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -216,7 +218,7 @@ fortran_sources_thirdorder = [ ## Generate the C wrapper with f2py using a custom target #f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', # input: fortran_sources_thirdorder, -# output: 'thirdorder-f2py.c', +# output: ['thirdorder-f2py.c','thirdorder-f2py-wrapper.f'], # command: [ # py.full_path(), '-m', 'numpy.f2py', # '--backend', 'meson', @@ -229,8 +231,9 @@ fortran_sources_thirdorder = [ # install: false #) py.extension_module('thirdorder', + # [ fortran_sources_thirdorder, - # f2py_thirdorder_target, + # f2py_thirdorder_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -249,7 +252,7 @@ fortran_sources_thermal_conductivity = [ ## Generate the C wrapper with f2py using a custom target #f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', # input: fortran_sources_thermal_conductivity, -# output: 'thermal_conductivity-f2py.c', +# output: ['thermal_conductivity-f2py.c','thermal_conductivity-f2py-wrapper.f'], # command: [ # py.full_path(), '-m', 'numpy.f2py', # '--backend', 'meson', @@ -262,8 +265,9 @@ fortran_sources_thermal_conductivity = [ # install: false #) py.extension_module('thermal_conductivity', + # [ fortran_sources_thermal_conductivity, - # f2py_thermal_conductivity_target, + # f2py_thermal_conductivity_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, From a3e080af8b15512d651e934cb7f787de835f16f7 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 11:46:04 +0200 Subject: [PATCH 128/151] For testing... --- meson.build | 56 +++++++++++++++-------------------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/meson.build b/meson.build index 8999cad5..1c27c7fb 100644 --- a/meson.build +++ b/meson.build @@ -147,16 +147,10 @@ fortran_sources_symph = [ ## Generate the C wrapper with f2py using a custom target #f2py_symph_target = custom_target('symph-f2py-wrapper', # input: fortran_sources_symph, -# output: ['symph-f2py.c','symph-f2py-wrapper.f'], -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'symph' -# ], +# output: ['symphmodule.c','symph-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], # install: false #) py.extension_module('symph', @@ -180,16 +174,10 @@ fortran_sources_secondorder = [ ## Generate the C wrapper with f2py using a custom target #f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', # input: fortran_sources_secondorder, -# output: ['secondorder-f2py.c','secondorder-f2py-wrapper.f'], -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'secondorder' -# ], +# output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], # install: false #) py.extension_module('secondorder', @@ -218,16 +206,10 @@ fortran_sources_thirdorder = [ ## Generate the C wrapper with f2py using a custom target #f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', # input: fortran_sources_thirdorder, -# output: ['thirdorder-f2py.c','thirdorder-f2py-wrapper.f'], -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'thirdorder' -# ], +# output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], # install: false #) py.extension_module('thirdorder', @@ -252,16 +234,10 @@ fortran_sources_thermal_conductivity = [ ## Generate the C wrapper with f2py using a custom target #f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', # input: fortran_sources_thermal_conductivity, -# output: ['thermal_conductivity-f2py.c','thermal_conductivity-f2py-wrapper.f'], -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'thermal_conductivity' -# ], +# output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], # install: false #) py.extension_module('thermal_conductivity', From 228d0232f1f6987aa6287500358569afe2b09a15 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 11:49:03 +0200 Subject: [PATCH 129/151] Old method to compile the FORTRAN libraries with f2py. --- meson.build | 80 ++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/meson.build b/meson.build index 1c27c7fb..e097ce1e 100644 --- a/meson.build +++ b/meson.build @@ -145,18 +145,18 @@ fortran_sources_symph = [ 'FModules/symmetry_high_rank.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_symph_target = custom_target('symph-f2py-wrapper', -# input: fortran_sources_symph, -# output: ['symphmodule.c','symph-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], -# install: false -#) +f2py_symph_target = custom_target('symph-f2py-wrapper', + input: fortran_sources_symph, + output: ['symphmodule.c','symph-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], + install: false +) py.extension_module('symph', - # [ + [ fortran_sources_symph, - # f2py_symph_target], + f2py_symph_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -172,18 +172,18 @@ fortran_sources_secondorder = [ 'FModules/second_order_ASR.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', -# input: fortran_sources_secondorder, -# output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], -# install: false -#) +f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', + input: fortran_sources_secondorder, + output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], + install: false +) py.extension_module('secondorder', - # [ + [ fortran_sources_secondorder, - # f2py_secondorder_target], + f2py_secondorder_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -204,18 +204,18 @@ fortran_sources_thirdorder = [ 'FModules/third_order_interpol.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', -# input: fortran_sources_thirdorder, -# output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], -# install: false -#) +f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', + input: fortran_sources_thirdorder, + output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], + install: false +) py.extension_module('thirdorder', - # [ + [ fortran_sources_thirdorder, - # f2py_thirdorder_target], + f2py_thirdorder_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, @@ -232,18 +232,18 @@ fortran_sources_thermal_conductivity = [ 'FModules/get_lf.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', -# input: fortran_sources_thermal_conductivity, -# output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], -# install: false -#) +f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', + input: fortran_sources_thermal_conductivity, + output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], + install: false +) py.extension_module('thermal_conductivity', - # [ + [ fortran_sources_thermal_conductivity, - # f2py_thermal_conductivity_target], + f2py_thermal_conductivity_target], # f2py_c_source, # <- Cambio aplicado # c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, From 1a6b6e01f8e2d7d5282b9b5d2858a71192fa24fb Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 11:59:03 +0200 Subject: [PATCH 130/151] Fix f2pywrappers on symph module --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e097ce1e..e69e8a89 100644 --- a/meson.build +++ b/meson.build @@ -147,7 +147,7 @@ fortran_sources_symph = [ ## Generate the C wrapper with f2py using a custom target f2py_symph_target = custom_target('symph-f2py-wrapper', input: fortran_sources_symph, - output: ['symphmodule.c','symph-f2pywrappers2.f90'], + output: ['symphmodule.c','symph-f2pywrappers.f','symph-f2pywrappers2.f90'], # command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', # '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], From fb65a511b8869ec3a9fabec969b499e6740cc8bc Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 15:53:02 +0200 Subject: [PATCH 131/151] Adding an installation guide --- CellConstructor Installation Guide.md | 121 ++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 CellConstructor Installation Guide.md diff --git a/CellConstructor Installation Guide.md b/CellConstructor Installation Guide.md new file mode 100644 index 00000000..515264d3 --- /dev/null +++ b/CellConstructor Installation Guide.md @@ -0,0 +1,121 @@ +# **CellConstructor Installation Guide** + +This guide provides step-by-step instructions to compile and install the CellConstructor library and its dependencies. The project uses the Meson build system to compile C and Fortran extensions for Python. +We recommend using a Conda environment to manage the dependencies. + +## **Prerequisites** + +You will need a working C and Fortran compiler on your system, as well as git to clone the repository. +On a Debian/Ubuntu based system, you can install them with: +```bash +sudo apt-get update +sudo apt-get install build-essential gfortran git +``` + +On a RedHat/Fedora/CentOS system, you can install them with: +```bash +sudo dnf groupinstall "Development Tools" +sudo dnf install gfortran git +``` + +## **Step 1: Set up the Conda Environment** + +First, we will create a dedicated Conda environment to ensure all dependencies are isolated and have the correct versions. + +1. Create a new Conda environment: + We will name the environment sscha\_env and use Python 3.10. You can choose a different Python version if needed (the project requires \>=3.8). + ```bash + conda create \-n sscha\_env python=3.10 + ``` + +2. Activate the environment: + You must activate the environment before proceeding with the installation. + ```bash + conda activate sscha\_env + ``` + +## **Step 2: Install Dependencies** + +Now we will install the necessary build tools, libraries, and Python packages into our active Conda environment. + +1. Install system and build dependencies with Conda: + This command installs the core libraries needed for compilation (BLAS, LAPACK, MPI) and the build system itself (Meson, Ninja). + ```bash + conda install \-c conda-forge openblas lapack openmpi meson ninja + ``` + + *Note: openblas provides optimized implementations for blas and lapack.* +2. Install Python dependencies with pip: + Use pip to install the Python packages listed in requirements.txt. + ```bash + pip install \-r requirements.txt + ``` + +## **Step 3: Clone the Repository** + +If you haven't already, clone the project repository from its source. +```bash +git clone \ +cd CellConstructor \# Or your repository's root directory +``` + +## **Step 4: Compile and Install the Project** + +With the environment set up and all dependencies installed, you can now build and install CellConstructor using pip in editable mode or standard mode. The pyproject.toml file tells pip to use meson-python as the build backend. + +### **Recommended Method: Editable Install** + +An "editable" install is highly recommended for developers. It allows you to modify the source code and have the changes reflected immediately without needing to reinstall. +```bash +pip install \-e . +``` + +### **Standard Method: Regular Install** + +This method is suitable for users who just want to use the library without modifying its source code. +```bash +pip install . +``` + +The pip command will automatically invoke Meson, which will configure the project, compile the C and Fortran extensions, and install the complete package into your Conda environment. + +## **Build Options** + +The project includes custom build options that can be configured. + +### **Using Intel MKL** + +If you have the Intel Math Kernel Library (MKL) installed and wish to use it for BLAS/LAPACK, you can enable it during the build process. + +1. **Ensure MKL is installed in your Conda environment:** + ```bash + conda install mkl mkl-devel + ``` + +2. Install the project passing the use\_mkl option: + You can pass Meson options through pip's \--config-settings flag. + ```bash + pip install . \--config-settings=--setup-args=-Duse\_mkl=true + ``` + + Or for an editable install: + ```bash + pip install \-e . \--config-settings=--setup-args=-Duse\_mkl=true + ``` + +## **How to Verify the Installation** + +After the installation is complete, you can verify that the modules were built correctly by opening a Python interpreter and importing them: +```bash +python + +\>\>\> import cellconstructor +\>\>\> import cc\_linalg +\>\>\> import symph +\>\>\> import secondorder +\>\>\> import thirdorder + +\>\>\> print("Successfully imported all CellConstructor modules\!") +``` + +If no ImportError messages appear, the installation was successful. From e804795fdf2c0a4b3eaf6df63d50bba1b2d3acf5 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 18 Sep 2025 16:00:15 +0200 Subject: [PATCH 132/151] Set installation guide --- CellConstructor Installation Guide.md | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CellConstructor Installation Guide.md b/CellConstructor Installation Guide.md index 515264d3..2e93e76c 100644 --- a/CellConstructor Installation Guide.md +++ b/CellConstructor Installation Guide.md @@ -25,13 +25,13 @@ First, we will create a dedicated Conda environment to ensure all dependencies a 1. Create a new Conda environment: We will name the environment sscha\_env and use Python 3.10. You can choose a different Python version if needed (the project requires \>=3.8). ```bash - conda create \-n sscha\_env python=3.10 + conda create -n sscha_env python=3.10 ``` 2. Activate the environment: You must activate the environment before proceeding with the installation. ```bash - conda activate sscha\_env + conda activate sscha_env ``` ## **Step 2: Install Dependencies** @@ -41,22 +41,22 @@ Now we will install the necessary build tools, libraries, and Python packages in 1. Install system and build dependencies with Conda: This command installs the core libraries needed for compilation (BLAS, LAPACK, MPI) and the build system itself (Meson, Ninja). ```bash - conda install \-c conda-forge openblas lapack openmpi meson ninja + conda install -c conda-forge openblas lapack openmpi meson ninja ``` *Note: openblas provides optimized implementations for blas and lapack.* 2. Install Python dependencies with pip: Use pip to install the Python packages listed in requirements.txt. ```bash - pip install \-r requirements.txt + pip install -r requirements.txt ``` ## **Step 3: Clone the Repository** If you haven't already, clone the project repository from its source. ```bash -git clone \ -cd CellConstructor \# Or your repository's root directory +git clone +cd CellConstructor # Or your repository's root directory ``` ## **Step 4: Compile and Install the Project** @@ -67,7 +67,7 @@ With the environment set up and all dependencies installed, you can now build an An "editable" install is highly recommended for developers. It allows you to modify the source code and have the changes reflected immediately without needing to reinstall. ```bash -pip install \-e . +pip install -e . ``` ### **Standard Method: Regular Install** @@ -95,12 +95,12 @@ If you have the Intel Math Kernel Library (MKL) installed and wish to use it for 2. Install the project passing the use\_mkl option: You can pass Meson options through pip's \--config-settings flag. ```bash - pip install . \--config-settings=--setup-args=-Duse\_mkl=true + pip install . --config-settings=--setup-args=-Duse_mkl=true ``` Or for an editable install: ```bash - pip install \-e . \--config-settings=--setup-args=-Duse\_mkl=true + pip install -e . --config-settings=--setup-args=-Duse_mkl=true ``` ## **How to Verify the Installation** @@ -109,13 +109,13 @@ After the installation is complete, you can verify that the modules were built c ```bash python -\>\>\> import cellconstructor -\>\>\> import cc\_linalg -\>\>\> import symph -\>\>\> import secondorder -\>\>\> import thirdorder +>>> import cellconstructor +>>> import cc_linalg +>>> import symph +>>> import secondorder +>>> import thirdorder -\>\>\> print("Successfully imported all CellConstructor modules\!") +>>> print("Successfully imported all CellConstructor modules\!") ``` If no ImportError messages appear, the installation was successful. From 4a109961370f4ad4928559ba5b6a52faf119e58e Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 08:29:02 +0200 Subject: [PATCH 133/151] Clean directory --- test.meson.build | 229 ------------------------------------------ test_old.meson.build | 115 --------------------- test_old3.meson.build | 222 ---------------------------------------- test_old4.meson.build | 220 ---------------------------------------- 4 files changed, 786 deletions(-) delete mode 100644 test.meson.build delete mode 100644 test_old.meson.build delete mode 100644 test_old3.meson.build delete mode 100644 test_old4.meson.build diff --git a/test.meson.build b/test.meson.build deleted file mode 100644 index 49ebab8f..00000000 --- a/test.meson.build +++ /dev/null @@ -1,229 +0,0 @@ -project('CellConstructor', ['c', 'fortran'], - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2', 'warning_level=1', 'buildtype=release'] -) -fc = meson.get_compiler('fortran') - -# --- Dependencias del sistema y de Python --- -python = import('python').find_installation(pure: false) -#python_installation = python.find_installation() -py_dep = python.dependency() # Usamos la dependencia de Meson para obtener rutas automáticamente - -# Obtenemos las rutas de los headers de numpy y f2py -numpy_incdir = run_command( - #python_installation, '-c', 'import numpy; print(numpy.get_include())', - python, - ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], - check: true -).stdout().strip() -f2py_incdir = run_command( - #python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', - python, - ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], - check: true -).stdout().strip() - -# El archivo de la API de f2py que contiene la definición de PyFortran_Type -fortranobject_c = f2py_incdir / 'fortranobject.c' - -# Creamos una lista de directorios de inclusión -include_dirs = include_directories(numpy_incdir, f2py_incdir) -np_dep = declare_dependency(include_directories: numpy_incdir) -incdir_f2py = numpy_incdir / '..' / '..' / 'f2py' / 'src' -inc_f2py = include_directories(incdir_f2py) -fortranobject_c = incdir_f2py / 'fortranobject.c' -inc_np = include_directories(numpy_incdir, incdir_f2py) -# gh-25000 -quadmath_dep = fc.find_library('quadmath', required: false) - -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -#py.extension_module('invmat', -# [ -# 'invmat.f90', -# 'invmatmodule.c', -# 'invmat-f2pywrappers.f', -# fortranobject_c -# ], -# include_directories: [ -# inc_np, -# -# ], -# dependencies : [ -# py_dep, -# quadmath_dep, -# dependency('mpi') -# -# -# ], -# install : true) - - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src, fortranobject_c], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src, fortranobject_c], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, py_dep], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdordermodule.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src, fortranobject_c], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, py_dep], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivitymodule.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src, fortranobject_c], - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir, f2py_incdir), - install: true, - dependencies: [py_dep], - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/test_old.meson.build b/test_old.meson.build deleted file mode 100644 index 5ea2938c..00000000 --- a/test_old.meson.build +++ /dev/null @@ -1,115 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-cpp', 'fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() - -# Obtener ruta común de includes: numpy.get_include() y su padre para fortranobject.h -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -numpy_parent_incdir = run_command( - python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', - check: true -).stdout().strip() - -f2py_exe = find_program('f2py', required: true) - -# Dependencias de sistema -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de extensiones Python (Fortran) --- - -# Ejemplo para la extensión symph -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [f2py_exe, '-m', 'symph', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -# Define los includes agrupados con ambos directorios -numpy_includes = include_directories(numpy_incdir, numpy_parent_incdir, '.') - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - include_directories: numpy_includes, - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# Repite patrón análogo para las demás extensiones ... - -# Ejemplo para la extensión secondorder -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - include_directories: numpy_includes, - dependencies: [lapack_dep, blas_dep], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# (Y así sucesivamente para thirdorder y thermal_conductivity...) - -# --- Definición de la extensión C 'cc_linalg' --- - -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) - -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: numpy_includes, - install: true, - install_rpath: '$ORIGIN/..' -) - -# Luego continúa la sección de install_data y tests según tus necesidades diff --git a/test_old3.meson.build b/test_old3.meson.build deleted file mode 100644 index 60a333bd..00000000 --- a/test_old3.meson.build +++ /dev/null @@ -1,222 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() - -# Obtenemos la ruta principal de los headers de numpy -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -# Obtenemos la ruta padre para incluir los headers de numpy anidados -numpy_parent_incdir = run_command( - python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', - check: true -).stdout().strip() - -# Obtenemos la ruta específica para los headers de f2py -f2py_incdir = run_command( - python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', - check: true -).stdout().strip() - -# Creamos una lista de directorios de inclusión para usar en todas las extensiones -include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') - -# Obtenemos la ruta de la biblioteca de f2py para la vinculación -f2py_libdir = run_command( - python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(os.path.dirname(numpy.f2py.__file__)), "core", "lib"))', - check: true -).stdout().strip() - -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp', '-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep], - link_args: ['-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdordermodule.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep], - link_args: ['-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivitymodule.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep], - link_args: ['-fopenmp', '-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_dirs, - install: true, - link_args: ['-L' + f2py_libdir, '-lnpy-c-api', '-lpython' + python_installation.version()], - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources( - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/test_old4.meson.build b/test_old4.meson.build deleted file mode 100644 index c8c73b50..00000000 --- a/test_old4.meson.build +++ /dev/null @@ -1,220 +0,0 @@ -project('CellConstructor', 'fortran', 'c', - version: '1.5.0', - license: 'GPL', - default_options: ['fortran_args=-O2'] -) - -# --- System and Python Dependencies --- -python = import('python') -python_installation = python.find_installation() -py_dep = dependency('python3', required: true) - -# Obtenemos la ruta principal de los headers de numpy -numpy_incdir = run_command( - python_installation, '-c', 'import numpy; print(numpy.get_include())', - check: true -).stdout().strip() - -# Obtenemos la ruta padre para incluir los headers de numpy anidados -numpy_parent_incdir = run_command( - python_installation, '-c', 'import os, numpy; print(os.path.dirname(numpy.get_include()))', - check: true -).stdout().strip() - -# Obtenemos la ruta específica para los headers de f2py -f2py_incdir = run_command( - python_installation, '-c', 'import os, numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))', - check: true -).stdout().strip() - -# Creamos una lista de directorios de inclusión para usar en todas las extensiones -include_dirs = include_directories(numpy_incdir, numpy_parent_incdir, f2py_incdir, '.') - -# Obtenemos la ruta del directorio de bibliotecas de Python -py_libdir = python_installation.get_install_dir() / 'lib' - -f2py_exe = find_program('f2py', required: true) - -# Busca las librerías de sistema BLAS, LAPACK y OpenMP -lapack_dep = dependency('lapack', required: true) -blas_dep = dependency('blas', required: true) -openmp_dep = dependency('openmp', required: true) - -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' -symph_fortran_src = files( - 'FModules/symdynph_gq_new.f90', 'FModules/symm_base.f90', 'FModules/sgam_ph.f90', - 'FModules/invmat.f90', 'FModules/set_asr.f90', 'FModules/error_handler.f90', - 'FModules/io_global.f90', 'FModules/flush_unit.f90', 'FModules/symvector.f90', - 'FModules/fc_supercell_from_dyn.f90', 'FModules/set_tau.f90', - 'FModules/cryst_to_car.f90', 'FModules/recips.f90', 'FModules/q2qstar_out.f90', - 'FModules/rotate_and_add_dyn.f90', 'FModules/trntnsc.f90', 'FModules/star_q.f90', - 'FModules/eqvect.f90', 'FModules/symm_matrix.f90', 'FModules/from_matdyn.f90', - 'FModules/interp.f90', 'FModules/q_gen.f90', 'FModules/smallgq.f90', - 'FModules/symmetry_high_rank.f90', 'FModules/unwrap_tensors.f90', - 'FModules/get_latvec.f90', 'FModules/contract_two_phonon_propagator.f90', - 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', 'FModules/constants.f90', - 'FModules/eff_charge_interp.f90', 'FModules/get_translations.f90', - 'FModules/get_equivalent_atoms.f90' -) - -symph_wrapper = custom_target( - 'symph_f2py_wrapper', - input: symph_fortran_src, - output: 'symphmodule.c', - command: [ - f2py_exe, - '-m', 'symph', - '@INPUT@', - '--quiet', - '--lower' - ], - build_by_default: true -) - -py_symph_ext = python_installation.extension_module( - 'symph', - [symph_wrapper, symph_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp', '-fopenmp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'secondorder' -secondorder_fortran_src = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -secondorder_wrapper = custom_target( - 'secondorder_f2py_wrapper', - input: secondorder_fortran_src, - output: 'secondordermodule.c', - command: [f2py_exe, '-m', 'secondorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_secondorder_ext = python_installation.extension_module( - 'secondorder', - [secondorder_wrapper, secondorder_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, py_dep], - link_args: ['-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thirdorder' -thirdorder_fortran_src = files( - 'FModules/third_order_centering.f90', 'FModules/third_order_ASR.f90', - 'FModules/third_order_interpol.f90', 'FModules/third_order_dynbubble.f90' -) - -thirdorder_wrapper = custom_target( - 'thirdorder_f2py_wrapper', - input: thirdorder_fortran_src, - output: 'thirdordermodule.c', - command: [f2py_exe, '-m', 'thirdorder', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_thirdorder_ext = python_installation.extension_module( - 'thirdorder', - [thirdorder_wrapper, thirdorder_fortran_src], - install: true, - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, py_dep], - link_args: ['-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp'], - install_rpath: '$ORIGIN/..' -) - -# --- - -# Extensión 'thermal_conductivity' -cond_fortran_src = files( - 'FModules/get_scattering_q_grid.f90', 'FModules/third_order_cond.f90', - 'FModules/third_order_cond_centering.f90', 'FModules/get_lf.f90' -) - -cond_wrapper = custom_target( - 'thermal_conductivity_f2py_wrapper', - input: cond_fortran_src, - output: 'thermal_conductivitymodule.c', - command: [f2py_exe, '-m', 'thermal_conductivity', '@INPUT@', '--quiet', '--lower'], - build_by_default: true -) - -py_cond_ext = python_installation.extension_module( - 'thermal_conductivity', - [cond_wrapper, cond_fortran_src], - include_directories: include_dirs, - dependencies: [lapack_dep, blas_dep, openmp_dep, py_dep], - link_args: ['-fopenmp', '-L' + py_libdir, '-lnpy-c-api'], - fortran_args: ['-cpp', '-fopenmp'], - install: true, - install_rpath: '$ORIGIN/..' -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if python_installation.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -cc_modules_sources = files('CModules/LinAlg.c', wrapper_file) -py_cc_linalg_ext = python_installation.extension_module( - 'cc_linalg', - cc_modules_sources, - include_directories: include_directories(numpy_incdir, numpy_parent_incdir), - install: true, - dependencies: [py_dep], - install_rpath: '$ORIGIN/..' -) - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: python_installation.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -python_installation.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif From fe27eeee742447b9feab4cf2deb63c4ec8661dff Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 08:29:16 +0200 Subject: [PATCH 134/151] More clean --- meson.build.old_100a | 266 ------------------------------------ meson.build.old_static_test | 249 --------------------------------- 2 files changed, 515 deletions(-) delete mode 100644 meson.build.old_100a delete mode 100644 meson.build.old_static_test diff --git a/meson.build.old_100a b/meson.build.old_100a deleted file mode 100644 index 8fa2a10c..00000000 --- a/meson.build.old_100a +++ /dev/null @@ -1,266 +0,0 @@ -project('CellConstructor', - ['c','fortran'], - version: '1.5.0', - license: 'GPL', - default_options : [ - 'warning_level=1', - 'buildtype=release', - 'fortran_args=-O2', - 'fortran_args=-cpp' - ] - ) - -# --- System and Python Dependencies --- -# Encuentra las instalaciones necesarias -py = import('python').find_installation(pure: false) -py_dep = py.dependency() -fc = meson.get_compiler('fortran') - -# Dependencias adicionales -#mpi_dep = dependency('mpi') -# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. -lapack_dep = dependency('lapack') -blas_dep = dependency('blas') -openblas_dep = dependency('openblas') - -# --- MPI Detection --- -# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). -# Meson has a built-in MPI module. -mpi_args = [] -mpi_link_args = [] -mpi_compile_args = [] -has_mpi = false - -# Attempts to find the MPI dependency. -# You can specify a specific MPI compiler with the 'mpi_compiler' parameter -# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. -# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. -#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) -mpi_dep = dependency('mpi', required: false) - -if mpi_dep.found() - message('MPI environment detected correctly.') - has_mpi = true - # Meson handles adding appropriate flags. We just add the define. - # If you need specific MPI flags beyond what Meson adds automatically, - # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() - # and add them to extra_compile_args/extra_link_args. - mpi_compile_args += ['-D_MPI'] -else - # Here you can add warning logic if MPI is not found. - # Meson prints a warning if required: true and it is not found. - # For required: false, you can print your own warning. - warning('No MPI compiler found, please ensure MPI is installed and configured.') - warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') -endif -# Busca la librería quadmath, si está disponible -quadmath_dep = fc.find_library('quadmath', required: false) - -# --- CONFIGURACIÓN DE NUMPY --- -# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python -#incdir_numpy = run_command(py, -# ['-c', 'import numpy; print(numpy.get_include())'], -# check : true -#).stdout().strip() - -# f2py también requiere la cabecera fortranobject.h -#incdir_f2py = run_command(py, -# ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], -# check : true -#).stdout().strip() -# We need numpy's include directory for both C and Fortran modules -incdir_numpy = run_command(py, ['-c', 'import os; import numpy; print(os.path.join(os.path.dirname(numpy.__file__), "core", "include"))'], check : true).stdout().strip() -incdir_numpy_f2py = run_command(py, ['-c', 'import os; import numpy.f2py; print(os.path.join(os.path.dirname(numpy.f2py.__file__), "src"))'], check : true).stdout().strip() -incdirs = [incdir_numpy, incdir_numpy_f2py] -inc_np = include_directories(incdir_numpy) - -# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- - -# --- Definición de cada extensión de Python (Fortran) --- - -## symph module -#fortran_sources_symph = files( -# 'FModules/constants.f90', 'FModules/error_handler.f90', 'FModules/get_latvec.f90', -# 'FModules/io_global.f90', 'FModules/rotate_and_add_dyn.f90', 'FModules/smallgq.f90', -# 'FModules/symm_matrix.f90', 'FModules/contract_two_phonon_propagator.f90', -# 'FModules/fc_supercell_from_dyn.f90', 'FModules/get_q_grid_fast.f90', 'FModules/kind.f90', -# 'FModules/star_q.f90', 'FModules/symvector.f90', 'FModules/cryst_to_car.f90', -# 'FModules/flush_unit.f90', 'FModules/get_translations.f90', 'FModules/q2qstar_out.f90', -# 'FModules/set_asr.f90', 'FModules/symdynph_gq_new.f90', 'FModules/trntnsc.f90', -# 'FModules/eff_charge_interp.f90', 'FModules/from_matdyn.f90', 'FModules/interp.f90', -# 'FModules/q_gen.f90', 'FModules/set_tau.f90', 'FModules/symm_base.f90', -# 'FModules/unwrap_tensors.f90', 'FModules/eqvect.f90', -# 'FModules/get_equivalent_atoms.f90', 'FModules/invmat.f90', 'FModules/recips.f90', -# 'FModules/sgam_ph.f90', 'FModules/symmetry_high_rank.f90' -#) -# -#f2py_symph_target = custom_target('symph-f2py-wrapper', -# input: fortran_sources_symph, -# output: 'symph-f2py.c', -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'symph' -# ], -# install: false -#) -# -#symph_module = py.extension_module('symph', -# fortran_sources_symph, f2py_symph_target, -# include_directories: incdirs, -# dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], -# install: true -#) - -# secondorder module -fortran_sources_secondorder = files( - 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' -) - -f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', - input: fortran_sources_secondorder, - output: 'secondorder-f2py.c', - command: [ - py.full_path(), '-m', 'numpy.f2py', - '--backend', 'meson', - '--dep', 'mpi', - '--quiet', - '-c', - '@INPUT0@', - '-m', 'secondorder' - ], - install: false -) - -secondorder_module = py.extension_module('secondorder', - fortran_sources_secondorder, f2py_secondorder_target, - include_directories: incdirs, - dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], - install: true -) - -# #thirdorder module -#fortran_sources_thirdorder = files( -# 'FModules/third_order_ASR.f90', 'FModules/third_order_centering.f90', -# 'FModules/third_order_cond_centering.f90', 'FModules/third_order_cond.f90', -# 'FModules/third_order_dynbubble.f90', 'FModules/third_order_interpol.f90' -#) -# -## Generate the C wrapper with f2py using a custom target -#f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', -# input: fortran_sources_thirdorder, -# output: 'thirdorder-f2py.c', -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'thirdorder' -# ], -# install: false -#) -# -## Compile the module with the generated C wrapper and Fortran sources -#thirdorder_module = py.extension_module('thirdorder', -# fortran_sources_thirdorder, f2py_thirdorder_target, -# include_directories: incdirs, -# dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], -# install: true -#) - - -## thermal_conductivity module -#fortran_sources_thermal_conductivity = files( -# 'FModules/get_scattering_q_grid.f90', -# 'FModules/third_order_cond.f90', -# 'FModules/third_order_cond_centering.f90', -# 'FModules/get_lf.f90' -#) -# -#f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', -# input: fortran_sources_thermal_conductivity, -# output: 'thermal_conductivity-f2py.c', -# command: [ -# py.full_path(), '-m', 'numpy.f2py', -# '--backend', 'meson', -# '--dep', 'mpi', -# '--quiet', -# '-c', -# '@INPUT0@', -# '-m', 'thermal_conductivity' -# ], -# install: false -#) -# -#thermal_conductivity_module = py.extension_module('thermal_conductivity', -# fortran_sources_thermal_conductivity, f2py_thermal_conductivity_target, -# include_directories: incdirs, -# dependencies: [py_dep, mpi_dep, openblas_dep, lapack_dep], -# install: true -#) - - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if py.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -# Compilación del módulo C: cc_linalg -c_linalg_sources = [ - 'CModules/LinAlg.c', - wrapper_file -] - -py.extension_module('cc_linalg', - c_linalg_sources, - include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C - dependencies: py_dep, - install: true -) - - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: py.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -py.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif diff --git a/meson.build.old_static_test b/meson.build.old_static_test deleted file mode 100644 index 097055fb..00000000 --- a/meson.build.old_static_test +++ /dev/null @@ -1,249 +0,0 @@ -project('CellConstructor', - ['c','fortran'], - version: '1.5.0', - license: 'GPL', - default_options : [ - 'warning_level=1', - 'buildtype=release', - 'fortran_args=-O2', - 'fortran_args=-cpp' - ] - ) - -# --- System and Python Dependencies --- -# Encuentra las instalaciones necesarias -py = import('python').find_installation(pure: false) -py_dep = py.dependency() -fc = meson.get_compiler('fortran') - -# Dependencias adicionales -#mpi_dep = dependency('mpi') -# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. -lapack_dep = dependency('lapack') -blas_dep = dependency('blas') -openblas_dep = dependency('openblas', required: false) - -# --- MPI Detection --- -# This overrides the logic in os.environ["MPICC"] and os.popen("%s -show" % mpicc). -# Meson has a built-in MPI module. -mpi_args = [] -mpi_link_args = [] -mpi_compile_args = [] -has_mpi = false - -# Attempts to find the MPI dependency. -# You can specify a specific MPI compiler with the 'mpi_compiler' parameter -# or, if you want, a specific Fortran compiler with 'mpi_fortran_compiler'. -# For OpenMPI, IntelMPI, MPICH, etc., Meson usually finds it automatically. -#mpi_dep = dependency('mpi', required: false, language: ['c', 'fortran']) -mpi_dep = dependency('mpi', required: false) - -if mpi_dep.found() - message('MPI environment detected correctly.') - has_mpi = true - # Meson handles adding appropriate flags. We just add the define. - # If you need specific MPI flags beyond what Meson adds automatically, - # you can get them via mpi_dep.get_compile_args() and mpi_dep.get_link_args() - # and add them to extra_compile_args/extra_link_args. - mpi_compile_args += ['-D_MPI'] -else - # Here you can add warning logic if MPI is not found. - # Meson prints a warning if required: true and it is not found. - # For required: false, you can print your own warning. - warning('No MPI compiler found, please ensure MPI is installed and configured.') - warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') -endif -# Busca la librería quadmath, si está disponible -quadmath_dep = fc.find_library('quadmath', required: false) - -# --- CONFIGURACIÓN DE NUMPY --- -# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python -incdir_numpy = run_command(py, - ['-c', 'import numpy; print(numpy.get_include())'], - check : true -).stdout().strip() - -# f2py también requiere la cabecera fortranobject.h -incdir_f2py = run_command(py, - ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], - check : true -).stdout().strip() - -inc_np = include_directories(incdir_numpy, incdir_f2py) -# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- -#if openblas_dep.found() -# message('openblas environment detected correctly.') -# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep] -#else -# warning('No openblas found.') - list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep] -#endif -# --- Definición de cada extensión de Python (Fortran) --- - -# Extensión 'symph' - -# Compilación del módulo Fortran: symph -fortran_sources_symph = [ - 'FModules/constants.f90', - 'FModules/error_handler.f90', - 'FModules/get_latvec.f90', - 'FModules/io_global.f90', - 'FModules/rotate_and_add_dyn.f90', - 'FModules/smallgq.f90', - 'FModules/symm_matrix.f90', - 'FModules/contract_two_phonon_propagator.f90', - 'FModules/fc_supercell_from_dyn.f90', - 'FModules/get_q_grid_fast.f90', - 'FModules/kind.f90', - 'FModules/star_q.f90', - 'FModules/symvector.f90', - 'FModules/cryst_to_car.f90', - 'FModules/flush_unit.f90', - 'FModules/get_translations.f90', - 'FModules/q2qstar_out.f90', - 'FModules/set_asr.f90', - 'FModules/symdynph_gq_new.f90', - 'FModules/trntnsc.f90', - 'FModules/eff_charge_interp.f90', - 'FModules/from_matdyn.f90', - 'FModules/interp.f90', - 'FModules/q_gen.f90', - 'FModules/set_tau.f90', - 'FModules/symm_base.f90', - 'FModules/unwrap_tensors.f90', - 'FModules/eqvect.f90', - 'FModules/get_equivalent_atoms.f90', - 'FModules/invmat.f90', - 'FModules/recips.f90', - 'FModules/sgam_ph.f90', - 'FModules/symmetry_high_rank.f90' -] - -symph_fortran_static_lib = static_library('symph_lib', fortran_sources_symph) - -py.extension_module('symph', - fortran_sources_symph, - include_directories: inc_np, - dependencies: list_dep, - link_with: symph_fortran_static_lib, - install: true -) - -# Extensión 'secondorder' - -# Compilación del módulo Fortran: secondorder -fortran_sources_secondorder = [ - 'FModules/second_order_centering.f90', - 'FModules/second_order_ASR.f90' -] - -secondorder_fortran_static_lib = static_library('secondorder_lib', fortran_sources_secondorder) - -py.extension_module('secondorder', - fortran_sources_secondorder, - include_directories: inc_np, - dependencies: list_dep, - link_with: secondorder_fortran_static_lib, - install: true -) - -# Extensión 'thirdorder' - -# Compilación del módulo Fortran: thirdorder - -fortran_sources_thirdorder = [ - 'FModules/third_order_ASR.f90', - 'FModules/third_order_centering.f90', - 'FModules/third_order_cond_centering.f90', - 'FModules/third_order_cond.f90', - 'FModules/third_order_dynbubble.f90', - 'FModules/third_order_interpol.f90' -] - -thirdorder_fortran_static_lib = static_library('thirdorder_lib', fortran_sources_thirdorder) - -py.extension_module('thirdorder', - fortran_sources_thirdorder, - include_directories: inc_np, - dependencies: list_dep, - link_with: thirdorder_fortran_static_lib, - install: true -) - -# Extensión 'thermal_conductivity' - -fortran_sources_thermal_conductivity = [ -'FModules/get_scattering_q_grid.f90', -'FModules/third_order_cond.f90', -'FModules/third_order_cond_centering.f90', -'FModules/get_lf.f90' -] - -thermal_conductivity_fortran_static_lib = static_library('thermal_conductivity_lib', fortran_sources_thermal_conductivity) - -py.extension_module('thermal_conductivity', - fortran_sources_thermal_conductivity, - include_directories: inc_np, - dependencies: list_dep, - link_with: thermal_conductivity_fortran_static_lib, - install: true -) - -# --- Definición de la extensión C 'cc_linalg' --- -wrapper_file = '' -if py.version().version_compare('<3.0') - wrapper_file = 'CModules/wrapper.c' -else - wrapper_file = 'CModules/wrapper3.c' -endif - -# Compilación del módulo C: cc_linalg -c_linalg_sources = [ - 'CModules/LinAlg.c', - wrapper_file -] - -py.extension_module('cc_linalg', - c_linalg_sources, - include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C - dependencies: py_dep, - install: true -) - - -# --- Instalación del paquete de Python 'cellconstructor' --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: py.get_install_dir() / 'cellconstructor', -) - -install_data( - 'cellconstructor/SymData/15.dat', 'cellconstructor/SymData/36_red.dat', 'cellconstructor/SymData/36.dat', - 'cellconstructor/SymData/60.dat', 'cellconstructor/SymData/64.bcs', 'cellconstructor/SymData/64.dat', - 'cellconstructor/SymData/convert_sym.py', - install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' -) - -# --- Instalación de los scripts ejecutables --- -py.install_sources([ - 'scripts/symmetrize_dynmat.py', - 'scripts/cellconstructor_test.py', - 'scripts/view_scf_atoms.py' -]) - -# Set the tests by pytest. -pytest_exe = find_program('pytest', required: false) - -if pytest_exe.found() - test('pytest', pytest_exe, - args : ['-v'], - workdir : meson.project_source_root() - ) -else - message('pytest no encontrado; se omiten tests con pytest.') -endif From 14ff17c227b36aab81a0d8a9d8b6692a23174dd1 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 09:05:43 +0200 Subject: [PATCH 135/151] Cleaning code --- meson.build | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index e69e8a89..3575106a 100644 --- a/meson.build +++ b/meson.build @@ -86,24 +86,14 @@ incdir_f2py = run_command(py, inc_np = include_directories(incdir_numpy, incdir_f2py) -# ===== INICIO DE LA SOLUCIÓN (VERSIÓN MODERNA) ===== -# Obtenemos la ruta base de la instalación de NumPy -#numpy_path = run_command(py, -# ['-c', 'import numpy; print(numpy.__path__[0])'], -# check: true -#).stdout().strip() -# Construimos la ruta completa al archivo fuente de f2py -#f2py_c_source = join_paths(numpy_path, 'f2py', 'src', 'fortranobject.c') -# ===== FIN DE LA SOLUCIÓN ===== - # --- FIN DE LA CONFIGURACIÓN DE NUMPY --- -#if openblas_dep.found() -# message('openblas environment detected correctly.') -# list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep, blas_dep] -#else -# warning('No openblas found.') +if openblas_dep.found() + message('openblas environment detected correctly.') + list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep, blas_dep] +else + warning('No openblas found.') list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep, blas_dep] -#endif +endif # --- Definición de cada extensión de Python (Fortran) --- # Extensión 'symph' From ff49eab6a496ffdfb4685fc67b338be87f1b0230 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 10:13:24 +0200 Subject: [PATCH 136/151] Update wrapper3.c to new numpy and python versions --- CModules/wrapper3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CModules/wrapper3.c b/CModules/wrapper3.c index 16bfeea3..266511c4 100644 --- a/CModules/wrapper3.c +++ b/CModules/wrapper3.c @@ -45,13 +45,15 @@ static PyObject * gram_schmidt(PyObject* self, PyObject* args) { int NewDim; PyObject * npy_vectors; - + // Get the path dir if (!PyArg_ParseTuple(args, "Oii", &npy_vectors, &N_vectors, &N_dim)) return NULL; // Get the C pointers to the data of the numpy ndarray - vectors = (double*) PyArray_DATA(npy_vectors); + //vectors = (double*) PyArray_DATA(npy_vectors); + // Fix for new version of numpy and python + vectors = (double*) PyArray_DATA((PyArrayObject*) npy_vectors); NewDim = GramSchmidt(vectors, N_dim, N_vectors); From ce20cbb1d1611247849c72166681d22778d564a3 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 12:23:39 +0200 Subject: [PATCH 137/151] Translation of comments into English --- meson.build | 56 +++++++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/meson.build b/meson.build index 3575106a..3b0d682e 100644 --- a/meson.build +++ b/meson.build @@ -11,18 +11,18 @@ project('CellConstructor', ] ) -# --- Opciones de compilación --- +# --- Compilation options --- use_mkl = get_option('use_mkl') # --- System and Python Dependencies --- -# Encuentra las instalaciones necesarias +# Find the necessary installations py = import('python').find_installation(pure: false) py_dep = py.dependency() fc = meson.get_compiler('fortran') -# Dependencias adicionales +# Additional dependencies -# Las librerías LAPACK y BLAS son esenciales para las operaciones matriciales de Fortran. +# The LAPACK and BLAS libraries are essential for Fortran matrix operations. #lapack_dep = dependency('lapack') #blas_dep = dependency('blas') openblas_dep = dependency('openblas', required: false) @@ -35,7 +35,7 @@ else blas_dep = dependency('blas', required: true) endif -# La dependencia openmp es necesaria para thermal_transport +# The openmp dependency is necessary for thermal_transport openmp_dep = dependency('openmp', required: true) # --- MPI Detection --- @@ -68,17 +68,17 @@ else warning('No MPI compiler found, please ensure MPI is installed and configured.') warning('If you wish to activate MPI acceleration, consider setting MPICC environment variable or providing Meson with appropriate flags.') endif -# Busca la librería quadmath, si está disponible +# Find the quadmath library, if available quadmath_dep = fc.find_library('quadmath', required: false) -# --- CONFIGURACIÓN DE NUMPY --- -# Obtiene la ruta de los directorios de cabecera de NumPy y f2py usando el comando de Python +# --- NUMPY CONFIGURATION --- +# Gets the path to the NumPy and f2py header directories using the Python command incdir_numpy = run_command(py, ['-c', 'import numpy; print(numpy.get_include())'], check : true ).stdout().strip() -# f2py también requiere la cabecera fortranobject.h +# f2py also requires the fortranobject.h header incdir_f2py = run_command(py, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], check : true @@ -86,7 +86,7 @@ incdir_f2py = run_command(py, inc_np = include_directories(incdir_numpy, incdir_f2py) -# --- FIN DE LA CONFIGURACIÓN DE NUMPY --- +# --- END OF NUMPY CONFIGURATION --- if openblas_dep.found() message('openblas environment detected correctly.') list_dep = [py_dep, mpi_dep, quadmath_dep, openblas_dep, lapack_dep, blas_dep] @@ -94,11 +94,11 @@ else warning('No openblas found.') list_dep = [py_dep, mpi_dep, quadmath_dep, lapack_dep, blas_dep] endif -# --- Definición de cada extensión de Python (Fortran) --- +# --- Definition of each Python extension (Fortran) --- -# Extensión 'symph' +# 'symph' extension -# Compilación del módulo Fortran: symph +# Compilation of the Fortran module: symph fortran_sources_symph = [ 'FModules/constants.f90', 'FModules/error_handler.f90', @@ -147,16 +147,14 @@ py.extension_module('symph', [ fortran_sources_symph, f2py_symph_target], -# f2py_c_source, # <- Cambio aplicado -# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true ) -# Extensión 'secondorder' +# 'secondorder' extension -# Compilación del módulo Fortran: secondorder +# Compilation of the Fortran module: secondorder fortran_sources_secondorder = [ 'FModules/second_order_centering.f90', 'FModules/second_order_ASR.f90' @@ -174,16 +172,14 @@ py.extension_module('secondorder', [ fortran_sources_secondorder, f2py_secondorder_target], -# f2py_c_source, # <- Cambio aplicado -# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true ) -# Extensión 'thirdorder' +# 'thirdorder' extension -# Compilación del módulo Fortran: thirdorder +# Compilation of the Fortran module: thirdorder fortran_sources_thirdorder = [ 'FModules/third_order_ASR.f90', @@ -206,14 +202,12 @@ py.extension_module('thirdorder', [ fortran_sources_thirdorder, f2py_thirdorder_target], -# f2py_c_source, # <- Cambio aplicado -# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true ) -# Extensión 'thermal_conductivity' +# 'thermal_conductivity' extension fortran_sources_thermal_conductivity = [ 'FModules/get_scattering_q_grid.f90', @@ -234,14 +228,12 @@ py.extension_module('thermal_conductivity', [ fortran_sources_thermal_conductivity, f2py_thermal_conductivity_target], -# f2py_c_source, # <- Cambio aplicado -# c_args: ['-DF2PY_SETUP_RUN'], # <--- Solucinar "_npy_f2py_ARRAY_API" include_directories: inc_np, dependencies: list_dep, install: true ) -# --- Definición de la extensión C 'cc_linalg' --- +# --- Definition of the 'cc_linalg' C extension --- wrapper_file = '' if py.version().version_compare('<3.0') wrapper_file = 'CModules/wrapper.c' @@ -249,7 +241,7 @@ else wrapper_file = 'CModules/wrapper3.c' endif -# Compilación del módulo C: cc_linalg +# Compilation of the C module: cc_linalg c_linalg_sources = [ 'CModules/LinAlg.c', wrapper_file @@ -257,13 +249,13 @@ c_linalg_sources = [ py.extension_module('cc_linalg', c_linalg_sources, - include_directories: inc_np, # Se añade la cabecera de NumPy para el módulo de C + include_directories: inc_np, # Add the NumPy header for the C module dependencies: py_dep, install: true ) -# --- Instalación del paquete de Python 'cellconstructor' --- +# --- Installation of the 'cellconstructor' Python package --- install_data( 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', @@ -281,7 +273,7 @@ install_data( install_dir: py.get_install_dir() / 'cellconstructor' / 'SymData' ) -# --- Instalación de los scripts ejecutables --- +# --- Installation of executable scripts --- py.install_sources([ 'scripts/symmetrize_dynmat.py', 'scripts/cellconstructor_test.py', @@ -297,5 +289,5 @@ if pytest_exe.found() workdir : meson.project_source_root() ) else - message('pytest no encontrado; se omiten tests con pytest.') + message('pytest not found; pytest tests are skipped.') endif From f521112a7445b949d9316acb4dddfcb54022481a Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:12:17 +0200 Subject: [PATCH 138/151] From "python setup.py install --user" to "meson install -C builddir" --- .github/workflows/pythonapp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 5d97c021..97d40002 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -36,7 +36,8 @@ jobs: sudo apt-get install gfortran libblas-dev liblapack-dev - name: Install the package run: | - python setup.py install --user + # python setup.py install --user + meson install -C builddir - name: Test with pytest run: | pip install pytest From 489f28f69fe33d9bb7ab50a66b945c551eea3a94 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:15:03 +0200 Subject: [PATCH 139/151] Test by "removing" setup.py (setup.py -> old_setup.py) --- setup.py => old_setup.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename setup.py => old_setup.py (100%) diff --git a/setup.py b/old_setup.py similarity index 100% rename from setup.py rename to old_setup.py From 8d0a2ed9065c5511bab0d8f1cb6b52380b06c83c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:17:56 +0200 Subject: [PATCH 140/151] Test with "pip install -e ." --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 97d40002..feff823b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -37,7 +37,7 @@ jobs: - name: Install the package run: | # python setup.py install --user - meson install -C builddir + pip install -e . - name: Test with pytest run: | pip install pytest From 989c5401e05312e0f8b1f9cff9015b0324476e03 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:26:26 +0200 Subject: [PATCH 141/151] It needs numpy for 'pip' installation --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b5b79213..2c63b6ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ # 'meson-python' is the backend that translates pip calls to Meson. # 'meson' is the actual build tool. # 'ninja' is the low-level build system that Meson uses by default for rapid compilation. -requires = ["meson-python>=0.13.0", "meson>=1.0.0", "ninja>=1.10", "meson-python"] +requires = ["meson-python>=0.13.0", "meson>=1.1.0", "ninja>=1.10", "meson-python"."numpy>=1.20.0"] build-backend = "mesonpy" [project] From ba2a99e124d0a4e1507cde824a190dc833d66410 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:29:06 +0200 Subject: [PATCH 142/151] Sorry, typo!! --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2c63b6ef..3f9d3471 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ # 'meson-python' is the backend that translates pip calls to Meson. # 'meson' is the actual build tool. # 'ninja' is the low-level build system that Meson uses by default for rapid compilation. -requires = ["meson-python>=0.13.0", "meson>=1.1.0", "ninja>=1.10", "meson-python"."numpy>=1.20.0"] +requires = ["meson-python>=0.13.0", "meson>=1.1.0", "ninja>=1.10", "meson-python", "numpy>=1.20.0"] build-backend = "mesonpy" [project] From ccea1acff34c08697a458f780fe93eac7a72ddf4 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:39:37 +0200 Subject: [PATCH 143/151] Taking out the editable in pip install --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index feff823b..53521a4f 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -37,7 +37,7 @@ jobs: - name: Install the package run: | # python setup.py install --user - pip install -e . + pip install . - name: Test with pytest run: | pip install pytest From da3aecff38719b70504cc39e93d310c6d8bc84f6 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:53:31 +0200 Subject: [PATCH 144/151] Lets see if meson can work with f2py internally without wrappers. --- meson.build | 80 ++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/meson.build b/meson.build index 3b0d682e..e7d602f6 100644 --- a/meson.build +++ b/meson.build @@ -135,18 +135,18 @@ fortran_sources_symph = [ 'FModules/symmetry_high_rank.f90' ] ## Generate the C wrapper with f2py using a custom target -f2py_symph_target = custom_target('symph-f2py-wrapper', - input: fortran_sources_symph, - output: ['symphmodule.c','symph-f2pywrappers.f','symph-f2pywrappers2.f90'], -# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], - command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], - install: false -) +#f2py_symph_target = custom_target('symph-f2py-wrapper', +# input: fortran_sources_symph, +# output: ['symphmodule.c','symph-f2pywrappers.f','symph-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], +# install: false +#) py.extension_module('symph', - [ +# [ fortran_sources_symph, - f2py_symph_target], +# f2py_symph_target], include_directories: inc_np, dependencies: list_dep, install: true @@ -160,18 +160,18 @@ fortran_sources_secondorder = [ 'FModules/second_order_ASR.f90' ] ## Generate the C wrapper with f2py using a custom target -f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', - input: fortran_sources_secondorder, - output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], -# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], - command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], - install: false -) +#f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', +# input: fortran_sources_secondorder, +# output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], +# install: false +#) py.extension_module('secondorder', - [ +# [ fortran_sources_secondorder, - f2py_secondorder_target], +# f2py_secondorder_target], include_directories: inc_np, dependencies: list_dep, install: true @@ -190,18 +190,18 @@ fortran_sources_thirdorder = [ 'FModules/third_order_interpol.f90' ] ## Generate the C wrapper with f2py using a custom target -f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', - input: fortran_sources_thirdorder, - output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], -# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], - command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], - install: false -) +#f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', +# input: fortran_sources_thirdorder, +# output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], +# install: false +#) py.extension_module('thirdorder', - [ +# [ fortran_sources_thirdorder, - f2py_thirdorder_target], +# f2py_thirdorder_target], include_directories: inc_np, dependencies: list_dep, install: true @@ -216,18 +216,18 @@ fortran_sources_thermal_conductivity = [ 'FModules/get_lf.f90' ] ## Generate the C wrapper with f2py using a custom target -f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', - input: fortran_sources_thermal_conductivity, - output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], -# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], - command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], - install: false -) +#f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', +# input: fortran_sources_thermal_conductivity, +# output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], +## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], +# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], +# install: false +#) py.extension_module('thermal_conductivity', - [ +# [ fortran_sources_thermal_conductivity, - f2py_thermal_conductivity_target], +# f2py_thermal_conductivity_target], include_directories: inc_np, dependencies: list_dep, install: true From ced59c9a8ab610d2da06cc5761de4aa4951e9f8c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 14:59:25 +0200 Subject: [PATCH 145/151] Change the installation method of the python modules. --- meson.build | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index e7d602f6..660e9c60 100644 --- a/meson.build +++ b/meson.build @@ -256,14 +256,42 @@ py.extension_module('cc_linalg', # --- Installation of the 'cellconstructor' Python package --- -install_data( - 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', - 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', - 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', - 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', - 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', - 'cellconstructor/Timer.py', - install_dir: py.get_install_dir() / 'cellconstructor', +#install_data( +# 'cellconstructor/__init__.py', 'cellconstructor/AnharmonicForceFields.py', 'cellconstructor/calculators.py', +# 'cellconstructor/Methods.py', 'cellconstructor/Phonons.py', 'cellconstructor/Spectral.py', +# 'cellconstructor/ThermalConductivity.py', 'cellconstructor/Units.py', 'cellconstructor/Bands.py', +# 'cellconstructor/ForceTensor.py', 'cellconstructor/Manipulate.py', 'cellconstructor/Moro_object.py', +# 'cellconstructor/Settings.py', 'cellconstructor/Structure.py', 'cellconstructor/symmetries.py', +# 'cellconstructor/Timer.py', +# install_dir: py.get_install_dir() / 'cellconstructor', +#) +py.install_sources( + [ + 'cellconstructor/__init__.py', + 'cellconstructor/AnharmonicForceFields.py', + 'cellconstructor/Bands.py', + 'cellconstructor/calculators.py', + 'cellconstructor/ForceTensor.py', + 'cellconstructor/Manipulate.py', + 'cellconstructor/Methods.py', + 'cellconstructor/Moro_object.py', + 'cellconstructor/Phonons.py', + 'cellconstructor/Settings.py', + 'cellconstructor/Spectral.py', + 'cellconstructor/Structure.py', + 'cellconstructor/symmetries.py', + 'cellconstructor/SymData/15.dat', + 'cellconstructor/SymData/36_red.dat', + 'cellconstructor/SymData/36.dat', + 'cellconstructor/SymData/60.dat', + 'cellconstructor/SymData/64.bcs', + 'cellconstructor/SymData/64.dat', + 'cellconstructor/SymData/convert_sym.py', + 'cellconstructor/ThermalConductivity.py', + 'cellconstructor/Timer.py', + 'cellconstructor/Units.py' + ], + subdir: 'cellconstructor' ) install_data( From f4c672711cdfe2c9a4b549141b83dcfebf09c66e Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 15:56:11 +0200 Subject: [PATCH 146/151] Maybe it needs fortranobject_c --- meson.build | 84 +++++++++++++++++++++-------------------- meson.build.secondorder | 4 +- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/meson.build b/meson.build index 660e9c60..495584c9 100644 --- a/meson.build +++ b/meson.build @@ -85,6 +85,10 @@ incdir_f2py = run_command(py, ).stdout().strip() inc_np = include_directories(incdir_numpy, incdir_f2py) +np_dep = declare_dependency(include_directories: inc_np) + +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' # --- END OF NUMPY CONFIGURATION --- if openblas_dep.found() @@ -135,18 +139,18 @@ fortran_sources_symph = [ 'FModules/symmetry_high_rank.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_symph_target = custom_target('symph-f2py-wrapper', -# input: fortran_sources_symph, -# output: ['symphmodule.c','symph-f2pywrappers.f','symph-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], -# install: false -#) +f2py_symph_target = custom_target('symph-f2py-wrapper', + input: fortran_sources_symph, + output: ['symphmodule.c','symph-f2pywrappers.f','symph-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'symph'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'symph', '--lower'], + install: false +) py.extension_module('symph', -# [ + [ fortran_sources_symph, -# f2py_symph_target], + f2py_symph_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, install: true @@ -160,18 +164,18 @@ fortran_sources_secondorder = [ 'FModules/second_order_ASR.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', -# input: fortran_sources_secondorder, -# output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], -# install: false -#) +f2py_secondorder_target = custom_target('secondorder-f2py-wrapper', + input: fortran_sources_secondorder, + output: ['secondordermodule.c','secondorder-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'secondorder'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'secondorder', '--lower'], + install: false +) py.extension_module('secondorder', -# [ + [ fortran_sources_secondorder, -# f2py_secondorder_target], + f2py_secondorder_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, install: true @@ -190,18 +194,18 @@ fortran_sources_thirdorder = [ 'FModules/third_order_interpol.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', -# input: fortran_sources_thirdorder, -# output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], -# install: false -#) +f2py_thirdorder_target = custom_target('thirdorder-f2py-wrapper', + input: fortran_sources_thirdorder, + output: ['thirdordermodule.c','thirdorder-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thirdorder'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thirdorder', '--lower'], + install: false +) py.extension_module('thirdorder', -# [ + [ fortran_sources_thirdorder, -# f2py_thirdorder_target], + f2py_thirdorder_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, install: true @@ -216,18 +220,18 @@ fortran_sources_thermal_conductivity = [ 'FModules/get_lf.f90' ] ## Generate the C wrapper with f2py using a custom target -#f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', -# input: fortran_sources_thermal_conductivity, -# output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], -## command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', -## '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], -# command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], -# install: false -#) +f2py_thermal_conductivity_target = custom_target('thermal_conductivity-f2py-wrapper', + input: fortran_sources_thermal_conductivity, + output: ['thermal_conductivitymodule.c','thermal_conductivity-f2pywrappers2.f90'], +# command: [py.full_path(), '-m', 'numpy.f2py', '--backend', 'meson', +# '--dep', 'mpi', '--quiet', '-c', '@INPUT0@', '-m', 'thermal_conductivity'], + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'thermal_conductivity', '--lower'], + install: false +) py.extension_module('thermal_conductivity', -# [ + [ fortran_sources_thermal_conductivity, -# f2py_thermal_conductivity_target], + f2py_thermal_conductivity_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, install: true diff --git a/meson.build.secondorder b/meson.build.secondorder index a4e459d9..1152aba1 100644 --- a/meson.build.secondorder +++ b/meson.build.secondorder @@ -14,12 +14,12 @@ py_dep = py.dependency() incdir_numpy = run_command(py, ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], check : true -).stdout().strip() +).stdout().strip() # -> /home/diego/miniforge3/envs/sscha_env/lib/python3.13/site-packages/numpy/_core/include incdir_f2py = run_command(py, ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], check : true -).stdout().strip() +).stdout().strip() # -> /home/diego/miniforge3/envs/sscha_env/lib/python3.13/site-packages/numpy/f2py/src inc_np = include_directories(incdir_numpy) np_dep = declare_dependency(include_directories: inc_np) From bb7a7d769d1f51d772c83faea6d252f2415fd14f Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Fri, 19 Sep 2025 16:04:04 +0200 Subject: [PATCH 147/151] Include omp for thermal_conductivity --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 495584c9..969dbd65 100644 --- a/meson.build +++ b/meson.build @@ -153,6 +153,7 @@ py.extension_module('symph', f2py_symph_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, +# link_args: ['-L' + py.get_install_dir() / 'numpy' / 'f2py' / 'src' / 'fortranobject.c', '-lfortranobject'], install: true ) @@ -178,6 +179,7 @@ py.extension_module('secondorder', f2py_secondorder_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, +# link_args: ['-L' + py.get_install_dir() / 'numpy' / 'f2py' / 'src' / 'fortranobject.c', '-lfortranobject'], install: true ) @@ -208,6 +210,7 @@ py.extension_module('thirdorder', f2py_thirdorder_target, fortranobject_c], include_directories: inc_np, dependencies: list_dep, +# link_args: ['-L' + py.get_install_dir() / 'numpy' / 'f2py' / 'src' / 'fortranobject.c', '-lfortranobject'], install: true ) @@ -233,7 +236,8 @@ py.extension_module('thermal_conductivity', fortran_sources_thermal_conductivity, f2py_thermal_conductivity_target, fortranobject_c], include_directories: inc_np, - dependencies: list_dep, + dependencies: [list_dep, openmp_dep], +# link_args: ['-L' + py.get_install_dir() / 'numpy' / 'f2py' / 'src' / 'fortranobject.c', '-lfortranobject'], install: true ) From 4256c7f599bfd445c538290d610949fbf1a8f7af Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 22 Sep 2025 09:25:15 +0200 Subject: [PATCH 148/151] Set the correct repository and issues links --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3f9d3471..b05cc195 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,9 +39,9 @@ dependencies = [ [project.urls] Homepage = "https://sscha.eu/" -Repository = "https://github.com/mesonepigreco/CellConstructor" # Puede ser el mismo que Homepage +Repository = "https://github.com/SSCHAcode/CellConstructor" # Puede ser el mismo que Homepage # Documentation = "https://documentacion.readthedocs.io/" -# Issues = "https://github.com/mesonepigreco/CellConstructor/issues" +Issues = "https://github.com/SSCHAcode/CellConstructor/issues" # --- Meson-python specific configuration (Optional but useful) --- From f73f58be2d4e7962b8465c52b47c0deca7ea6772 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 25 Sep 2025 13:45:51 +0200 Subject: [PATCH 149/151] Advanced configuration with Meson --- CellConstructor Installation Guide.md | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CellConstructor Installation Guide.md b/CellConstructor Installation Guide.md index 2e93e76c..67deda5e 100644 --- a/CellConstructor Installation Guide.md +++ b/CellConstructor Installation Guide.md @@ -119,3 +119,56 @@ python ``` If no ImportError messages appear, the installation was successful. + +### Advanced Configuration: Using Meson Build Options + +Meson allows you to configure the build using options, which act like on/off switches or settings. You can pass these options during installation using the same --config-settings flag. This is useful for enabling features or changing the build type. + +The general syntax is -D=. + +# Example 1: Creating a Debug Build + +By default, the project is built in release mode for performance. To build with debugging symbols and fewer optimizations (useful for development), you can change the built-in buildtype option. + +```bash +pip install . --config-settings=meson-args="-Dbuildtype=debug" +``` + +# Example 2: Enabling Project-Specific Features (like MKL) + +This project has an option to use Intel's Math Kernel Library (MKL) instead of standard BLAS/LAPACK. This is controlled by the use_mkl option defined in meson.options. + +To enable it, set it to true during installation: + +```bash +pip install . --config-settings=meson-args="-Duse_mkl=true" +``` + +## Combining Multiple Options + +You can combine multiple Meson arguments by separating them with commas inside the string. + +# Example: A debug build using MKL: + +```bash +pip install . --config-settings=meson-args="-Dbuildtype=debug,-Duse_mkl=true" +``` + +# Important: Reconfiguring a Build + +If you have already built the project and want to change a configuration option, pip might not automatically rebuild it. It is best practice to first clean any previous build artifacts. + +You can force a clean rebuild by uninstalling the package and manually deleting the build directory before running the new install command. + +1. Uninstall the package +```bash +pip uninstall CellConstructor +``` +2. (Optional but recommended) Remove the build directory +```bash +rm -rf build/ +``` +3. Reinstall with the new options +```bash +pip install . --config-settings=meson-args="-Dnew_option=value" +``` From 849e14493372d2346ff2494cc33abdf84e115b5c Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Thu, 25 Sep 2025 13:54:50 +0200 Subject: [PATCH 150/151] How to Install with a Specific Compiler Path --- CellConstructor Installation Guide.md | 90 +++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/CellConstructor Installation Guide.md b/CellConstructor Installation Guide.md index 67deda5e..2d3c6a37 100644 --- a/CellConstructor Installation Guide.md +++ b/CellConstructor Installation Guide.md @@ -120,6 +120,96 @@ python If no ImportError messages appear, the installation was successful. +### How to Install with a Specific Compiler Path + +This guide explains how to compile and install this Meson-based Python project when you need to use specific C, C++, or Fortran compilers that are not the default ones in your system's PATH. +## Prerequisites + +Before you begin, ensure you have the following installed: + +* Python 3.8+ and pip + +* The build dependencies for this project, which can be installed via pip: + +```bash + pip install meson ninja +``` + +* The C, C++, and Fortran compilers you intend to use. + +## Method 1: Using Environment Variables (Recommended for most cases) + +Meson automatically detects compilers using standard environment variables. You can set these variables before running the installation command. This is the simplest way to specify a compiler for a single build. + +The key variables are: + +```bash + CC: Specifies the C compiler executable. + + CXX: Specifies the C++ compiler executable. + + FC: Specifies the Fortran compiler executable. +``` + +# Step-by-Step Instructions + +1. Open your terminal. All commands must be run in the same session, as environment variables are typically not permanent. + +2. Set the environment variables to point to your desired compilers. + + Example for C (using a specific gcc): + +```bash + export CC=/path/to/my/custom/gcc +``` + + Example for Fortran (using a specific gfortran): + +```bash + export FC=/path/to/my/custom/gfortran +``` + +3. Combine them as needed. For this project, you will likely need to set CC and FC. + +```bash + # Example using compilers from a specific toolchain + export CC=/usr/local/bin/gcc-11 + export FC=/usr/local/bin/gfortran-11 +``` + +4. Run the pip installation. With the variables set, run pip install from the project's root directory. pip will pass the environment variables down to Meson. + +```bash + # Ensure you are in the project's root directory (where pyproject.toml is) + pip install . +``` + +## Method 2: Using a Meson Cross File (Advanced & Reproducible) + +For a more permanent or reproducible setup (e.g., in CI/CD pipelines or complex environments), a Meson "cross file" is the best practice. This file explicitly defines the toolchain. + +# Step-by-Step Instructions + +1. Create a cross file. In your project's root directory, create a file named native-toolchain.ini. + +2. Edit the file to specify the paths to your compilers in the [binaries] section. + + Example native-toolchain.ini: + +```bash + # native-toolchain.ini + [binaries] + c = '/path/to/my/custom/gcc' + fortran = '/path/to/my/custom/gfortran' +``` + +3. Run the pip installation with meson-args. + +```bash + pip install . --config-settings=meson-args="--native-file=native-toolchain.ini" +``` + + ### Advanced Configuration: Using Meson Build Options Meson allows you to configure the build using options, which act like on/off switches or settings. You can pass these options during installation using the same --config-settings flag. This is useful for enabling features or changing the build type. From 756705b0d86224603503fce5af8e8184a8dca2d2 Mon Sep 17 00:00:00 2001 From: diegomartinez2 Date: Mon, 29 Sep 2025 13:16:57 +0200 Subject: [PATCH 151/151] New CellConstructor Installation Guide (following 'mesonepigreco' review) --- CellConstructor Installation Guide.md | 250 ++++++-------------------- 1 file changed, 56 insertions(+), 194 deletions(-) diff --git a/CellConstructor Installation Guide.md b/CellConstructor Installation Guide.md index 2d3c6a37..f9f9bd3f 100644 --- a/CellConstructor Installation Guide.md +++ b/CellConstructor Installation Guide.md @@ -1,264 +1,126 @@ -# **CellConstructor Installation Guide** +# CellConstructor Installation Guide -This guide provides step-by-step instructions to compile and install the CellConstructor library and its dependencies. The project uses the Meson build system to compile C and Fortran extensions for Python. -We recommend using a Conda environment to manage the dependencies. +This guide provides step-by-step instructions to compile and install the CellConstructor library. The project uses the Meson build system to compile C and Fortran extensions for Python. -## **Prerequisites** +## Recommended Installation: Conda / Mamba -You will need a working C and Fortran compiler on your system, as well as git to clone the repository. -On a Debian/Ubuntu based system, you can install them with: -```bash -sudo apt-get update -sudo apt-get install build-essential gfortran git -``` - -On a RedHat/Fedora/CentOS system, you can install them with: -```bash -sudo dnf groupinstall "Development Tools" -sudo dnf install gfortran git -``` - -## **Step 1: Set up the Conda Environment** - -First, we will create a dedicated Conda environment to ensure all dependencies are isolated and have the correct versions. - -1. Create a new Conda environment: - We will name the environment sscha\_env and use Python 3.10. You can choose a different Python version if needed (the project requires \>=3.8). - ```bash - conda create -n sscha_env python=3.10 - ``` - -2. Activate the environment: - You must activate the environment before proceeding with the installation. - ```bash - conda activate sscha_env - ``` +The easiest and most reproducible way to install CellConstructor is by using a Conda environment. We strongly recommend using *micromamba* or *mamba* as they are significantly faster. This method installs all the required compilers, libraries, and Python packages inside an isolated environment, avoiding the need to modify your base system. -## **Step 2: Install Dependencies** +### Step 1: Create and Activate the Environment -Now we will install the necessary build tools, libraries, and Python packages into our active Conda environment. +1. Install Conda/Mamba. If you don't have it, we recommend installing micromamba. -1. Install system and build dependencies with Conda: - This command installs the core libraries needed for compilation (BLAS, LAPACK, MPI) and the build system itself (Meson, Ninja). - ```bash - conda install -c conda-forge openblas lapack openmpi meson ninja - ``` +2. Create the environment. Open your terminal and run the following command. It will create a new environment named sscha with all the necessary dependencies. - *Note: openblas provides optimized implementations for blas and lapack.* -2. Install Python dependencies with pip: - Use pip to install the Python packages listed in requirements.txt. - ```bash - pip install -r requirements.txt - ``` - -## **Step 3: Clone the Repository** - -If you haven't already, clone the project repository from its source. ```bash -git clone -cd CellConstructor # Or your repository's root directory +micromamba create -n sscha python=3.12 gfortran libblas lapack openmpi openmpi-mpicc pkg-config pip numpy scipy spglib=2.2 ``` -## **Step 4: Compile and Install the Project** - -With the environment set up and all dependencies installed, you can now build and install CellConstructor using pip in editable mode or standard mode. The pyproject.toml file tells pip to use meson-python as the build backend. - -### **Recommended Method: Editable Install** +* Python Version: We use Python 3.12. Newer versions are not yet supported due to a dependency constraint from *spglib <= 2.2.* -An "editable" install is highly recommended for developers. It allows you to modify the source code and have the changes reflected immediately without needing to reinstall. -```bash -pip install -e . -``` - -### **Standard Method: Regular Install** +* pkg-config: This package is essential. Meson requires it to correctly detect the BLAS and LAPACK libraries provided by Conda. -This method is suitable for users who just want to use the library without modifying its source code. -```bash -pip install . -``` +3. Activate the environment. You must activate the environment before proceeding. -The pip command will automatically invoke Meson, which will configure the project, compile the C and Fortran extensions, and install the complete package into your Conda environment. - -## **Build Options** - -The project includes custom build options that can be configured. - -### **Using Intel MKL** - -If you have the Intel Math Kernel Library (MKL) installed and wish to use it for BLAS/LAPACK, you can enable it during the build process. - -1. **Ensure MKL is installed in your Conda environment:** - ```bash - conda install mkl mkl-devel - ``` - -2. Install the project passing the use\_mkl option: - You can pass Meson options through pip's \--config-settings flag. - ```bash - pip install . --config-settings=--setup-args=-Duse_mkl=true - ``` - - Or for an editable install: - ```bash - pip install -e . --config-settings=--setup-args=-Duse_mkl=true - ``` - -## **How to Verify the Installation** - -After the installation is complete, you can verify that the modules were built correctly by opening a Python interpreter and importing them: -```bash -python - ->>> import cellconstructor ->>> import cc_linalg ->>> import symph ->>> import secondorder ->>> import thirdorder - ->>> print("Successfully imported all CellConstructor modules\!") +```bash +micromamba activate sscha ``` -If no ImportError messages appear, the installation was successful. - -### How to Install with a Specific Compiler Path - -This guide explains how to compile and install this Meson-based Python project when you need to use specific C, C++, or Fortran compilers that are not the default ones in your system's PATH. -## Prerequisites - -Before you begin, ensure you have the following installed: - -* Python 3.8+ and pip +### Step 2: Clone the Repository (if not done) -* The build dependencies for this project, which can be installed via pip: +If you don't have the source code locally, clone it from the repository. ```bash - pip install meson ninja +git clone https://github.com/SSCHAcode/CellConstructo +cd CellConstructor ``` -* The C, C++, and Fortran compilers you intend to use. +### Step 3: Install CellConstructor -## Method 1: Using Environment Variables (Recommended for most cases) - -Meson automatically detects compilers using standard environment variables. You can set these variables before running the installation command. This is the simplest way to specify a compiler for a single build. - -The key variables are: +With the environment active, install the package using *pip*. *pip* will automatically use Meson to compile and install the project. ```bash - CC: Specifies the C compiler executable. - - CXX: Specifies the C++ compiler executable. - - FC: Specifies the Fortran compiler executable. +pip install . ``` -# Step-by-Step Instructions +The installation is now complete! You can verify it by running the tests or importing the modules in Python. -1. Open your terminal. All commands must be run in the same session, as environment variables are typically not permanent. +## Advanced Installation: Manual Configuration -2. Set the environment variables to point to your desired compilers. +This section is for users who cannot use Conda or need to configure the build with specific compilers or options. - Example for C (using a specific gcc): +### Prerequisites -```bash - export CC=/path/to/my/custom/gcc -``` +* A C and Fortran compiler. - Example for Fortran (using a specific gfortran): +* Python 3.12 and pip. -```bash - export FC=/path/to/my/custom/gfortran -``` +* Ninja and Meson: *pip install meson ninja*. -3. Combine them as needed. For this project, you will likely need to set CC and FC. +* System libraries for BLAS, LAPACK, and MPI. -```bash - # Example using compilers from a specific toolchain - export CC=/usr/local/bin/gcc-11 - export FC=/usr/local/bin/gfortran-11 -``` +### Method 1: Using Environment Variables -4. Run the pip installation. With the variables set, run pip install from the project's root directory. pip will pass the environment variables down to Meson. +You can specify compilers by setting the *CC* (C compiler) and *FC* (Fortran compiler) environment variables before running *pip*. ```bash - # Ensure you are in the project's root directory (where pyproject.toml is) - pip install . -``` +# Example using compilers from a specific toolchain +export CC=/usr/local/bin/gcc-11 +export FC=/usr/local/bin/gfortran-11 -## Method 2: Using a Meson Cross File (Advanced & Reproducible) - -For a more permanent or reproducible setup (e.g., in CI/CD pipelines or complex environments), a Meson "cross file" is the best practice. This file explicitly defines the toolchain. - -# Step-by-Step Instructions - -1. Create a cross file. In your project's root directory, create a file named native-toolchain.ini. +# Install the project +pip install . +``` -2. Edit the file to specify the paths to your compilers in the [binaries] section. +### Method 2: Using a Meson Cross File - Example native-toolchain.ini: +For a reproducible setup, define your compilers in a file (e.g., native-toolchain.ini). +Example *native-toolchain.ini*: ```bash - # native-toolchain.ini - [binaries] - c = '/path/to/my/custom/gcc' - fortran = '/path/to/my/custom/gfortran' +[binaries] +c = '/path/to/my/custom/gcc' +fortran = '/path/to/my/custom/gfortran' ``` -3. Run the pip installation with meson-args. +Then, install by passing this file to Meson via pip: ```bash - pip install . --config-settings=meson-args="--native-file=native-toolchain.ini" +pip install . --config-settings=meson-args="--native-file=native-toolchain.ini" ``` +### Build Options +You can pass options to Meson to customize the build. -### Advanced Configuration: Using Meson Build Options - -Meson allows you to configure the build using options, which act like on/off switches or settings. You can pass these options during installation using the same --config-settings flag. This is useful for enabling features or changing the build type. - -The general syntax is -D=. - -# Example 1: Creating a Debug Build - -By default, the project is built in release mode for performance. To build with debugging symbols and fewer optimizations (useful for development), you can change the built-in buildtype option. +* Create a debug build: ```bash pip install . --config-settings=meson-args="-Dbuildtype=debug" ``` -# Example 2: Enabling Project-Specific Features (like MKL) - -This project has an option to use Intel's Math Kernel Library (MKL) instead of standard BLAS/LAPACK. This is controlled by the use_mkl option defined in meson.options. - -To enable it, set it to true during installation: +* Enable Intel MKL (requires MKL to be installed and findable by your system): ```bash pip install . --config-settings=meson-args="-Duse_mkl=true" ``` -## Combining Multiple Options - -You can combine multiple Meson arguments by separating them with commas inside the string. - -# Example: A debug build using MKL: +* Combine multiple options: ```bash pip install . --config-settings=meson-args="-Dbuildtype=debug,-Duse_mkl=true" ``` -# Important: Reconfiguring a Build - -If you have already built the project and want to change a configuration option, pip might not automatically rebuild it. It is best practice to first clean any previous build artifacts. +#### Reconfiguring a Build -You can force a clean rebuild by uninstalling the package and manually deleting the build directory before running the new install command. +If you need to change build options, it is best to perform a clean installation. -1. Uninstall the package ```bash +# 1. Uninstall the package pip uninstall CellConstructor -``` -2. (Optional but recommended) Remove the build directory -```bash + +# 2. (Optional but recommended) Remove the build directory rm -rf build/ -``` -3. Reinstall with the new options -```bash + +# 3. Reinstall with the new options pip install . --config-settings=meson-args="-Dnew_option=value" ```