Giter Site home page Giter Site logo

fortran-fans / forlab Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 4.0 6.42 MB

Forlab is a Fortran module that provides a lot of functions for scientific computing mostly inspired by Matlab and Python's package NumPy.

Home Page: https://fortran-fans.github.io/forlab/

License: Other

Fortran 99.84% Makefile 0.10% Shell 0.06%
fortran fpm functions numerical

forlab's People

Contributors

euler-37 avatar keurfonluu avatar st-maxwell avatar zoziha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

forlab's Issues

Return value polymorphic function

For example, x = zeros(dim1, dim2, ...) function.

flag

We add a flag to the function, this flag is consistent with the precision of the return value.

x = zeros(dim1, dim2, ..., flag)

ref from: https://fortran-lang.discourse.group/t/fortran-function-return-value-polymorphism/1350/5

But we found that this method is actually not good for the user experience. We want to find other ways.

function name

We can abandon the idea of a polymorphic function interface and set up the following functions:

szeros / dzeros / qzeros
default: zeros = szeros

real(integer, kind)

Maybe we can imitate the standard function of Fortran, the real function.
ref from:

  1. {"real", {{"a", AnyNumeric, Rank::elementalOrBOZ}, DefaultingKIND}
  2. https://github.com/llvm/llvm-project/blob/d8805574c183484f055552855fa82d2e8932415e/flang/runtime/numeric.h#L22
  3. https://github.com/llvm/llvm-project/blob/d8805574c183484f055552855fa82d2e8932415e/flang/runtime/numeric.cpp
  4. https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/flang/runtime/type-code.cpp
real(integer, kind)

Final question

Should we implement the second method first. It will be more difficult to implement the third method? May need to use c/c++, so we need to ensure that fpm can build such code.
fortran-lang/fpm#353
https://github.com/fortran-lang/fpm/tree/master/example_packages/with_c

Or do we have a better way?

Unused variable i in a few places

fpm build gives

.\.\src\forlab_stats_var.f90:162:27:

  162 |         integer :: opt_w, i
      |                           1
Warning: Unused variable 'i' declared at (1) [-Wunused-variable]
.\.\src\forlab_stats_var.f90:141:27:

  141 |         integer :: opt_w, i
      |                           1
Warning: Unused variable 'i' declared at (1) [-Wunused-variable]
.\.\src\forlab_stats_var.f90:120:27:

  120 |         integer :: opt_w, i
      |                           1
Warning: Unused variable 'i' declared at (1) [-Wunused-variable]

How to deal with more and more `fypp` files

Every time we compile with make tool, our fypp files generate all the f90 files.

With the increase of fypp files, how do we make the make tool only update the fypp files that we modify?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.