HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/numpy/f2py/__pycache__/f90mod_rules.cpython-310.pyc
o

���gz%�@szdZddd�ZdZddlZddlmZdd	lmZdd
lm	Z	m
Z
ddlTiZdd
�Z
de��jZdZdZdd�ZdS)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)�*cCsPt|�r|gSt|�s
gSg}|dD]}t|�r|�|�q|t|�}q|S)N�body)�ismodule�hasbody�append�findf90modules)�m�ret�b�r�B/usr/local/lib/python3.10/dist-packages/numpy/f2py/f90mod_rules.pyrsra�      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%Cs�ddlm}gggddgddd�dggd�}d	g}|fd
d�}d	g}|fdd
�}t|�}t|�D�]�}gggg|dggf\}	}
}}}
}g}g}g}t|�r\|dD]	}|
�|d�qR|d��D]}|d|}||
vrttt	�|�s|�|�|�|�qbt
d|d�|d|vr�|s�t
d|d�d��q0|r�t
dd�|��d	g}|fdd�}d	g}|fdd�}t�
|�}|d|d�|d|d�t|�r�|d}t|t�r�d�|�}||�|r�|d�|D]�}|d|}|�|�t�|�}tj|}t�||�}|d�dd ���}|�d!d ���}|�sd }t}|d"t|�|d#||t�|�f�|d$t�||��t|��rW|d}t|t��rQd�|�}|d%|�t|��r�|
�d&|d|f�|�|
d'�|	�d(|�|�d)�|d*|d|f�|d+|
d'�|d,|dt|�f�|d-�|d.t|d.<tdt|d#�d�}|d/d0�d1d2�|D���|d.||d.<|d3|
d'�q�|
�|�|	�d4|�|�d5�|d6|d|f�q�|�r�|d7�t|��r�|dD]�}t|��st
d8|d9�d|d�d���q�|�d:|d�|d|d;<|�|�\} }!t |��rM|d.|!|d.<|
�d<|d|df�|�t!j"|dd=��n1|!�rp|d.|!|d.<|
�d<|d|df�|�t!j#|dd=��n|
�|d�|�|
d'�g| d><t$| |�}"g|"d?<g|"d@<t%||"�}|dA|d|d|d|d|df�|	�d4|d�|�dB�|d6|d|df��q�|dC�|dD�dE|dd0�|	�|d.f|d.<dF|dv�r�dG}#nd}#|dH|#|d|d�&�d0�|�f�|dI|d�|dJ|#|d|d�&�|df�|dK�|dL|||dL<dM|d|d|dfg|dN|dN<|d	�|dO|d�|�rYt'|�D]
}$|dP|d|$f��qK|�rj|d�dQg|��|dR�|dS�|�rt'|�D]	}$|dT|$��qu|dUd0�t'|
���|dV|d�|d�|dW��dXdY��g|dW<|d?�dZ|dd0�t'|��f�q0d	|d[<g|d\<g|d@<|d.|dW<t(|d?�dk�r�d	|d?<||d.fS)]Nr)�rules�F_FUNCz
arrayobject.h�
)�	includes0�includesz"Fortran 90/95 modules:\n")�f90modhooks�initf90modhooksr
�need�
separatorsfor�docs�latexdoc�cS�d|d|f|d<dS)Nz%s
      %srr��line�srrr�fadd[�zbuildhooks.<locals>.faddcSr �Nz%s
%srrr!rrr�dadd_r%zbuildhooks.<locals>.dadd�namer
�varsz.		Constructing F90 module support for "%s"...
z			Skipping z since it is in 'use'...
z		  Variables: %s
� cSr r&rr!rrr�caddzr%zbuildhooks.<locals>.caddcSr r&rr!rrr�iadd~r%zbuildhooks.<locals>.iaddz'static FortranDataDef f2py_%s_def[] = {z.\subsection{Fortran 90/95 module \texttt{%s}}
�notez\begin{description}�dimsr	z-1�:z	{"%s",%s,{{%s}},%s, %s},�rankz\item[]{{}\verb@%s@{}}z--- %szf2py_%s_getdims_%srz8void (*%s)(int*,npy_intp*,void(*)(char*,npy_intp*),int*)z6void (*)(int*,npy_intp*,void(*)(char*,npy_intp*),int*)z!	f2py_%s_def[i_f2py++].func = %s;z#subroutine %s(r,s,f2pysetdata,flag)zuse %s, only: d => %s
z
integer flag
rz allocate(d(%s))
�,cSsg|]}d|�qS)zs(%s)r)�.0�irrr�
<listcomp>�szbuildhooks.<locals>.<listcomp>zend subroutine %szchar *%szchar*z!	f2py_%s_def[i_f2py++].data = %s;z\end{description}z"f90mod_rules.buildhooks: skipping �blockz%s()�
modulenamezf2pywrap_%s_%s)�	signature�externroutinesr�docshortza	{"%s",-1,{{-1}},0,0,NULL,(void *)f2py_rout_#modulename#_%s_%s,doc_f2py_rout_#modulename#_%s_%s},zchar *z	{NULL}
};
�}z0static void f2py_setup_%s(%s) {
	int i_f2py=0;%s�_�	F_FUNC_USz4extern void %s(f2pyinit%s,F2PYINIT%s)(void (*)(%s));z static void f2py_init_%s(void) {z*	%s(f2pyinit%s,F2PYINIT%s)(f2py_setup_%s);z}
rzN	PyDict_SetItemString(d, "%s", PyFortranObject_New(f2py_%s_def,f2py_init_%s));rz$subroutine f2pyinit%s(f2pysetupfunc)zuse %s, only : %s�	interfacez
end interfacezexternal f2pysetupfunczexternal %szcall f2pysetupfunc(%s)zend subroutine f2pyinit%s
rz\subsection{z\subsubsection{z"	%s --- %s"�routine_defs�doc))rr�getuseblocksrrr
�keys�l_or�
isintent_hide�	isprivate�outmess�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�len)%�pymodrr�fhooksr$r?r'�usenamesr�sargs�fargs�efargs�modobjs�notvars�onlyvars�sargsp�ifargs�mfargsr�n�var�chooksr+�ihooksr,�vrdr-�ct�at�dm�dms�
use_fgetdims2�api�wrap�arr�arrr�
buildhooksRsz���

��





��
�


�
��



�
�
�

 �

�
������
�rz)�__doc__�__version__�f2py_version�numpy�nprrr�crackfortranrr�auxfuncs�optionsr�intp�itemsizerTrP�fgetdims2_sarzrrrr�<module>s 

�