MASA-0.44.0
Fortran Interface

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 masa
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
exact_u = masa_eval_2d_exact_u (x,y)
exact_v = masa_eval_2d_exact_v (x,y)
exact_p = masa_eval_2d_exact_p (x,y)
exact_rho = masa_eval_2d_exact_rho (x,y)
enddo
enddo
end program main

Generated on Tue Apr 21 2015 10:22:49 for MASA-0.44.0 by  doxygen 1.8.5