This section outlines the MASA interface for Fortran90. To use the masa fortran interfaces, make sure to "use masa" within your source code files. An example of a fortran routine is below, and several other simple examples are provided in the examples section.
Compiling MASA requires additional library linkage. The user is encouraged to reference Installation/Linkage for details.
In addition, the user should reference the full Fortran90 API documentation for complete details on all available MASA functions.
program main
use iso_c_binding
implicit none
! solutions
real(8) :: ufield,vfield,efield,rho
real(8) :: exact_u,exact_v,exact_p,exact_rho
! problem size
integer :: i,j
integer :: nx = 71
integer :: ny = 93
integer :: lx=3
integer :: ly=1
real(8) :: dx,dy
real(8) :: x,y
! initialize the problem
dx = real(lx)/real(nx)
dy = real(ly)/real(ny);
! initialize the problem
call
masa_init(
'mytest',
'navierstokes_2d_compressible')
! evaluate
masa functions (2D)
do i=0, nx
do j=0, ny
y = j*dy
x = i*dx
! evalulate source terms
! evaluate analytical terms
enddo
enddo
end program main