General introduction: AGRIF software

The main idea of this software is to bring (fixed or adaptive) mesh refinement features to existing models that are written in the Fortran language and discretized on a structured grid. The software is divided in two parts:

  • a source to source code converter (“CONV”) that transform a unigrid code in a multigrid code
  • a library that implements grids interactions.

agrif_set_bc_interp : Type of interpolation at boundaries

Alternatives

Main contributors:

Laurent Debreu, Christophe Vouland, Cyril Mazauric, Marc Honnorat , Roland Patoum + all beta testers/occasional developers (special Thanks: R. Benshila, G. Cambon, F. Lemarie, Jean Marc Molines, Franck Vigilant)

A typical compilation organization

Let our compilation directory be organized as follows:

src/:

Agrif2Model.F90 <--- glue code: should be compiled last
Agrif_User.F90  <--- written by the user
agrif.in        <--- config. file for 'conv'
code.F90        <--- single-grid model with Agrif directives

work/:

AGRIF/             <--- a copy of Agrif library
AGRIF_INC/         <--- empty directory
AGRIF_MODEL_FILES/ <--- empty directory

conv configuration file:

Example: agrif.in file

% Dimension and Number of cells in each direction %
2D nx,ny;

% Name of the common file that contains the cells variables:
% - an include file (paramfile) %
% - OR a module (parammodule) %
parammodule mod_global;

% Use only fixed grids in this example
USE ONLY_FIXED_GRIDS;``

inside code.F90:

module mod_global

  integer :: nx, ny

  real(8), allocatable, dimension(:,:) :: gridvar

end module mod_global