* XTM_GRID.CMN
* pre-defined and user-defined grids and axis for TMAP programs
*
* revision 1.00 - 05/25/87 - by M. Verschell
* revision 1.01 - 12/90 - by S.Hankin - reordered variables to avoid
*			  word misalignment error on DEC/MIPS RISC CPU
* Unix/RISC port 4/91 - increased grid_filename size for full path

* 9/95 *sh* : added dynamic grid creation variables
*		To preserve compatibility with older code a new area for
*		dynamic grids was created **above** max_grids
* see detailed description of dynamic grids in TM_ALLO_DYN_GRID 
* 10/95 *sh*: added dynamix axes (lines) in a similar style
* v500: 3/99 *kob* - up line_name to length of 64
* V510 *sh* 3/00 - change from may_dyn_lines to line_ceiling
*		   and same for grid_ceiling
*		 - remove line_parm1 (unused)
*		 - dimension line_parent and line_class for all lines
*	*sh* 5/00 - add line_keep_flag for "solo" lines defined by a file
*  * acm* 12/00  - add line_cal_name for alternative calendar types
* V541 *sh* 2/01 - added line_modulo_len
* V570 *acm* 5/04  Remove line_has_edges; never used.
* V581 *acm* 6/05 - For fix to bug 1271, add flag line_shift_origin
*            and restore original t0 on output
* V600 *acm* 2/06 - For bug 1394, increase size of line_units to 64
* V600 *acm* 6/05  Attribute control. New flag line_fixname to let us restore the
*                  original name on output if it was changed on input. (cd_axis_name.F)
*      *jli* 9/06  add line_reversed, for striding on a reversed axis
* V62   2/09 *acm* Save the original upper/lowercase spelling of axis names in line_name_orig,
*                  for use on output of user-defined variables when MODE UPCASE_OUTPUT is cancelled.
* V64  10/09 *acm* longer string length for grid_name
* v685  3/13 *acm* new line_write for writing axes to xml
* v694 1/15 *acm* for ticket 2227: if a dimension from a nc file is not also a 
*                 1-D coordinate var, don't write the axis Ferret creates. New flag 
*                 line_dim_only marking axes that are defined from a dimension only

	CHARACTER*128	grid_filename
	CHARACTER*20	line_t0
	CHARACTER*64	line_units, line_name, line_name_orig
	CHARACTER*32	line_cal_name
	CHARACTER*64	grid_name
	CHARACTER*2	line_direction, axis_orients
	INTEGER		line_subsc1, line_dim, line_unit_code, grid_line,
     .			next_line_mem_pos, grid_use_cnt, grid_flink,
     .			grid_blink, grid_free_ptr, max_grid_used,
     .			line_parent, line_use_cnt, line_flink, line_blink,
     .			line_class, line_free_ptr, max_line_used,
     .                  pline_mem_init, line_offset, line_dattype
	LOGICAL		grid_out_prod, line_regular, line_modulo, line_reversed,
     .			line_keep_flag, line_shift_origin, line_fixname, line_write,
     .			line_dim_only
	REAL		line_tunit, grid_rotation
	REAL*8		line_start, line_delta, line_mem, line_modulo_len

	COMMON / XGRID /
     .			line_start	( 0:line_ceiling ),
     .			line_delta	( 0:line_ceiling ),
     .			line_modulo_len	( 0:line_ceiling ),
     .			line_mem	( maxlinestore),
     .
     .			grid_filename	( maxgridfiles),
     .
     .			line_name	( 0:line_ceiling ),
     .			line_name_orig	( 0:line_ceiling ),
     .			line_subsc1	( 0:line_ceiling ),
     .			line_dim	( 0:line_ceiling ),
     .			line_units	( 0:line_ceiling ),
     .			line_unit_code	( 0:line_ceiling ),
     .			line_regular	( 0:line_ceiling ),
     .			line_modulo	( 0:line_ceiling ),
     .			line_t0		( 0:line_ceiling ),
     .			line_tunit	( 0:line_ceiling ),
     .			next_line_mem_pos,
     .			line_parent	( 0:line_ceiling ),
     .			line_use_cnt	( 0:line_ceiling ),
!     .			line_has_edges	( 0:line_ceiling ),
     .			line_flink	( max_lines:line_ceiling ),
     .			line_blink	( max_lines:line_ceiling ),
     .			line_class	( 0:line_ceiling ),
     .			line_keep_flag  ( 0:line_ceiling ),
     .			line_fixname    ( 0:line_ceiling ),
     .			line_shift_origin( 0:line_ceiling ),
     .			line_write      ( 0:line_ceiling ),
     .			line_dim_only   ( 0:line_ceiling ),
     .			line_free_ptr,
     .			max_line_used,
     .			line_cal_name  ( 0:line_ceiling ),
     .                  pline_mem_init,
     .
     .			grid_name	( 0:grid_ceiling ),
     .			grid_line	( nferdims, 0:grid_ceiling ),
     .			grid_out_prod	( nferdims, 0:grid_ceiling ),
     .			grid_rotation	( 0:grid_ceiling ),
     .			grid_use_cnt	( 0:grid_ceiling ),
     .			grid_flink	( max_grids:grid_ceiling ),
     .			grid_blink	( max_grids:grid_ceiling ),
     .			grid_free_ptr,
     .			max_grid_used,
     .
     .			line_direction	( 0:line_ceiling ),
     .			axis_orients	( 0:max_axis_orients ),
     .                  line_reversed   ( 0:line_ceiling),
     .                  line_offset     ( 0:line_ceiling),
     .                  line_dattype    ( 0:line_ceiling)

* note: the zero subscript is a scratch buffer

