
    Kh&                         S r SSS rSrSSKrSSKJr  SS	KJr  SS
KJ	r	J
r
  SSK7  0 rS rS\R                  " 5       R                  -  rSrSrS rg)a2  
Build F90 module support for f2py2e.

Copyright 1999 -- 2011 Pearu Peterson all rights reserved.
Copyright 2011 -- present NumPy Developers.
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.

NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
z$Revision: 1.27 $
   zSee `f2py -v`    N   )	capi_maps)	func2subr)undo_rmbadnameundo_rmbadname1)*c                     [        U 5      (       a  U /$ [        U 5      (       d  / $ / nU S    H4  n[        U5      (       a  UR                  U5        M&  U[        U5      -   nM6     U$ )Nbody)ismodulehasbodyappendfindf90modules)mretbs      I/var/www/html/env/lib/python3.13/site-packages/numpy/f2py/f90mod_rules.pyr   r      s]    {{s
1::	
CvYA;;JJqMq))C	 
 J    a        external f2pysetdata
      logical ns
      integer r,i
      integer(%d) 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)) thenz      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))z      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
         !s(r) must be equal to len(d(1))
      end if
      flag = 2
      call f2pysetdata(d,allocated(d))c                    SSK Jn  / / / SS/SSS.S// S.nS	/nU4S
 jnS	/nU4S jn[        U 5      n[        U 5       GH  n/ / / / US   // 4u  ppp/ n/ n/ n[	        U5      (       a   US    H  nUR                  US   5        M     US   R                  5        Hh  nUS   U   nUU;  d  M  [        U5      (       d  M%  [        [        [        5      " U5      (       a  MF  UR                  U5        UR                  U5        Mj     [        SUS   -  5        [        U5      S:X  a-  [        U5      S:X  a  US   U;   a  [        SUS    S35        GM  US   U;   a%  [        U5      (       a  [        SUS    S35        GMD  U(       a  [        SSR                  U5      -  5        S	/nU4S jnS	/nU4S jn[        R                   " U5      nU" SUS   -  5        U" SUS   -  5        [#        U5      (       a3  US   n[%        U[&        5      (       a  SR                  U5      nU" U5        U(       a  U" S5        U GH  nUS   U   nUR                  U5        [        R(                  " U5      n[        R*                  U   n[        R,                  " UU5      nUS   R/                  SS5      R1                  5       nUR/                  SS5      R1                  5       nU(       d  Sn[2        nU" S [5        U5      < S!US"   < S#U< S$U< S%[        R6                  " U5      < S&35        U" S'[        R8                  " UU5      -  5        [#        U5      (       a6  US   n[%        U[&        5      (       a  SR                  U5      nU" S(U-  5        [;        U5      (       Ga  U
R                  S)US   < S*U< 35        UR                  U
S+   5        U	R                  S,U-  5        UR                  S-5        U" S.US   < S/U< S035        U" S1U
S+   -  5        U" S2US   < S3[5        U5      < S35        U" S45        US   [<        -   US'   [?        S[A        US"   5      S-   5      nU" S5S6R                  U V s/ s H  n S7U -  PM
     sn 5      -  5        US   U-   US'   U" S8U
S+   -  5        GMs  U
R                  U5        U	R                  S9U-  5        UR                  S:5        U" S.US   < S;U< S035        GM     U(       a  U" S<5        [	        U5      (       Ga  US    GH  n[C        U5      (       d  [        S=US>    SUS    S35        M.  UR                  S?US   -  5        US   US@'   URE                  U5      u  n!n"[G        U5      (       aO  US   U"-   US'   U
R                  SAUS   < SBUS   < 35        UR                  [H        RJ                  " USSC95        O~U"(       aO  US   U"-   US'   U
R                  SAUS   < SBUS   < 35        UR                  [H        RL                  " USSC95        O(U
R                  US   5        UR                  U
S+   5        / U!SD'   [O        U!U5      n#/ U#SE'   / U#SF'   [Q        UU#5      nU" S US   < SGUS   < SBUS   < SHUS   < SBUS   < S&35        U	R                  S9US   -  5        UR                  SI5        U" S.US   < S;US   < S035        GM     U" SJ5        U" SK5        SLUS   < SMS6R                  U	5      < SNUS   < 3US'   SBUS   ;   a  SOn$OSn$U" SPU$< SQUS   < SRUS   RS                  5       < SSS6R                  U5      < ST3	5        U" SUUS   -  5        U" SVU$< SQUS   < SRUS   RS                  5       < SWUS   < SX3	5        U" SY5        USZ   U-   U-   USZ'   S[US   < S\US   < S]US   < ST3/US^   -   US^'   U" S	5        U" S_US   -  5        U(       a%  [U        U5       H  n%U" S2US   < S`U%< 35        M     U(       a#  U" SR                  Sa/U-   5      5        U" Sb5        U" Sc5        U(       a  [U        U5       H  n%U" SdU%-  5        M     U" SeS6R                  [U        U
5      5      -  5        U" SfUS   -  5        U" SR                  USg   5      R/                  ShSi5      5        / USg'   USE   R                  SjUS   < SkS6R                  [U        U5      5      < Sl35        GM     S	USm'   / USn'   / USF'   US   USg'   [        USE   5      S::  a  S	USE'   X#S   4$ s  sn f )oNr   )rulesF_FUNCzarrayobject.h
)	includes0includesz"Fortran 90/95 modules:\n")f90modhooksinitf90modhooksr   needseparatorsfordocslatexdoc c                 "    US   < SU < 3US'   g )Nr   z
       liness     r   faddbuildhooks.<locals>.fadd[   s    !"1t,!r   c                 "    US   < SU < 3US'   g Nr   r   r$   r%   s     r   daddbuildhooks.<locals>.dadd_   s    Q4&!r   namer   varsz.		Constructing F90 module support for "%s"...
r   z			Skipping z7 since there are no public vars/func in this module...
z5 since it is in 'use' and contains a common block...
z		  Variables: %s
 c                 "    US   < SU < 3US'   g r+   r$   r%   s     r   caddbuildhooks.<locals>.cadd        tT*AaDr   c                 "    US   < SU < 3US'   g r+   r$   r%   s     r   iaddbuildhooks.<locals>.iadd   r4   r   z'static FortranDataDef f2py_%s_def[] = {z.\subsection{Fortran 90/95 module \texttt{%s}}
notez\begin{description}dimsr
   z-1:z	{"z",rankz,{{z}},z, z},z\item[]{{}\verb@%s@{}}z--- %sf2py_	_getdims_r   z8void (*%s)(int*,npy_intp*,void(*)(char*,npy_intp*),int*)z6void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*)z	f2py_z_def[i_f2py++].func = ;z#subroutine %s(r,s,f2pysetdata,flag)zuse z, only: d => zinteger flag
z allocate(d(%s))
,zs(%s)zend subroutine %szchar *%szchar*z_def[i_f2py++].data = z\end{description}z"f90mod_rules.buildhooks: skipping blockz%s()
modulename	f2pywrap__)	signatureexternroutinesr    docshortz4",-1,{{-1}},0,0,NULL,(void *)f2py_rout_#modulename#_z,doc_f2py_rout_#modulename#_zchar *z	{NULL}
};
}zstatic void f2py_setup_(z) {
	int i_f2py=0;	F_FUNC_USzextern void z	(f2pyinitz	,F2PYINITz)(void (*)(z));z static void f2py_init_%s(void) {	z)(f2py_setup_z);z}
r   z	PyDict_SetItemString(d, "z", PyFortranObject_New(f2py_z_def,f2py_init_r   z$subroutine f2pyinit%s(f2pysetupfunc)z	, only : 	interfacezend interfacezexternal f2pysetupfunczexternal %szcall f2pysetupfunc(%s)zend subroutine f2pyinit%s
r!   z\subsection{z\subsubsection{z"	z --- "routine_defsdoc)+r"   r   getuseblocksr   r   r   keys
isvariablel_orisintent_hide	isprivateoutmesslencontainscommonjoinr   modsign2maphasnote
isinstancelistgetctype
c2capi_map
getarrdimsreplacestrip	fgetdims2r	   
get_elsizegetarrdocsignisallocatable	fgetdims1rangeint	isroutinebuildapi
isfunctionr   createfuncwrappercreatesubrwrapper
applyrules
dictappendupperr   )&pymodr   r   fhooksr(   rN   r,   usenamesr   sargsfargsefargsmodobjsnotvarsonlyvarssargspifargsmfargsr   nvarchooksr2   ihooksr6   vrdr8   ctatdmdmsuse_fgetdims2iapiwraparr   as&                                         r   
buildhooksr   R   s0	   Ro.*.DA12	C
 TF -$C ' E"HE";=r2rfIL<8fw1::vYqy) 6!AF)A,C Z__tMS\?]^a?b?b"a  " 	C6 	x=A#g,!"3&	W8Loai[0hij V9 ^A%6%6oai[0fgh+sxx/ABC 	+ 	+ ##A&6!F)DE@AfINO1::V9D$%%yyJ'(AF)A,CNN1##C(B%%b)B%%a-BV*$$S$/557C++c4(..0C%M!!$bj#r&&s+- . +))!S13 4s||6{dD))99T?DX&'S!!QvYBCeBi(NRSTVVWQvYJK:eBiHIi!35 6%&"1I	1q	As2f:23)hhS9S!S9:< ="1I5q	(E"I67QZ1-.g&QvYJKU V %&1::vY || ))*7Aai[D Ev634"#F),!NN1-	Ta== &q	D 0F1ILLQvY&	!JKMM)"="=a1"MN$*1I$4q	6AfI%NO%77QGI QvY/eBi0(*$%S)6
!#: b) &	1V9ai6AfIO P Z1V956h'i6, -A D 	S	fIsxxq	3q	!F) FF&	1V9??#4chhv6FH 	I/1V9=>&	1V9??#4aiA 	BU /&86AMfIqy!F)#- ".034E0F"GR3qyAB#F+AfIq9: ,;-&012!%&#F+]a() ,%.2G)HIJ*ai89TYYs:'///1 	2 JFai.1hh~g7N.OQ 	RE #J CCJC
O!fC
O
3v;1Fq	>u  :s   :e)__doc____version__f2py_versionnumpynpr"   r   r   crackfortranr   r	   auxfuncsoptionsr   intpitemsizerf   rb   fgetdims2_sar   r$   r   r   <module>r      sj   	 ""R(    9
 
7  :<9K9K!L	$*		*|r   