Giter Site home page Giter Site logo

jakubowiczish / fortran-task3 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 813 KB

My solution for Fortran assignment - task 3

Fortran 95.66% Makefile 4.34%
fortran fortran90 fortran-language fortran2008 fortran-modules integration integrate coarray-fortran coarray coarrays

fortran-task3's Introduction

Fortran task 3 - Integration using coarrays

Source files

There are 4 source files in src directory:

  • main.F90 - contains major part of the project
  • rectangular_integration.F90 - rectangular integration interface
  • trapezoidal_rule_integration.F90 - trapezoidal rule integration interface
  • testing_function.F90 - contains exemplary functions that are integrated in main.F90
  • I did not do the part of the task with Gaussian integration

Running instruction

  1. Clone repository
  2. Go to src directory
  3. Type make run in terminal
    • Results will be printed on standard output.
    • Results will be also stored in additional file: integration_results.txt in res directory
There might be several warnings like:
[0] MPI startup(): I_MPI_SCALABLE_OPTIMIZATION environment variable is not supported.
[0] MPI startup(): I_MPI_JOB_CONTEXT environment variable is not supported.
[0] MPI startup(): Similar variables:
	 I_MPI_HYDRA_PMI_CONNECT
[0] MPI startup(): I_MPI_DEVICE environment variable is not supported.
[0] MPI startup(): Similar variables:
	 I_MPI_ADJUST_REDUCE
[0] MPI startup(): I_MPI_FALLBACK environment variable is not supported.
[0] MPI startup(): I_MPI_CAF_RUNTIME environment variable is not supported.
[0] MPI startup(): Similar variables:
	 I_MPI_THREAD_RUNTIME
[0] MPI startup(): To check the list of supported variables, use the impi_info utility or refer to https://software.intel.com/en-us/mpi-library/documentation/get-started.

Results and conclusions

Everything works fine, results are presented for small intervals like integrating from -1.0 to 3.0.

For larger intervals there were huge gaps between real result and result calculated by those 2 methods.

All results are available in integration_results.txt in res directory

I used wolfram alpha in order to show you that the results are quite correct:

  1. Result for integrating y = sin(x)
  • Using trapezoidal rule: 1.55694762674353
  • Using rectangular rule: 1.54635237758489
  • Using Wolfram Alpha:

alt text

  1. Result for integrating y = e^x
  • Using trapezoidal rule: 20.1267405355118
  • Using rectangular rule: 19.5137530615636
  • Using Wolfram Alpha:

alt text

  1. Result for integrating y = x**5 + 4 * x**4 + 6 * x**3 + 4 * x**2 + 9 * x + 1
  • Using trapezoidal rule: 535.125000000000
  • Using rectangular rule: 503.265625000000
  • Using Wolfram Alpha:

alt text

  1. Result for integrating y = (x**3 - x**2) / (x - 20)
  • Using trapezoidal rule: -0.637918548248534
  • Using rectangular rule: -0.604718665448629
  • Using Wolfram Alpha:

alt text

Results might differ from one another because of the method used and because of number of images

fortran-task3's People

Contributors

jakubowiczish avatar

Stargazers

 avatar

Watchers

 avatar

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.