Skip to content

Instantly share code, notes, and snippets.

View Building Block 1- Uniform Stream.nb
V = 1;
\[Psi] = V y;
u1 = D[\[Psi], y];
v1 = D[-\[Psi], x];
StreamPlot[{{u1, v1}, {-v1, u1}}, {x, -3, 3}, {y, -3, 3},
StreamStyle -> {{Blue}, {Red, Dashed, Arrowheads[0]}},
ImageSize -> Medium]
View fortranFunctionParser.f90
program main
use function_parser
use iso_fortran_env, only: wp => real64, output_unit
implicit none
character(len=50):: func ='sin(x)'
integer,parameter :: nvar = 1 !! number of variables
character(len=*),dimension(nvar),parameter :: var = [ 'x' ]
real(wp),dimension(nvar) :: val = [ 2.0_wp ]
View Newton-Raphson.f90
PROGRAM ME
EXTERNAL ff,ffder
x0=1
CALL newton(ff,ffder,x0,1e-7,1e-7,10,iflag)
IF(iflag>1) THEN
PRINT *, "there was an error occurred"
ENDIF
fx0=ff(x0)
PRINT *, x0,fx0
READ (*,*)
View f90.sublime-built
{
"shell_cmd": "gfortran \"${file}\" -o \"${file_path}\\_${file_base_name}\"",
"file_regex": "^(?xi:( ^[/] [^:]* ) : (\\d+) : (\\d+) :)",
"working_dir": "${file_path}",
"selector": "source.modern-fortran, source.fixedform-fortran",
"syntax": "GFortranBuild.sublime-syntax",
"variants":
[
{
"name": "Run",
You can’t perform that action at this time.