Skip to content

A simple high-level field object in Fortran that manages domain decomposition via coarrays

Notifications You must be signed in to change notification settings

smillerc/coarray_field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A high level coarray field object to manage domain decomposition

  • The goal of this project is to demonstrate how coarrays can be used to decompose a domain for physics-type simulations.
  • This project starts off with the Field class from the book Modern Fortran by Milan Curcic
  • Rudimentary field serialization is via the h5fortran library by Michael Hirsch
  • Eventual OpenCL integration via the Focal library by Laurence Kedward

Build instructions

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE="Debug" \
    -DENABLE_COARRAY=ON \
    -DUSE_OPENMP_THREADS=NO \
    -DUSE_OPENMP_SIMD=YES \
    -DUSE_OPENCL=NO \
    -DENABLE_TESTING=YES

Example Use [WIP]

type(field_2d_t) :: rho, u, rho_u

rho = field_2d(name='rho', long_name='density', &
               descrip='Cell-centered mass density', &
               units='g/cc', global_dims=[20, 20], n_halo_cells=2)

u = field_2d(name='u', long_name='x-velocity', &
               descrip='Cell-centered x-velocity', &
               units='cm/s', global_dims=[20, 20], n_halo_cells=2)

! Create a new field based off of existing ones
rho_u = rho * u

! Get max
call rho_u%maxval()

About

A simple high-level field object in Fortran that manages domain decomposition via coarrays

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages