[IPython-User] Fortran cell magic

Chao YUE chaoyuejoy@gmail....
Tue Sep 17 11:23:22 CDT 2013


OK, thanks. I understand.

thanks for this good work.

cheers,

Chao


On Tue, Sep 17, 2013 at 6:19 PM, Martín Gaitán <gaitan@phasety.com> wrote:

>
> On Tue, Sep 17, 2013 at 1:01 PM, Chao YUE <chaoyuejoy@gmail.com> wrote:
>
>> Dear Martin,
>>
>> I am following your github instruction and successfully installed the
>> fortran magic.
>>
>> I am having this error when I tried to execute some line of code:
>>
>> ImportError: /homel/ychao/.cache/ipython/fortran/_fortran_magic_aed467970fab506a0a5170ace559f7a0.so: cannot open shared object file: No such file or directory
>>
>>
>> the code is rather simple:
>>
>> %%fortran
>> INTEGER,PARAMETER  :: r_std = 4
>> REAL(r_std),PARAMETER :: so_cond = 1.5396
>>   REAL(r_std),PARAMETER :: so_capa = 2.0514e+6
>>
>> could you give some some hints? GREAT thanks for this contribution.
>>
>> cheers,
>>
>> Chao
>>
>
>
> Hi Chao,
>
> Unfortunately I had no time to resume the work on this, but I'll do asap.
>
> However, your problem is that you didn't define any namespace for your
> code. f2py convert modules, subroutines or functions. So try wrapping like
> this
>
> In [2]:
>
> %%fortran
>
> module a
>
>     INTEGER,PARAMETER  :: r_std = 4
>
>     REAL(r_std),PARAMETER :: so_cond = 1.5396
>
>     REAL(r_std),PARAMETER :: so_capa = 2.0514e+6
>
> end module
>
> In [3]:
>
> a.r_std
>
> Out[3]:
>
> array(4, dtype=int32)
>
> cheers
> martin
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>


-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130917/5351c023/attachment.html 


More information about the IPython-User mailing list