
README file for "calcpi" code, by Clint Conrad, January 2008

The fortran code in this directory implements Kaminski & Ribe's [Geochem. Geophys. Geosyst., 3(8), 1051, doi:10.1029/2001GC00022, 2002] method for estimating the Infinite Strain Axis (ISA) and the PI parameter from a flow field. It is designed to operate on the mantle flow model of Conrad  et al., [2007] (see citation below).

This directory contains several fortran subroutines (*.f), a makefile, and a Make.pl perl script that compiles everything (this may need to be amended for your implemented based on your compiler, etc.). Running "Make.pl" will compile two programs, "findnn" and "calcpi". Both are described briefly below.

FINDNN:
This program can be run as follows:
findnn < in.findnn
This program picks out the nearest points that are neighbors each point in the finite element grid. Performing this calculation can be time consuming on an irregular grid, so we do this external to the main calculation. Thus, "findnn" only needs to be run once, and "calcpi" will use the output of "findnn" to speed its own calculations of spatial gradients. The sample input file, "in.findnn", has only four lines:
1. Resolution of the finite element grid
2. Search Radius
3. Finite Element nodal location file
4. List of nearest neighbor points for each node of the finite element grid

CALCPI:
This program can be run as follows:
calcpi < in.calcpi.inexv
This program takes the mantle flow model and calculates PI and ISA using Kaminski & Ribe's [2002] formulation. The input file has 24 lines:
1. Resolution of the finite element grid
2. xyzt file for time step 1 (Nodal locations, temperature, viscosity)
3. velocity file for time step 1
4. stress file for time step 1
5. Time Step Info: Time-Dependence Flag (on/off), 1st Time Step, 2nd Time Step
6. Time Stepping File
7. xyzt file for time step 2 (Nodal locations, temperature, viscosity)
8. velocity file for time step 2
9. stress file for time step 2
10. Nearest Neighbor File (output from findnn)
11. Output Flags (on/off): EHAT (aka. ISA), THETA, time-depdence of THETA, PI
12. EHAT output file (ISA)
13. THETA output file 
14. d(THETA)/dt output file
15. PI output file
16. Output Flags (on/off): theta gradient, phi gradient, z gradient
17. partial(THETA)/partial(theta) output file
18. partial(THETA)/partial(phi) output file
19. partial(THETA)/partial(z) output file
20. Output Flags (on/off): tau_isa, tau_flow, PI_time-dependent, PI_space-dependent
21. tau_ISA timescale (from K&R2002) output file
22. tau_flow timescale (from K&R2002) output file
23. Time-dependent component of PI output file
23. Spatial-Derivative component of PI output file

QUESTIONS?

Feel free to contact Clint Conrad:
-------------------------------------------------------
Clint Conrad
Department of Earth & Planetary Sciences
Johns Hopkins University
410-516-3922, conrad@jhu.edu
http://www.jhu.edu/~cconrad1/
-------------------------------------------------------

CITATION: If you use this code, please cite the following article:

C.P. Conrad, M.D. Behn, and P.G. Silver, Global mantle flow and the development of seismic anisotropy: Differences between the oceanic and continental upper mantle, Journal of Geophysical Research, 112, B07317, doi:10.1029/2006JB004608, 2007.



