# LFortran example and request to development team

**URL:** <https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391>\
**Category:** LFortran\
**Created:** [February 11, 2024, 3:18pm UTC](https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391 "2024-02-11T15:18:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![apoorv01](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@apoorv01](https://fortran-lang.discourse.group/u/apoorv01)\
**Post date:** [February 11, 2024, 3:18pm UTC](https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391/1 "2024-02-11T15:18:33Z")

</div>

Hi,  
I am trying my hand in lfortran and came across this example (example 4) in documentation  
[https://docs.lfortran.org/en/design/](https://docs.lfortran.org/en/design/)

Somehow that example is not working for me. I have installed lfortran on my ubuntu 22.04 LTS laptop via the Miniconda installation and using jupyter notebook.

Also can someone guide me in calling fortran library (will prefer .a file) from lfortran script. Though am an adept user of Modern fortran but this is new to me. I am looking for simpler option to get simple plots from fortran (lfortran and combine it with old fortran libraries). Till now I have experimented with Python-Fortran integration. But if simple plots and the mandelbrot example are possible in lfortran that will solve my problem and encourage me to shift back fully to fortran. Also if an explanation of manderbot example is added in lfortran web app, that would be very helpful.

Regards  
Apurva

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [February 12, 2024, 4:55am UTC](https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391/2 "2024-02-12T04:55:44Z")

</div>

Hi @apoorv01, thanks for the feedback. We need to update the design documentation, I created an issue for it at [Update the design documentation · Issue #3392 · lfortran/lfortran · GitHub](https://github.com/lfortran/lfortran/issues/3392).

You can call a module interactively like this:

```auto
>>> use test_M, only: f 1,20 ]
>>> call f() 1,9 ]
OK

```

Where you compile the module using:

```console
lfortran a.f90 -c

```

And the source code of it is:

```fortran
module test_M
contains

    subroutine f()
    print *, "OK"
    end subroutine

end module

```

However LFortran is still alpha, you can follow our progress towards beta at [https://lfortran.org/](https://lfortran.org/), there is a nice progress bar there. Until then the expectation is that you will discover bugs. The interactive feature especially will have bugs, as we are first focusing on compiling existing codes, and once we reach beta quality for that, we plan to get interactivity and other features up to par as well.

We are always looking for new contributors and for help. The more people, the sooner we’ll get there.

---

<div class="post-metadata">

**Author:** ![apoorv01](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@apoorv01](https://fortran-lang.discourse.group/u/apoorv01)\
**Post date:** [February 12, 2024, 9:25am UTC](https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391/3 "2024-02-12T09:25:53Z")

</div>

Hi @certik, thanks for your message. I think I am facing issue because F95 style derived types are missing in lfortran.

Following is the code I am trying

Main file

[T2.f90](https://fortran-lang.discourse.group/uploads/short-url/9c9z3tn40dqoNfxawMDbqQIDiiD.f90) (272 Bytes)

the module file

[TTT.f90](https://fortran-lang.discourse.group/uploads/short-url/bZS5mdfntXpR8OSMOIFZgpaPhKw.f90) (619 Bytes)

The error I am getting is the following  
**code generation error: Printing support is not available for `input01` type.**

As I am from Computational Aerodynamics background, I cannot contribute directly to development of lfortran. Once it is in beta phase; I will try it for simple problems first and may be contribute few examples.

Best Regards  
Apurva

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [February 14, 2024, 8:55pm UTC](https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391/4 "2024-02-14T20:55:05Z")

</div>

For now change `write (*,*)` to `print *,`, then it works. I reported this bug at [Printing derived types works with `print` but not `write` · Issue #3413 · lfortran/lfortran · GitHub](https://github.com/lfortran/lfortran/issues/3413).

For your example I am getting:

```console
$ lfortran TTT.f90 -c && lfortran T2.f90
Inside Subroutine 3.00000000000000000e+01 2.00000000000000000e+01 2.40000000000000000e+01
$ gfortran TTT.f90 T2.f90 && ./a.out
 Inside Subroutine 30.000000000000000 20.000000000000000 24.000000000000000

```

---

<div class="post-metadata">

**Author:** ![apoorv01](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@apoorv01](https://fortran-lang.discourse.group/u/apoorv01)\
**Post date:** [February 15, 2024, 2:12am UTC](https://fortran-lang.discourse.group/t/lfortran-example-and-request-to-development-team/7391/5 "2024-02-15T02:12:46Z")

</div>

@certik  
Thanks for you help, it worked now
