Difference between revisions of "Glam output"

From SourceWiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:glam]]
 +
 
= Output from GLAM =
 
= Output from GLAM =
  
 
== Selecting output from GLAM ==
 
== Selecting output from GLAM ==
  
GLAM outputs 2d and 3d variables in files <tt>glam.2df</tt> and <tt>glam.3df</tt>, respectively.  These files are binary and can be read with MATLAB scripts (see below).  The interval between output is selected using the variable <tt>nout</tt> within <tt>glam.nml</tt>.  The three elements of this array contain intervals for point, 2d and 3d output (the first is no longer used).  The unit is years.  Note that GLAM will also output at the first (<tt>tstr</tt>) and final (<tt>tstr+trun</tt>) time step irrespective of these settings; the actual time integration loop runs from <tt>tstr+tinc</tt> until <tt>trun</tt> is exceeded.  The variable <tt>nstrv</tt>  can be used to control when output starts in a time-dependent simulation; output will only be written after <tt>nstr</tt> (in years).  This is useful if we are only interested in the equilibrium.
+
GLAM outputs 2d and 3d variables in files <tt>glam.2df</tt> and <tt>glam.3df</tt>, respectively (located in subversion repository "glam-matlab").  These files are binary and can be read with MATLAB scripts (see below).  The interval between output is selected using the variable <tt>nout</tt> within <tt>glam.nml</tt>.  The three elements of this array contain intervals for point, 2d and 3d output (the first is no longer used).  The unit is years.  Note that GLAM will also output at the first (<tt>tstr</tt>) and final (<tt>tstr+trun</tt>) time step irrespective of these settings; the actual time integration loop runs from <tt>tstr+tinc</tt> until <tt>trun</tt> is exceeded.  The variable <tt>nstrv</tt>  can be used to control when output starts in a time-dependent simulation; output will only be written after <tt>nstr</tt> (in years).  This is useful if we are only interested in the equilibrium.
  
 
The variables that are output can be selected by editing <tt>glam.out</tt>.  This file contains two arrays (<tt>which2d</tt> and <tt>which3d</tt>).  Output for a particular variable is selected if the appropriate entry in the array is 1 (otherwise set to zero).  The variables currently available for output are shown in Tables 1 and 2.
 
The variables that are output can be selected by editing <tt>glam.out</tt>.  This file contains two arrays (<tt>which2d</tt> and <tt>which3d</tt>).  Output for a particular variable is selected if the appropriate entry in the array is 1 (otherwise set to zero).  The variables currently available for output are shown in Tables 1 and 2.
Line 15: Line 17:
 
| 2||Horizontal velocity in y||Staggered||m yr<sup>-1</sup>||v
 
| 2||Horizontal velocity in y||Staggered||m yr<sup>-1</sup>||v
 
|-
 
|-
| 3||Vertical velocity||Normal||m yr<sup>-1</sup>||w|
+
| 3||Vertical velocity||Normal||m yr<sup>-1</sup>||w  
 
|-
 
|-
 
| 4||Vertical velocity of grid||Normal||m yr<sup>-1</sup>||wg
 
| 4||Vertical velocity of grid||Normal||m yr<sup>-1</sup>||wg
Line 31: Line 33:
 
| 10||Vertical shear stress in y||Normal||Pa||tyz
 
| 10||Vertical shear stress in y||Normal||Pa||tyz
 
|-
 
|-
| 11||Horizontal shear||Normal||Pa||txy
+
| 11||Horizontal shear stress||Normal||Pa||txy
 
|-
 
|-
 
| 12||Longitudinal stress deviator in x||Normal||Pa||txx
 
| 12||Longitudinal stress deviator in x||Normal||Pa||txx
Line 41: Line 43:
 
| 15||Gravitational driving stress in y||Normal||Pa||gdy
 
| 15||Gravitational driving stress in y||Normal||Pa||gdy
 
|-
 
|-
| ||Horizontal distances||Both||m||vxn yn xs ys
+
| ||Horizontal distances||Both||m|| xn yn xs ys
 
|-
 
|-
 
| ||Vertical distances||Both||m||zn zs
 
| ||Vertical distances||Both||m||zn zs
Line 50: Line 52:
 
== Viewing output from GLAM in MATLAB ==
 
== Viewing output from GLAM in MATLAB ==
  
The GLAM output files can be loaded using MATLAB scripts <tt>glam2d.m</tt> and <tt>glam3d.m</tt>.  Both are called using <tt>[a] = glam3d(N,PATH);</tt> (where <tt>N</tt> is the time step of interest and <tt>PATH</tt> is the relative location of the output file, e.g. ‘.’ for same directory).  These scripts create a MATLAB structure that can be referenced as follows.  For 3d output, use <tt>a.NAME(I,J,K)</tt> where <tt>NAME</tt> is the variable’s MATLAB name (see Tables 1 and 2), <tt>I</tt> and <tt>J</tt> are horizontal indices and <tt>K</tt> the vertical index.  Note that it is often necessary to compress the 3d array to a 2d array for plotting purposes using <tt>squeeze()</tt>.  The command <tt>imagesc(squeeze(a.txz(:,:,end)))</tt> will produce an image of basal traction.
+
The GLAM output files can be loaded using MATLAB scripts <tt>glam2d.m</tt> and <tt>glam3d.m</tt>.  Both are called using <tt>[a] = glam3d(N,'PATH');</tt> (where <tt>N</tt> is the time step of interest and <tt>PATH</tt> is the relative location of the output file, e.g. ‘.’ for same directory).  These scripts create a MATLAB structure that can be referenced as follows.  For 3d output, use <tt>a.NAME(I,J,K)</tt> where <tt>NAME</tt> is the variable’s MATLAB name (see Tables 1 and 2), <tt>I</tt> and <tt>J</tt> are horizontal indices and <tt>K</tt> the vertical index.  Note that it is often necessary to compress the 3d array to a 2d array for plotting purposes using <tt>squeeze()</tt>.  The command <tt>imagesc(squeeze(a.txz(:,:,end)))</tt> will produce an image of basal traction.

Latest revision as of 15:42, 1 August 2007


Output from GLAM

Selecting output from GLAM

GLAM outputs 2d and 3d variables in files glam.2df and glam.3df, respectively (located in subversion repository "glam-matlab"). These files are binary and can be read with MATLAB scripts (see below). The interval between output is selected using the variable nout within glam.nml. The three elements of this array contain intervals for point, 2d and 3d output (the first is no longer used). The unit is years. Note that GLAM will also output at the first (tstr) and final (tstr+trun) time step irrespective of these settings; the actual time integration loop runs from tstr+tinc until trun is exceeded. The variable nstrv can be used to control when output starts in a time-dependent simulation; output will only be written after nstr (in years). This is useful if we are only interested in the equilibrium.

The variables that are output can be selected by editing glam.out. This file contains two arrays (which2d and which3d). Output for a particular variable is selected if the appropriate entry in the array is 1 (otherwise set to zero). The variables currently available for output are shown in Tables 1 and 2.

Table 1. 3d variables available from GLAM.
Variable Grid Units MATLAB name
1 Horizontal velocity in x Staggered m yr-1 u
2 Horizontal velocity in y Staggered m yr-1 v
3 Vertical velocity Normal m yr-1 w
4 Vertical velocity of grid Normal m yr-1 wg
5 Glen’s A Normal Pa-3 yr-1 a
6 Temperature Normal deg. C t
7 Effective viscosity Normal Pa s evs
8 Effective stress Normal Pa tau
9 Vertical shear stress in x Normal Pa txz
10 Vertical shear stress in y Normal Pa tyz
11 Horizontal shear stress Normal Pa txy
12 Longitudinal stress deviator in x Normal Pa txx
13 Longitudinal stress deviator in y Normal Pa tyy
14 Gravitational driving stress in x Normal Pa gdx
15 Gravitational driving stress in y Normal Pa gdy
Horizontal distances Both m xn yn xs ys
Vertical distances Both m zn zs

Table 2. needs to be done

Viewing output from GLAM in MATLAB

The GLAM output files can be loaded using MATLAB scripts glam2d.m and glam3d.m. Both are called using [a] = glam3d(N,'PATH'); (where N is the time step of interest and PATH is the relative location of the output file, e.g. ‘.’ for same directory). These scripts create a MATLAB structure that can be referenced as follows. For 3d output, use a.NAME(I,J,K) where NAME is the variable’s MATLAB name (see Tables 1 and 2), I and J are horizontal indices and K the vertical index. Note that it is often necessary to compress the 3d array to a 2d array for plotting purposes using squeeze(). The command imagesc(squeeze(a.txz(:,:,end))) will produce an image of basal traction.